[Gc] gc: bug leads to segfault in prelinked binaries

Boehm, Hans hans_boehm at hp.com
Tue Feb 17 10:18:00 PST 2004


Thanks.

This is already in my tree, which should be available shortly.  I was
convinced that the patch is indeed correct, though that wasn't originally
obvious to me either.

There is a longstanding discussion about __libc_stack_end.  According to
glibc rules the collector should indeed not be using it.  And it doesn't if
your version of libc doesn't export it.  The problem is that all the
sanctioned alternatives are technically inferior, so the collector still
tries to use it first.  It gets itself into trouble if it's there but contains
the wrong value, which is what happens with prelinked libraries.  Fortunately,
the wrong value is always zero.

Hans

> -----Original Message-----
> From: gc-bounces at napali.hpl.hp.com
> [mailto:gc-bounces at napali.hpl.hp.com]On Behalf Of Moritz Barsnick
> Sent: Tuesday, February 17, 2004 12:43 AM
> To: GC List
> Subject: [Gc] gc: bug leads to segfault in prelinked binaries
> 
> 
> Hi,
> 
> I'm a non-subscriber, but I hope you'll accept my report anyway.
> 
> Recently, I discovered a segfault in my favorite web browser, w3m
> (http://w3m.sf.net/). This was on a relatively new Fedora Linux
> distribution (ex-RedHat, http://fedora.redhat.com/). I pretty quickly
> cornered it down to the new prelink mechanism, which is now enabled by
> default in Fedora, and I suppose many distributions will follow (check
> http://www.gentoo.org/doc/en/prelink-howto.xml).
> 
> I reported this bug against Fedora in the RedHat bug tracking system
> under https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=115201 .
> There, the maintainer of the w3m package pointed out that 
> this is a bug
> in gc. "It makes assumptions about __libc_stack_end which it certainly
> should not do."
> 
> This bug is present both in 6.2 and in 6.3alpha4 (the newest I could
> find) and will be very critical for all apps which use gc on such
> prelink-aware systems.
> 
> I've attached the patch provided by RedHat, and hope it is correct and
> is included soon. "It works for me." ;-)
> 
> Thanks,
> best regards,
> Moritz
> 


More information about the Gc mailing list