On Wed, Apr 10, 2019 at 12:44:27PM +0200, Emmanuel Hocdet wrote:
> > Hi Emmanuel,
> > 
> > This bug is caused by libpthread which is not linked with libgcc_s, so it 
> > tries
> > to load libgcc_s during the call to phtread_exit() but that can't work if 
> > the
> > process is chroot'ed.
> > 
> > Your solution is the good one, but it was not working on some 
> > distributions, I
> > add to do ADDLIB="-Wl,--no-as-needed -lgcc_s -Wl,--as-needed" instead.
> > 
> > Regards,
> > 
> > -- 
> > William Lallemand
> 
> Hi William,
> 
> Thanks for clarifying. It’s annoying…
> And --no-as-needed also depend on gcc tools version…
> 
> ++
> Manu

For reference:

https://sourceware.org/git/?p=glibc.git;a=blob;f=nptl/pthread_cancel.c;hb=HEAD#l38
When the glibc is generated as a dynamic library, pthread_cancel call the
pthread_cancel_init() function.

https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/nptl/unwind-forcedunwind.c;hb=HEAD#l53
This function try to load libgcc_s by doing a dlopen.

It looks like it's working in some distributions without haproxy being linked
to libgcc_s or libpthread linked to libgcc_s, but I didn't find any explicit
fix for that.

-- 
William Lallemand

Reply via email to