This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug nptl/3102] New: Threaded programs can't use chroot at startup, due to nptl's use of dlopen


When calling pthread_exit in a program which has called chroot, the
program exits with the error message

  libgcc_s.so.1 must be installed for pthread_cancel to work

The problem is that the nptl library needs the stack unwind code from
libgcc_s.so.1, and it uses dlopen to load this library.

I tried to install arlad, configured to use posix threads. This
program chroots to /usr/arla/cache at startup, before doing any
interesting thread operations.

Then the later dlopen by the nptl code naturally fails, and it
displays the above error message and calls _exit.

I'm not terribly familiar with the POSIX standard or with POSIX
threads, but it seems unintuitive and probably not standards compliant
that a threaded server program can't use chroot at startup.

A workaround seems to be to link the program with an explicit -lgcc_s
on the command line, in addition to -lpthread, but as far as I
understand, one should never need to link explicitly with libgcc_s.

I'm running linux-2.4.17.4 on a debian x86 box.

(I reported this bug on the debian glibc package a while ago,
http://bugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=360933, but I
haven't seen any progress there and I don't think the problem is debian specific
in any way).

-- 
           Summary: Threaded programs can't use chroot at startup, due to
                    nptl's use of dlopen
           Product: glibc
           Version: 2.3.2
            Status: NEW
          Severity: normal
          Priority: P2
         Component: nptl
        AssignedTo: drepper at redhat dot com
        ReportedBy: nisse at lysator dot liu dot se
                CC: glibc-bugs at sources dot redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=3102

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]