This service will be undergoing maintenance at 20:00 UTC, 2017-04-03. It is expected to last about 30 minutes
Bug 159261 - Sample crash.c doesn't compile on 2.6 kernels
Sample crash.c doesn't compile on 2.6 kernels
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: netdump (Show other bugs)
4.0
i686 Linux
medium Severity low
: ---
: ---
Assigned To: Dave Anderson
:
: 120405 (view as bug list)
Depends On:
Blocks: 168429
  Show dependency treegraph
 
Reported: 2005-05-31 20:04 EDT by Seva
Modified: 2007-11-30 17:07 EST (History)
3 users (show)

See Also:
Fixed In Version: RHBA-2006-0038
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-03-07 13:23:59 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Makefile (79 bytes, text/plain)
2005-05-31 20:05 EDT, Seva
no flags Details
crash.c (432 bytes, text/plain)
2005-05-31 20:06 EDT, Seva
no flags Details

  None (edit)
Description Seva 2005-05-31 20:04:11 EDT
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):
netdump-0.7.4-2

How reproducible:
Always

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

Additional info:

crash.c needs to be ported to 2.6 kernel build infrastructure
Comment 1 Seva 2005-05-31 20:05:13 EDT
Created attachment 115014 [details]
Makefile

2.6 kernel based build system Makefile
Comment 2 Seva 2005-05-31 20:06:13 EDT
Created attachment 115015 [details]
crash.c

crash.c ported to 2.6 kernel build system
Comment 3 Dave Anderson 2005-06-01 08:37:42 EDT
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".
Comment 4 Dave Anderson 2005-06-01 08:46:46 EDT
*** Bug 120405 has been marked as a duplicate of this bug. ***
Comment 5 Seva 2005-06-01 11:13:08 EDT
Perhaps the documentation needs to be updated a bit, I wasn't aware of the
sysrq-trigger /proc entry.
Comment 6 Dave Anderson 2005-06-01 11:57:17 EDT
Agreed...
Comment 7 Ken Hall 2005-11-18 13:41:49 EST
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?
Comment 8 Dave Anderson 2005-11-18 14:04:51 EST
> 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.


Comment 9 Dave Anderson 2006-01-17 13:20:19 EST
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.
Comment 14 Red Hat Bugzilla 2006-03-07 13:24:00 EST
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.

http://rhn.redhat.com/errata/RHBA-2006-0038.html

Note You need to log in before you can comment on or make changes to this bug.