This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug nptl/22298] x32: lockups on recursive pthread_mutex_lock after upgrade to 2.26
- From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Tue, 07 Nov 2017 12:53:48 +0000
- Subject: [Bug nptl/22298] x32: lockups on recursive pthread_mutex_lock after upgrade to 2.26
- Auto-submitted: auto-generated
- References: <bug-22298-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=22298
--- Comment #2 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 06be6368da16104be51ebf23f7c68a51f321673f (commit)
via 72b3c6eecde494a31dffa5604d551f88be859d73 (commit)
via dff91cd45e35e47d567274331f3deb8e87a188c9 (commit)
from b7fc95f8c8afab296f0e3c29d4effdc68663319c (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=06be6368da16104be51ebf23f7c68a51f321673f
commit 06be6368da16104be51ebf23f7c68a51f321673f
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Thu Oct 19 10:11:57 2017 -0200
nptl: Define __PTHREAD_MUTEX_{NUSERS_AFTER_KIND,USE_UNION}
This patch adds two new internal defines to set the internal
pthread_mutex_t layout required by the supported ABIS:
1. __PTHREAD_MUTEX_NUSERS_AFTER_KIND which control whether to define
__nusers fields before or after __kind. The preferred value for
is 0 for new ports and it sets __nusers before __kind.
2. __PTHREAD_MUTEX_USE_UNION which control whether internal __spins and
__list members will be place inside an union for linuxthreads
compatibility. The preferred value is 0 for ports and it sets
to not use an union to define both fields.
It fixes the wrong offsets value for __kind value on x86_64-linux-gnu-x32.
Checked with a make check run-built-tests=no on all afected ABIs.
[BZ #22298]
* nptl/allocatestack.c (allocate_stack): Check if
__PTHREAD_MUTEX_HAVE_PREV is non-zero, instead if
__PTHREAD_MUTEX_HAVE_PREV is defined.
* nptl/descr.h (pthread): Likewise.
* nptl/nptl-init.c (__pthread_initialize_minimal_internal):
Likewise.
* nptl/pthread_create.c (START_THREAD_DEFN): Likewise.
* sysdeps/nptl/fork.c (__libc_fork): Likewise.
* sysdeps/nptl/pthread.h (PTHREAD_MUTEX_INITIALIZER): Likewise.
* sysdeps/nptl/bits/thread-shared-types.h
(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION): New
defines.
(__pthread_internal_list): Check __PTHREAD_MUTEX_USE_UNION instead
of __WORDSIZE for internal layout.
(__pthread_mutex_s): Check __PTHREAD_MUTEX_NUSERS_AFTER_KIND instead
of __WORDSIZE for internal __nusers layout and
__PTHREAD_MUTEX_USE_UNION
instead of __WORDSIZE whether to use an union for __spins and __list
fields.
(__PTHREAD_MUTEX_HAVE_PREV): Define also for __PTHREAD_MUTEX_USE_UNION
case.
* sysdeps/aarch64/nptl/bits/pthreadtypes-arch.h
(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION): New
defines.
* sysdeps/alpha/nptl/bits/pthreadtypes-arch.h
(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
Likewise.
* sysdeps/arm/nptl/bits/pthreadtypes-arch.h
(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
Likewise.
* sysdeps/hppa/nptl/bits/pthreadtypes-arch.h
(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
Likewise.
* sysdeps/ia64/nptl/bits/pthreadtypes-arch.h
(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
Likewise.
* sysdeps/m68k/nptl/bits/pthreadtypes-arch.h
(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
Likewise.
* sysdeps/microblaze/nptl/bits/pthreadtypes-arch.h
(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
Likewise.
* sysdeps/mips/nptl/bits/pthreadtypes-arch.h
(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
Likewise.
* sysdeps/nios2/nptl/bits/pthreadtypes-arch.h
(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
Likewise.
* sysdeps/powerpc/nptl/bits/pthreadtypes-arch.h
(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
Likewise.
* sysdeps/s390/nptl/bits/pthreadtypes-arch.h
(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
Likewise.
* sysdeps/sh/nptl/bits/pthreadtypes-arch.h
(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
Likewise.
* sysdeps/sparc/nptl/bits/pthreadtypes-arch.h
(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
Likewise.
* sysdeps/tile/nptl/bits/pthreadtypes-arch.h
(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
Likewise.
* sysdeps/x86/nptl/bits/pthreadtypes-arch.h
(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
Likewise.
Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=72b3c6eecde494a31dffa5604d551f88be859d73
commit 72b3c6eecde494a31dffa5604d551f88be859d73
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon Oct 16 12:25:35 2017 -0200
nptl: Change tst-typesizes to _Static_assert
Instead of rely on runtime check to assure correct pthread types
size a better strategy would use _Static_assert to trigger an error
on build time (and thus allowing to check to potentially ABI breakage
on cross-compiling make check).
This patch moves nptl/tst-typesizes.c to libpthread build time on
each specific initialization routine and also remove some runtime
redundant asserts for the same type sizes.
Checked on x86_64-linux-gnu and with a build check for all affected
ABIs (aarch64-linux-gnu, alpha-linux-gnu, arm-linux-gnueabihf,
hppa-linux-gnu, i686-linux-gnu, ia64-linux-gnu, m68k-linux-gnu,
microblaze-linux-gnu, mips64-linux-gnu, mips64-n32-linux-gnu,
mips-linux-gnu, powerpc64le-linux-gnu, powerpc-linux-gnu,
s390-linux-gnu, s390x-linux-gnu, sh4-linux-gnu, sparc64-linux-gnu,
sparcv9-linux-gnu, tilegx-linux-gnu, tilegx-linux-gnu-x32,
tilepro-linux-gnu, x86_64-linux-gnu, and x86_64-linux-x32).
* nptl/pthreadP.h (ASSERT_TYPE_SIZE, ASSERT_PTHREAD_INTERNAL_SIZE):
New macros.
* nptl/pthread_attr_init.c (__pthread_mutex_init): Add build time
checks for expected input type size.
* nptl/pthread_barrier_init.c (__pthread_barrier_init): Likewise.
* nptl/pthread_barrierattr_init.c (pthread_barrierattr_init):
Likewise.
* nptl/pthread_cond_init.c (__pthread_cond_init): Likewise.
* nptl/pthread_condattr_init.c (__pthread_condattr_init): Likewise.
* nptl/pthread_mutex_init.c (__pthread_mutex_init): Likewise.
* nptl/pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
* nptl/pthread_rwlock_init.c (__pthread_rwlock_init): Likewise.
* nptl/pthread_rwlockattr_init.c (pthread_rwlockattr_init): Likewise.
* nptl/sem_init.c (__new_sem_init, __old_sem_init): Likewise
* nptl/pthread_attr_destroy.c (__pthread_attr_destroy): Remove
superflous runtime assert check.
* nptl/pthread_attr_getaffinity.c (__pthread_attr_getaffinity_new):
Likewise.
* nptl/pthread_attr_getdetachstate.c (__pthread_attr_getdetachstate):
Likewise.
* nptl/pthread_attr_getguardsize.c (pthread_attr_getguardsize):
Likewise.
* nptl/pthread_attr_getinheritsched.c (__pthread_attr_getinheritsched):
Likewise.
* nptl/pthread_attr_getschedparam.c (__pthread_attr_getschedparam):
Likewise.
* nptl/pthread_attr_getschedpolicy.c (__pthread_attr_getschedpolicy):
Likewise.
* nptl/pthread_attr_getscope.c (__pthread_attr_getscope): Likewise.
* nptl/pthread_attr_getstack.c (__pthread_attr_getstack): Likewise.
* nptl/pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr):
Likewise.
* nptl/pthread_attr_getstacksize.c (__pthread_attr_getstacksize):
Likewise.
* nptl/pthread_attr_setaffinity.c (__pthread_attr_setaffinity_new):
Likewise.
* nptl/pthread_attr_setdetachstate.c (__pthread_attr_setdetachstate):
Likewise.
* nptl/pthread_attr_setguardsize.c (pthread_attr_setguardsize):
Likewise.
* nptl/pthread_attr_setinheritsched.c
(__pthread_attr_setinheritsched): Likewise.
* nptl/pthread_attr_setschedparam.c (__pthread_attr_setschedparam):
Likewise.
* nptl/pthread_attr_setschedpolicy.c (__pthread_attr_setschedpolicy):
Likewise.
* nptl/pthread_attr_setscope.c (__pthread_attr_setscope): Likewise.
* nptl/pthread_attr_setstack.c (__pthread_attr_setstack,
__old_pthread_attr_setstack): Likewise.
* nptl/pthread_attr_setstackaddr.c (__pthread_attr_setstackaddr):
Likewise.
* nptl/pthread_attr_setstacksize.c (__pthread_attr_setstacksize):
Likewise.
* nptl/pthread_getattr_default_np.c (pthread_getattr_default_np):
Likewise.
* nptl/pthread_mutex_lock.c (__pthread_mutex_lock): Likewise.
* nptl/pthread_setattr_default_np.c (pthread_setattr_default_np):
Likewise.
* nptl/tst-typesizes.c: Remove file.
Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=dff91cd45e35e47d567274331f3deb8e87a188c9
commit dff91cd45e35e47d567274331f3deb8e87a188c9
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon Oct 16 14:27:29 2017 -0200
nptl: Add tests for internal pthread_mutex_t offsets
This patch adds a new build test to check for internal fields
offsets for user visible internal field. Although currently
the only field which is statically initialized to a non zero value
is pthread_mutex_t.__data.__kind value, the tests also check the
offset of __kind, __spins, __elision (if supported), and __list
internal member. A internal header (pthread-offset.h) is added
to each major ABI with the reference value.
Checked on x86_64-linux-gnu and with a build check for all affected
ABIs (aarch64-linux-gnu, alpha-linux-gnu, arm-linux-gnueabihf,
hppa-linux-gnu, i686-linux-gnu, ia64-linux-gnu, m68k-linux-gnu,
microblaze-linux-gnu, mips64-linux-gnu, mips64-n32-linux-gnu,
mips-linux-gnu, powerpc64le-linux-gnu, powerpc-linux-gnu,
s390-linux-gnu, s390x-linux-gnu, sh4-linux-gnu, sparc64-linux-gnu,
sparcv9-linux-gnu, tilegx-linux-gnu, tilegx-linux-gnu-x32,
tilepro-linux-gnu, x86_64-linux-gnu, and x86_64-linux-x32).
* nptl/pthreadP.h (ASSERT_PTHREAD_STRING,
ASSERT_PTHREAD_INTERNAL_OFFSET): New macro.
* nptl/pthread_mutex_init.c (__pthread_mutex_init): Add build time
checks for internal pthread_mutex_t offsets.
* sysdeps/aarch64/nptl/pthread-offsets.h
(__PTHREAD_MUTEX_NUSERS_OFFSET, __PTHREAD_MUTEX_KIND_OFFSET,
__PTHREAD_MUTEX_SPINS_OFFSET, __PTHREAD_MUTEX_ELISION_OFFSET,
__PTHREAD_MUTEX_LIST_OFFSET): New macro.
* sysdeps/alpha/nptl/pthread-offsets.h: Likewise.
* sysdeps/arm/nptl/pthread-offsets.h: Likewise.
* sysdeps/hppa/nptl/pthread-offsets.h: Likewise.
* sysdeps/i386/nptl/pthread-offsets.h: Likewise.
* sysdeps/ia64/nptl/pthread-offsets.h: Likewise.
* sysdeps/m68k/nptl/pthread-offsets.h: Likewise.
* sysdeps/microblaze/nptl/pthread-offsets.h: Likewise.
* sysdeps/mips/nptl/pthread-offsets.h: Likewise.
* sysdeps/nios2/nptl/pthread-offsets.h: Likewise.
* sysdeps/powerpc/nptl/pthread-offsets.h: Likewise.
* sysdeps/s390/nptl/pthread-offsets.h: Likewise.
* sysdeps/sh/nptl/pthread-offsets.h: Likewise.
* sysdeps/sparc/nptl/pthread-offsets.h: Likewise.
* sysdeps/tile/nptl/pthread-offsets.h: Likewise.
* sysdeps/x86_64/nptl/pthread-offsets.h: Likewise.
Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 153 ++++++++++++++++++++++
nptl/allocatestack.c | 2 +-
nptl/descr.h | 2 +-
nptl/nptl-init.c | 2 +-
nptl/pthreadP.h | 14 ++
nptl/pthread_attr_destroy.c | 2 -
nptl/pthread_attr_getaffinity.c | 2 -
nptl/pthread_attr_getdetachstate.c | 2 -
nptl/pthread_attr_getguardsize.c | 2 -
nptl/pthread_attr_getinheritsched.c | 2 -
nptl/pthread_attr_getschedparam.c | 2 -
nptl/pthread_attr_getschedpolicy.c | 2 -
nptl/pthread_attr_getscope.c | 2 -
nptl/pthread_attr_getstack.c | 2 -
nptl/pthread_attr_getstackaddr.c | 2 -
nptl/pthread_attr_getstacksize.c | 2 -
nptl/pthread_attr_init.c | 5 +-
nptl/pthread_attr_setaffinity.c | 2 -
nptl/pthread_attr_setdetachstate.c | 2 -
nptl/pthread_attr_setguardsize.c | 2 -
nptl/pthread_attr_setinheritsched.c | 2 -
nptl/pthread_attr_setschedparam.c | 2 -
nptl/pthread_attr_setschedpolicy.c | 2 -
nptl/pthread_attr_setscope.c | 2 -
nptl/pthread_attr_setstack.c | 3 -
nptl/pthread_attr_setstackaddr.c | 2 -
nptl/pthread_attr_setstacksize.c | 3 -
nptl/pthread_barrier_init.c | 4 +
nptl/pthread_barrierattr_init.c | 4 +
nptl/pthread_cond_init.c | 2 +
nptl/pthread_condattr_init.c | 4 +
nptl/pthread_create.c | 4 +-
nptl/pthread_getattr_default_np.c | 2 -
nptl/pthread_mutex_init.c | 16 ++-
nptl/pthread_mutex_lock.c | 2 -
nptl/pthread_mutexattr_init.c | 4 +
nptl/pthread_rwlock_init.c | 2 +
nptl/pthread_rwlockattr_init.c | 4 +
nptl/pthread_setattr_default_np.c | 2 -
nptl/sem_init.c | 4 +
nptl/tst-typesizes.c | 95 -------------
sysdeps/aarch64/nptl/bits/pthreadtypes-arch.h | 2 +
sysdeps/aarch64/nptl/pthread-offsets.h | 5 +
sysdeps/alpha/nptl/bits/pthreadtypes-arch.h | 2 +
sysdeps/alpha/nptl/pthread-offsets.h | 5 +
sysdeps/arm/nptl/bits/pthreadtypes-arch.h | 2 +
sysdeps/arm/nptl/pthread-offsets.h | 5 +
sysdeps/hppa/nptl/bits/pthreadtypes-arch.h | 2 +
sysdeps/hppa/nptl/pthread-offsets.h | 5 +
sysdeps/i386/nptl/pthread-offsets.h | 5 +
sysdeps/ia64/nptl/bits/pthreadtypes-arch.h | 2 +
sysdeps/ia64/nptl/pthread-offsets.h | 5 +
sysdeps/m68k/nptl/bits/pthreadtypes-arch.h | 2 +
sysdeps/m68k/nptl/pthread-offsets.h | 5 +
sysdeps/microblaze/nptl/bits/pthreadtypes-arch.h | 2 +
sysdeps/microblaze/nptl/pthread-offsets.h | 5 +
sysdeps/mips/nptl/bits/pthreadtypes-arch.h | 2 +
sysdeps/mips/nptl/pthread-offsets.h | 13 ++
sysdeps/nios2/nptl/bits/pthreadtypes-arch.h | 2 +
sysdeps/nios2/nptl/pthread-offsets.h | 5 +
sysdeps/nptl/bits/thread-shared-types.h | 32 ++++-
sysdeps/nptl/fork.c | 2 +-
sysdeps/nptl/pthread.h | 2 +-
sysdeps/powerpc/nptl/bits/pthreadtypes-arch.h | 2 +
sysdeps/powerpc/nptl/pthread-offsets.h | 15 ++
sysdeps/s390/nptl/bits/pthreadtypes-arch.h | 2 +
sysdeps/s390/nptl/pthread-offsets.h | 15 ++
sysdeps/sh/nptl/bits/pthreadtypes-arch.h | 2 +
sysdeps/sh/nptl/pthread-offsets.h | 5 +
sysdeps/sparc/nptl/bits/pthreadtypes-arch.h | 2 +
sysdeps/sparc/nptl/pthread-offsets.h | 15 ++
sysdeps/tile/nptl/bits/pthreadtypes-arch.h | 2 +
sysdeps/tile/nptl/pthread-offsets.h | 15 ++
sysdeps/x86/nptl/bits/pthreadtypes-arch.h | 7 +
sysdeps/x86_64/nptl/pthread-offsets.h | 5 +
75 files changed, 410 insertions(+), 160 deletions(-)
delete mode 100644 nptl/tst-typesizes.c
create mode 100644 sysdeps/aarch64/nptl/pthread-offsets.h
create mode 100644 sysdeps/alpha/nptl/pthread-offsets.h
create mode 100644 sysdeps/arm/nptl/pthread-offsets.h
create mode 100644 sysdeps/hppa/nptl/pthread-offsets.h
create mode 100644 sysdeps/i386/nptl/pthread-offsets.h
create mode 100644 sysdeps/ia64/nptl/pthread-offsets.h
create mode 100644 sysdeps/m68k/nptl/pthread-offsets.h
create mode 100644 sysdeps/microblaze/nptl/pthread-offsets.h
create mode 100644 sysdeps/mips/nptl/pthread-offsets.h
create mode 100644 sysdeps/nios2/nptl/pthread-offsets.h
create mode 100644 sysdeps/powerpc/nptl/pthread-offsets.h
create mode 100644 sysdeps/s390/nptl/pthread-offsets.h
create mode 100644 sysdeps/sh/nptl/pthread-offsets.h
create mode 100644 sysdeps/sparc/nptl/pthread-offsets.h
create mode 100644 sysdeps/tile/nptl/pthread-offsets.h
create mode 100644 sysdeps/x86_64/nptl/pthread-offsets.h
--
You are receiving this mail because:
You are on the CC list for the bug.