let's assume, that the exit() code itself is clean ...
then you're left with funcionts that were registered
There are two ways to check this ...
- search the complete code for "atexit" and debug the
functions that are registered.
- replace exit() in this case with _exit() ...
a side-effect of this is, that FILE-buffers are _not_
flushed and that atexit-functions are _not_ called.
(If the SIGBUS disappears you have a hint of what went wrong)
The SIGBUS is (quite likely) generated due to a disaligned
access of data ... on some hardware (like the x86 family)
a 32-bit access to an address that is not 32-bit-aligned will
get a penalty of 1 or more waitstates.
... on other hardware like the Mips R3000 R4000 R10000 family
such an access is not possible ... therefore a SIGBUS will be
Look at the following code snippet:
cptr = (char *) &l;
lptr = (long *) cptr;
*lptr = 1;
This invokes a disaligned access to memory ... and might
result in a SIGBUS on the HPUX 11.
Regards ... Rainer