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/13119] New: Erroneous "libgcc_s.so.1 must be installed for pthread_cancel to work" message


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

             Bug #: 13119
           Summary: Erroneous "libgcc_s.so.1 must be installed for
                    pthread_cancel to work" message
           Product: glibc
           Version: 2.14
            Status: NEW
          Severity: minor
          Priority: P2
         Component: nptl
        AssignedTo: drepper.fsp@gmail.com
        ReportedBy: tavianator@tavianator.com
    Classification: Unclassified


This is a bit awkward to reproduce, but I found it when attempting to run my
raytracer with a ridiculous number (50,000) of threads.  Here's a reduced
testcase:

$ cat foo.c#include <pthread.h>

void *
bar(void *ptr)
{
  return NULL;
}

void *
foo(void *ptr)
{
  pthread_t thread;
  while (1) {
    if (pthread_create(&thread, NULL, bar, NULL) != 0) {
      pthread_exit(NULL);
    }
  }
  return NULL;
}

int
main()
{
  pthread_t thread;
  pthread_create(&thread, NULL, foo, NULL);
  pthread_join(thread, NULL);
  return 0;
}
$ gcc foo.c -pthread && ./a.out
libgcc_s.so.1 must be installed for pthread_cancel to work

The error comes from nptl/sysdeps/pthread/unwind-forcedunwind.c, which tries to
"__libc_dlopen (LIBGCC_S_SO);".  But in elf/dl-load.c,
_dl_map_object_from_fd(), line 1281, the __mmap() fails with ENOMEM, presumably
because the thousands of zombie threads have left no available memory.  Thus
the dlopen fails, and that message gets printed.

Obviously this isn't a very important issue, but the error message is not
exactly informative, since there's no usage of pthread_cancel() anywhere and
libgcc_s.so.1 is certainly installed.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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