Red Hat Bugzilla – Bug 159261
Sample crash.c doesn't compile on 2.6 kernels
Last modified: 2007-11-30 17:07:18 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041215 Firefox/1.0 Red Hat/1.0-12.EL4
Description of problem:
/usr/share/doc/netdump-0.7.4-2/README.client directs the user to:
Build the module with
gcc -DKERNEL -DMODULE -I/lib/modules/$(uname -r)/build/include -c crash.c
While this command succeeds, it does not produce a valid kernel module:
# /sbin/insmod ./crash.o
insmod: error inserting './crash.o': -1 Invalid module format
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. cd /usr/share/doc/netdump-0.7.4-2
2. gcc -DKERNEL -DMODULE -I/lib/modules/$(uname -r)/build/include -c crash.c
3. sbin/insmod ./crash.o
Actual Results: insmod: error inserting './crash.o': -1 Invalid module format
Expected Results: kernel panic
crash.c needs to be ported to 2.6 kernel build infrastructure
Created attachment 115014 [details]
2.6 kernel based build system Makefile
Created attachment 115015 [details]
crash.c ported to 2.6 kernel build system
Thanks. The sample crash module is pretty much fluff given
the far easier manner of force-crashing the kernel by
entering "Alt-syrq-c" or "echo c > /proc/sysrq-trigger".
*** Bug 120405 has been marked as a duplicate of this bug. ***
Perhaps the documentation needs to be updated a bit, I wasn't aware of the
sysrq-trigger /proc entry.
The "c" option for sysrq-trigger seems to be disabled in the default kernel
since the addition of the KEXEC patch. This is in 2.6.14-1.1637_FC4. Is there
a new recommended method for testing netdump?
> The "c" option for sysrq-trigger seems to be disabled in the default kernel
> since the addition of the KEXEC patch. This is in 2.6.14-1.1637_FC4. Is
> there a new recommended method for testing netdump?
Probably not. As you saw, the kexec patch in FC4 takes away the capability
of killing the system with alt-sysrq-c when a kexec kernel has NOT been loaded,
because crash_kexec() will just quietly return back to the sysrq-c handler.
I sent a patch to our Fedora kernel maintainer proposing a change to
sysrq_handle_crashdump() which will fall-back to our RHEL3/4 alt-sysrq-c
oops-generator, which would subsequently invoke netdump and/or diskdump if
enabled, or if nothing's enabled, still crash the system at will. He indicated
that it won't be available until the FC5 time frame.
The sample crash.c is deprecated.
To force a crash, the README documentation has been updated re: the
usage of alt-sysrq-c or by doing an "echo c > /proc/sysrq-trigger".
Moving forward, we will ensure that the sysrq functionality continues
to force a crash.
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.