Re: Bus error during c++ link, where is the error?
Date: Fri, 3 Sep 1999 13:49:02 +0200 (MET DST)
From: Pontus Lidman <email@example.com>
I ran into a bus error when I tried to compile flick on the Hurd.
I have seen signal 11, signal 10 and signal 4 from gcc under the
Hurd. I have seen it when bootstrapping the compiler itself (when
compiling dwarf2out.c). Could you tell me:
* The version of gcc you're using (gcc -v)?
* What happens if you set the environment variable MALLOC_CHECK_ to
0, 1 and 2?
I can't seem to think of a good method to track down the problem; I
assume the problem is not with gcc itself.
According to the output, the Bus error occurs in the linker.
Gdb trace below, gdb started as "gdb /usr/bin/c++". I can't seem to
make gdb catch the signal and give me a stack frame regardless of
the setting of "follow-fork-mode". Any advice would be appreciated.
"follow-fork-mode" is not implemented for the Hurd (it's currently
only implemented for HP-UX), so that doesn't work.
To debug a forking program you could try to run the program, suspend
it at the right moment and attach (from a different terminal) to the
child. As a matter of fact, if you have turned on the crash server
(settrans /servers/crash /hurd/crash) the Hurd will suspend any
process when it gets a fatal signal, and you can attach to the process
from gdb (answer yes when gdb asks if you want to ignore the suspend
count). This gives you the possibility to examine where the programs
crashed by doing a backtrace.
Alternatively you can invoke the ld program directly, avoiding the
forks in the gcc front end. First do a normal compilation with
`-v -save-temps' as extra options to gcc. Look at the output, and
start `ld' (or whatever other program that fails) under gdb with the
options as in the `gcc -v' output.
However, your programs seem to have no debugging symbols in them. You
may want to recompile some of them with debugging information turned
on (-g). Otherwise you'll not learn anything useful.