This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug nptl/22636] New: PTHREAD_STACK_MIN is too small on x86-64
- From: "fweimer at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Wed, 20 Dec 2017 12:37:36 +0000
- Subject: [Bug nptl/22636] New: PTHREAD_STACK_MIN is too small on x86-64
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=22636
Bug ID: 22636
Summary: PTHREAD_STACK_MIN is too small on x86-64
Product: glibc
Version: 2.26
Status: NEW
Severity: normal
Priority: P2
Component: nptl
Assignee: unassigned at sourceware dot org
Reporter: fweimer at redhat dot com
CC: drepper.fsp at gmail dot com
Depends on: 11787
Target Milestone: ---
Target: x86-64
Flags: security-
If libgcc is not linked with BIND_NOW, a thread stack size of PTHREAD_STACK_MIN
is not enough to cancel this simple thread:
292 static void*
293 my_pthread_warmup_worker(
294 void *thread_args)
295 {
296 (void)thread_args;
297 for (;;)
298 sleep(10);
299 return NULL;
300 }
(To be clear: This thread runs with a stack size of PTHREAD_STACK_MIN.)
The reason is that we need space for two XSAVE contents (signal handler and
dynamic linker trampoline for libgcc_s).
Apparently, we subtract the guard page and another page from the 16 KiB
request. Two XSAVE contexts need around 5 KiB, and the libgcc unwinder
required for cancellation needs quite a bit of stack space as well, so that the
remaining 8 KiB are simply not enough.
Linking libgcc_s with BIND_NOW should reduce stack pressure somewhat, and
fixing the guard size accounting would help as well (bug 11787).
Referenced Bugs:
https://sourceware.org/bugzilla/show_bug.cgi?id=11787
[Bug 11787] Program with large TLS segments fail.
--
You are receiving this mail because:
You are on the CC list for the bug.