[PATCH 0/6] NPTL synchronization fixes

Adhemerval Zanella adhemerval.zanella@linaro.org
Thu Dec 11 20:47:16 GMT 2025


Changes from v6 [1]
* Opened BZ#33715 and moved the fix to first patch in the set.
* Reworked the pthread_testcancel test on tst-cleanup5.
* Added root user check for tst-pthread-exited.c.
* Added a fix for BZ#33717.

Changes from v5 [2]
* Extend BZ 28267 tests to cover asynchronous cancellation.
* Remov thread_state_t type.
* Issue a non cancellable __pthread_clockjoin_ex on pthread_detach
  (since it is declared as _THROW).
* Remove check_for_deadlock over a simplifies test.
* Extend __pthread_tryjoin_np comment on how the code assert it
  will not act as a cancellation entrypoint.
* Block signals before set jointstate on __libc_start_call_main.
* Change cancelable futex call on __pthread_create_2_1.  

Changes from v4 [3]:
* Rebased against master.
* Reword some comments.

[1] https://patchwork.sourceware.org/project/glibc/list/?series=55145
[2] https://patchwork.sourceware.org/project/glibc/list/?series=54776
[3] https://patchwork.sourceware.org/project/glibc/list/?series=50344

Adhemerval Zanella (6):
  nptl: Use __futex_abstimed_wait64 on pthread_create (BZ 33715)
  nptl: Set cancellation type and state on pthread_exit (BZ #28267)
  nptl: Do not use pthread set_tid_address as state synchronization (BZ
    #19951)
  nptl: Remove INVALID_TD_P
  support: Add support_thread_state_wait
  nptl: Make pthread_{clock,timed}join{_np} act on all cancellation (BZ
    33717)

 nptl/Makefile                        |   3 +
 nptl/descr.h                         |  26 +++--
 nptl/nptl-stack.h                    |   2 +-
 nptl/pthread_cancel.c                |   3 +-
 nptl/pthread_create.c                |  39 +++++--
 nptl/pthread_detach.c                |  44 +++----
 nptl/pthread_getattr_np.c            |   2 +-
 nptl/pthread_getcpuclockid.c         |   2 +-
 nptl/pthread_getschedparam.c         |   2 +-
 nptl/pthread_join_common.c           | 116 ++++++-------------
 nptl/pthread_setschedparam.c         |   2 +-
 nptl/pthread_setschedprio.c          |   2 +-
 nptl/pthread_tryjoin.c               |  25 ++--
 nptl/tst-cancel33.c                  |  79 +++++++++++++
 nptl/tst-cancel34.c                  | 107 +++++++++++++++++
 nptl/tst-cleanup5.c                  | 164 +++++++++++++++++++++++++++
 support/process_state.h              |   5 +
 support/support_process_state.c      |  71 ++++++++++--
 sysdeps/nptl/dl-tls_init_tp.c        |   3 +-
 sysdeps/nptl/libc_start_call_main.h  |   9 ++
 sysdeps/nptl/pthreadP.h              |  22 +++-
 sysdeps/pthread/Makefile             |   1 +
 sysdeps/pthread/tst-pthread-exited.c | 119 +++++++++++++++++++
 sysdeps/pthread/tst-thrd-detach.c    |   8 +-
 24 files changed, 702 insertions(+), 154 deletions(-)
 create mode 100644 nptl/tst-cancel33.c
 create mode 100644 nptl/tst-cancel34.c
 create mode 100644 nptl/tst-cleanup5.c
 create mode 100644 sysdeps/pthread/tst-pthread-exited.c

-- 
2.43.0



More information about the Libc-alpha mailing list