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/23029] New: Repeated pthread_create returns EAGAIN if ulimit -s is too big (yes, big)


https://sourceware.org/bugzilla/show_bug.cgi?id=23029

            Bug ID: 23029
           Summary: Repeated pthread_create returns EAGAIN if ulimit -s is
                    too big (yes, big)
           Product: glibc
           Version: 2.27
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: nptl
          Assignee: unassigned at sourceware dot org
          Reporter: mjambor at suse dot cz
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

Created attachment 10932
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10932&action=edit
Testcase

The attached testcase, which creates 50 threads in a loop, fails with
EAGAIN when run within "ulimit -Sd 16386964; ulimit -Ss 1048576" on
both openSUSE Tumbleweed and Debian testing (x86_64) but runs OK on
both if the stack limit is substantially SMALLER.

This is not only weird but leads to crashes of Firefox
(https://bugzilla.mozilla.org/show_bug.cgi?id=1430759), reportedly
Chrome and perhaps also other threaded applications when run under
such (IMHO reasonable) ulimits.


To reproduce:

$ gcc test.c -lpthread
$ ./a.out 
g happened to be 41
$ ulimit -Sd 16386964
$ ulimit -Ss 1048576
$ ./a.out 
Error 11 when creating thread 15: Resource temporarily unavailable
$ ./a.out 
Error 11 when creating thread 15: Resource temporarily unavailable
$ ulimit -Ss 104857
$ ./a.out 
g happened to be 41
$ ./a.out 
g happened to be 43

-- 
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]