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/22637] guard size is subtracted from thread stack size instead of adding it on top


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

--- Comment #5 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.24/master has been updated
       via  e853f05a5757dfee0c8b7f301e6a52047cc9864a (commit)
       via  d8d97c0539c4258ecf8d46a184e853acad577199 (commit)
       via  9ae4fa0c5b5087f3a1391753d54d7f3086224f77 (commit)
       via  fff112f4c4442af52bec90353e80bc4e801ab79b (commit)
       via  23758d3539232de8368ea601f2df1c2a9da145e8 (commit)
      from  659b3df5db97948f4c6042203163873fb96ec512 (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=e853f05a5757dfee0c8b7f301e6a52047cc9864a

commit e853f05a5757dfee0c8b7f301e6a52047cc9864a
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=d8d97c0539c4258ecf8d46a184e853acad577199

commit d8d97c0539c4258ecf8d46a184e853acad577199
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=9ae4fa0c5b5087f3a1391753d54d7f3086224f77

commit 9ae4fa0c5b5087f3a1391753d54d7f3086224f77
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=fff112f4c4442af52bec90353e80bc4e801ab79b

commit fff112f4c4442af52bec90353e80bc4e801ab79b
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=23758d3539232de8368ea601f2df1c2a9da145e8

commit 23758d3539232de8368ea601f2df1c2a9da145e8
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)

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                     |   31 +++++++++++++++++
 NEWS                                          |    2 +
 nptl/Makefile                                 |    4 ++-
 nptl/allocatestack.c                          |    4 ++
 nptl/descr.h                                  |    4 +-
 nptl/nptl-init.c                              |    5 +--
 nptl/pthread_getattr_np.c                     |    7 +++-
 nptl/{tst-detach1.c => tst-minstack-cancel.c} |   45 ++++++++++--------------
 nptl/{tst-detach1.c => tst-minstack-exit.c}   |   43 +++++++++--------------
 sysdeps/gnu/unwind-resume.c                   |    8 +++-
 sysdeps/nptl/unwind-forcedunwind.c            |    2 +-
 11 files changed, 91 insertions(+), 64 deletions(-)
 copy nptl/{tst-detach1.c => tst-minstack-cancel.c} (55%)
 copy nptl/{tst-detach1.c => tst-minstack-exit.c} (55%)

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