[gclist] LinuxThreads+signals => SIGSEGV in system call?

Fergus Henderson fjh@cs.mu.OZ.AU
Thu, 30 Apr 1998 14:11:39 +1000

On 29-Apr-1998, David Chase <chase@world.std.com> wrote:
> At 06:56 AM 4/30/98 +1000, Fergus Henderson wrote:
> >I'm trying to port the Boehm (et al) conservative garbage collector
> >to work with LinuxThreads.  I've got it to the point where
> >it works *some* of the time.  The problem is that it sometimes
> >fails, apparently getting a segmentation fault in a signal call.
> >Any suggestions on how I can go about debugging this?
> I'm not sure how Linux threads work, or how well gdb works
> with them, but the gdb behavior you describe sounds an awful
> lot like what I get debugging MT applications with gdb under
> windows NT.  In my case, one thread is committing crimes, but
> gdb points the finger at the sleeping thread.

Yes, that was exactly right.  Manual grovelling through the stacks for
the other threads revealed that the seg fault was actually in the
`check_ints()' function in test.c.  So now I think that it is just
the "ordinary" case of a broken collector reusing memory too eagerly.

I don't know why the collector is broken, though.  The code to locate
the thread stacks seems to be doing the right thing.

Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh@        |     -- the last words of T. S. Garp.