This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug nptl/22637] guard size is subtracted from thread stack size instead of adding it on top
- From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Tue, 16 Jan 2018 08:47:56 +0000
- Subject: [Bug nptl/22637] guard size is subtracted from thread stack size instead of adding it on top
- Auto-submitted: auto-generated
- References: <bug-22637-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=22637
--- Comment #4 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 abf2e34ee6a9cf1b7e5afddd13971754e5c5fa82 (commit)
via 8343b9da62a81c6bbdf997f48778793553142f47 (commit)
via ea2da72230169601f06944b27ffeb6071e879b7d (commit)
via 41acd32eb74ed1f93114cad8a49438038eaf42ba (commit)
via 3e75e676da29d95cf8fbef1b1a441a40cba7ac2b (commit)
via 5d4c589ca4b527f24f04b8ad23c579499aa510bc (commit)
via aedc861c42aa371864c5c64b361181c9bcb872bb (commit)
from 771c846a71d9ee14aa3b91fd184026482da585d9 (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=abf2e34ee6a9cf1b7e5afddd13971754e5c5fa82
commit abf2e34ee6a9cf1b7e5afddd13971754e5c5fa82
Author: Florian Weimer <fweimer@redhat.com>
Date: Thu Jan 11 13:13:28 2018 +0100
csu: Update __libgcc_s_init comment
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
(cherry picked from commit 08c6e95234c60a5c2f37532d1111acf084f39345)
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8343b9da62a81c6bbdf997f48778793553142f47
commit 8343b9da62a81c6bbdf997f48778793553142f47
Author: Florian Weimer <fweimer@redhat.com>
Date: Tue Jan 16 07:19:28 2018 +0100
nptl/tst-minstack-throw: Compile in C++11 mode with GNU extensions
(cherry picked from commit b725132d2b0aeddf970b1ce3e5a24f8637a7b4c2)
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ea2da72230169601f06944b27ffeb6071e879b7d
commit ea2da72230169601f06944b27ffeb6071e879b7d
Author: Florian Weimer <fweimer@redhat.com>
Date: Mon Jan 15 15:30:00 2018 +0100
nptl: Add PTHREAD_MIN_STACK C++ throw test [BZ #22636]
(cherry picked from commit 860b0240a5645edd6490161de3f8d1d1f2786025)
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=41acd32eb74ed1f93114cad8a49438038eaf42ba
commit 41acd32eb74ed1f93114cad8a49438038eaf42ba
Author: Florian Weimer <fweimer@redhat.com>
Date: Thu Jan 11 13:13:14 2018 +0100
nptl: Add tst-minstack-cancel, tst-minstack-exit [BZ #22636]
I verified that without the guard accounting change in commit
630f4cc3aa019ede55976ea561f1a7af2f068639 (Fix stack guard size
accounting) and RTLD_NOW for libgcc_s introduced by commit
f993b8754080ac7572b692870e926d8b493db16c (nptl: Open libgcc.so with
RTLD_NOW during pthread_cancel), the tst-minstack-cancel test fails on
an AVX-512F machine. tst-minstack-exit still passes, and either of
the mentioned commit by itself frees sufficient stack space to make
tst-minstack-cancel pass, too.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
(cherry picked from commit d8b778907e5270fdeb70459842ffbc20bd2ca5e1)
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3e75e676da29d95cf8fbef1b1a441a40cba7ac2b
commit 3e75e676da29d95cf8fbef1b1a441a40cba7ac2b
Author: Florian Weimer <fweimer@redhat.com>
Date: Mon Jan 15 16:05:36 2018 +0100
nptl: Open libgcc.so with RTLD_NOW during pthread_cancel [BZ #22636]
Disabling lazy binding reduces stack usage during unwinding.
Note that RTLD_NOW only makes a difference if libgcc.so has not
already been loaded, so this is only a partial fix.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
(cherry picked from commit f993b8754080ac7572b692870e926d8b493db16c)
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5d4c589ca4b527f24f04b8ad23c579499aa510bc
commit 5d4c589ca4b527f24f04b8ad23c579499aa510bc
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date: Mon Jan 15 16:06:31 2018 +0100
[BZ #22637] Fix stack guard size accounting
Previously if user requested S stack and G guard when creating a
thread, the total mapping was S and the actual available stack was
S - G - static_tls, which is not what the user requested.
This patch fixes the guard size accounting by pretending the user
requested S+G stack. This way all later logic works out except
when reporting the user requested stack size (pthread_getattr_np)
or when computing the minimal stack size (__pthread_get_minstack).
Normally this will increase thread stack allocations by one page.
TLS accounting is not affected, that will require a separate fix.
[BZ #22637]
* nptl/descr.h (stackblock, stackblock_size): Update comments.
* nptl/allocatestack.c (allocate_stack): Add guardsize to stacksize.
* nptl/nptl-init.c (__pthread_get_minstack): Remove guardsize from
stacksize.
* nptl/pthread_getattr_np.c (pthread_getattr_np): Likewise.
(cherry picked from commit 630f4cc3aa019ede55976ea561f1a7af2f068639)
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=aedc861c42aa371864c5c64b361181c9bcb872bb
commit aedc861c42aa371864c5c64b361181c9bcb872bb
Author: Florian Weimer <fweimer@redhat.com>
Date: Mon Jan 8 14:57:25 2018 +0100
nptl: Add test for callee-saved register restore in pthread_exit
GCC PR 83641 results in a miscompilation of libpthread, which
causes pthread_exit not to restore callee-saved registers before
running destructors for objects on the stack. This test detects
this situation:
info: unsigned int, direct pthread_exit call
tst-thread-exit-clobber.cc:80: numeric comparison failure
left: 4148288912 (0xf741dd90); from: value
right: 1600833940 (0x5f6ac994); from: magic_values.v2
info: double, direct pthread_exit call
info: unsigned int, indirect pthread_exit call
info: double, indirect pthread_exit call
error: 1 test failures
(cherry picked from commit 579396ee082565ab5f42ff166a264891223b7b82)
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 48 +++++++
NEWS | 2 +
nptl/Makefile | 14 ++-
nptl/allocatestack.c | 4 +
nptl/descr.h | 4 +-
nptl/nptl-init.c | 5 +-
nptl/pthread_getattr_np.c | 7 +-
nptl/tst-minstack-cancel.c | 48 +++++++
nptl/tst-minstack-exit.c | 46 +++++++
nptl/tst-minstack-throw.cc | 87 +++++++++++++
nptl/tst-thread-exit-clobber.cc | 243 ++++++++++++++++++++++++++++++++++++
sysdeps/gnu/unwind-resume.c | 8 +-
sysdeps/nptl/unwind-forcedunwind.c | 2 +-
13 files changed, 504 insertions(+), 14 deletions(-)
create mode 100644 nptl/tst-minstack-cancel.c
create mode 100644 nptl/tst-minstack-exit.c
create mode 100644 nptl/tst-minstack-throw.cc
create mode 100644 nptl/tst-thread-exit-clobber.cc
--
You are receiving this mail because:
You are on the CC list for the bug.