public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug nptl/13119] New: Erroneous "libgcc_s.so.1 must be installed for pthread_cancel to work" message
@ 2011-08-19 21:35 tavianator at tavianator dot com
  2012-12-19 10:47 ` [Bug nptl/13119] " schwab@linux-m68k.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: tavianator at tavianator dot com @ 2011-08-19 21:35 UTC (permalink / raw)
  To: glibc-bugs

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.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-07-11 16:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-19 21:35 [Bug nptl/13119] New: Erroneous "libgcc_s.so.1 must be installed for pthread_cancel to work" message tavianator at tavianator dot com
2012-12-19 10:47 ` [Bug nptl/13119] " schwab@linux-m68k.org
2014-06-27 12:24 ` fweimer at redhat dot com
2014-06-27 18:10 ` tavianator at tavianator dot com
2014-06-27 18:12 ` fweimer at redhat dot com
2021-07-11 16:38 ` cliff.atg.linkedin at gmail dot com
2021-07-11 16:45 ` fweimer at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).