[Bug nptl/22637] guard size is subtracted from thread stack size instead of adding it on top
cvs-commit at gcc dot gnu.org
sourceware-bugzilla@sourceware.org
Mon Jan 8 19:06:00 GMT 2018
https://sourceware.org/bugzilla/show_bug.cgi?id=22637
--- Comment #1 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, master has been updated
via 630f4cc3aa019ede55976ea561f1a7af2f068639 (commit)
from c70e4e9c9efff9df4c847dd7cfd81bae674219ab (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=630f4cc3aa019ede55976ea561f1a7af2f068639
commit 630f4cc3aa019ede55976ea561f1a7af2f068639
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date: Wed Dec 6 13:05:50 2017 +0000
[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.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 9 +++++++++
nptl/allocatestack.c | 4 ++++
nptl/descr.h | 4 ++--
nptl/nptl-init.c | 5 +----
nptl/pthread_getattr_np.c | 7 +++++--
5 files changed, 21 insertions(+), 8 deletions(-)
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Glibc-bugs
mailing list