[LCP]SIGBUS question

Joachim Bauernberger bj at gmx.net
Fri Apr 19 22:11:05 UTC 2002


Hi,
Can someone please take the time to explain to me what can cause a 
SIGBUS to be raised by a program (other than mmap) under Linux?
I have been "googling" for answers and found that it's cause seems to be 
architecture dependent? 
(I've been able to catch it by setting up a signal handler but this 
doesn't give much information other than it was indeed a SIGBUS that 
crashed the program)

Also raise()ing a SIGSTOP and then attaching to the process with gdb 
shows me it's a SIGBUS but the information gdb gives me is not very 
descriptive about why the problem occurs. It seems that on return from 
myfunc() (which calls fork/exec and writes and reads with pipes to/from 
the forked child) the programs memory gets corrupted.

I started getting the problem after moving some code into myfunc() . 
Now when the myfunc() returns the SIGBUS 
results. Looking at gdb's output:

Program received signal SIGBUS, Bus error.
mknotify (what=Cannot access memory at address 0xffffef36.
) at report.c:450
450             if (recipient) free(recipient);

mknotify() is the function calling myfunc()  and "what" is an int passed 
to it as it's first parameter.

This confuses me since I am not calling mknotify() any more upon return 
from myfunc() (before the sigbus).
Am I right to say that something in myfunc() corrupts the stack of my 
program so badly that upon it's return the program does not know 
anymore where to carry on?

The system I have the problem is a linux libc5 box (i386) Kernel 2.0.38
(don't tell me to upgrade please :-))

Thanks & Regards,
Joachim

-- 
PGP Public Key:
http://www.mXscan.org/pgp/public.html





More information about the linuxCprogramming mailing list