This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/21253] localedef randomly segfaults when using -fstack-check due to new posix_spawn implementation
- From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Mon, 03 Apr 2017 19:21:09 +0000
- Subject: [Bug libc/21253] localedef randomly segfaults when using -fstack-check due to new posix_spawn implementation
- Auto-submitted: auto-generated
- References: <bug-21253-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=21253
--- Comment #3 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, release/2.25/master has been updated
via df29db0bec24211cfc917db52024bf8deecac2c9 (commit)
from 74522eeeaa4a39809a28f44171e71d36a69edb58 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=df29db0bec24211cfc917db52024bf8deecac2c9
commit df29db0bec24211cfc917db52024bf8deecac2c9
Author: Mike Frysinger <vapier@gentoo.org>
Date: Wed Mar 15 23:59:31 2017 -0700
posix_spawn: use a larger min stack for -fstack-check [BZ #21253]
When glibc is built with -fstack-check, trying to use posix_spawn can
lead to segfaults due to gcc internally probing stack memory too far.
The new spawn API will allocate a minimum of 1 page, but the stack
checking logic might probe a couple of pages. When it tries to walk
them, everything falls apart.
The gcc internal docs [1] state the default interval checking is one
page. Which means we need two pages (the current one, and the next
probed). No target currently defines it larger.
Further, it mentions that the default minimum stack size needed to
recover from an overflow is 4/8KiB for sjlj or 8/12KiB for others.
But some Linux targets (like mips and ppc) go up to 16KiB (and some
non-Linux targets go up to 24KiB).
Let's create each child with a minimum of 32KiB slack space to support
them all, and give us future breathing room.
No test is added as existing ones crash. Even a simple call is
enough to trigger the problem:
char *argv[] = { "/bin/ls", NULL };
posix_spawn(NULL, "/bin/ls", NULL, NULL, argv, NULL);
[1] https://gcc.gnu.org/onlinedocs/gcc-6.3.0/gccint/Stack-Checking.html
(cherry picked from commit 21f042c804835d1f7a4a8e06f2c93ca35a182042)
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 6 ++++++
sysdeps/unix/sysv/linux/spawni.c | 5 +++++
2 files changed, 11 insertions(+), 0 deletions(-)
--
You are receiving this mail because:
You are on the CC list for the bug.