This is the mail archive of the libc-alpha@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]

[PATCH 0/7] nptl: Fix Race conditions in pthread cancellation (BZ#12683)


Hi all,

This is an update of my initial patch set to fix BZ#12683 [1].
Following Joseph suggestion, I split the patch in more logical ones.
The changes so far:

1. Add a patch to inline syscalls for non-cancellable versions
2. Change the function declaration to ANSI on in another patch
3. The testcase changes are before patch itself, since they do
   not change current behavior
4. The x86_64 assembly remotion is also its own patch
5. Add powerpc32 port as well

However, different from Joseph suggest I do not see changing the 
async enable/delete current behavior to a SYSCALL_CANCEL semantic an
useful change: it will require to keep some cancellation implementation
that are meant to be removed.

I will update wiki pages with current steps to adequate other arches
to this change.  I also updated my branch [2] with the patchset and
I think it is a good start to use for additional arch adjustments.


[1] https://sourceware.org/ml/libc-alpha/2014-09/msg00479.html
[2] https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/azanella/bz12683

---

 debug/tst-backtrace5.c                             |  13 +-
 nptl/Makefile                                      |  21 +-
 nptl/Versions                                      |   3 +
 nptl/cancellation.c                                |  99 ---
 nptl/descr.h                                       |  15 +-
 nptl/libc-cancellation.c                           |  60 +-
 nptl/lowlevellock.c                                |   2 +-
 nptl/nptl-init.c                                   |  64 +-
 nptl/pt-system.c                                   |   3 -
 nptl/pthreadP.h                                    |  71 +-
 nptl/pthread_cancel.c                              |  69 +-
 nptl/pthread_cond_timedwait.c                      |  37 +-
 nptl/pthread_cond_wait.c                           |  24 +-
 nptl/pthread_create.c                              |   6 +-
 nptl/pthread_exit.c                                |  12 +-
 nptl/pthread_join.c                                |  13 +-
 nptl/pthread_timedjoin.c                           |  14 +-
 nptl/sem_timedwait.c                               |  19 +-
 nptl/sem_wait.c                                    |  26 +-
 nptl/tst-cancel-wrappers.sh                        |  92 ---
 nptl/tst-cancel2.c                                 |   3 +
 nptl/tst-cancel20.c                                |   6 +-
 nptl/tst-cancel21.c                                |   5 +
 nptl/tst-cancel4.c                                 |  11 +-
 rt/Makefile                                        |   1 -
 sysdeps/generic/sysdep-cancel.h                    |   3 -
 sysdeps/nptl/Makefile                              |   3 +-
 sysdeps/nptl/aio_misc.h                            |  15 +-
 sysdeps/nptl/gai_misc.h                            |  15 +-
 sysdeps/nptl/librt-cancellation.c                  |  24 -
 sysdeps/nptl/lowlevellock.h                        |   2 +-
 sysdeps/posix/sigpause.c                           |  11 +-
 sysdeps/posix/waitid.c                             |  17 +-
 sysdeps/powerpc/nptl/pthreaddef.h                  |  15 +
 sysdeps/unix/sysdep.h                              |  60 +-
 sysdeps/unix/sysv/linux/accept4.c                  |  10 +-
 sysdeps/unix/sysv/linux/clock_nanosleep.c          |  17 +-
 sysdeps/unix/sysv/linux/epoll_pwait.c              |  14 +-
 sysdeps/unix/sysv/linux/fallocate.c                |  18 +-
 sysdeps/unix/sysv/linux/fallocate64.c              |  24 +-
 sysdeps/unix/sysv/linux/fcntl.c                    |  36 +-
 sysdeps/unix/sysv/linux/i386/fcntl.c               |  15 +-
 sysdeps/unix/sysv/linux/msgrcv.c                   |  20 +-
 sysdeps/unix/sysv/linux/msgsnd.c                   |  20 +-
 sysdeps/unix/sysv/linux/not-cancel.h               |  80 +-
 sysdeps/unix/sysv/linux/open64.c                   |  11 +-
 sysdeps/unix/sysv/linux/openat.c                   |  40 +-
 sysdeps/unix/sysv/linux/powerpc/lowlevellock.h     |  45 +-
 sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c  |  26 +-
 .../unix/sysv/linux/powerpc/powerpc32/pread64.c    |  29 +-
 sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c |  26 +-
 .../unix/sysv/linux/powerpc/powerpc32/pwrite64.c   |  29 +-
 sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S |  59 +-
 .../sysv/linux/powerpc/powerpc32/sysdep-cancel.h   | 123 ++-
 sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h |   8 +
 sysdeps/unix/sysv/linux/powerpc/powerpc64/fcntl.c  |  15 +-
 sysdeps/unix/sysv/linux/powerpc/powerpc64/pread.c  |  23 +-
 .../unix/sysv/linux/powerpc/powerpc64/pread64.c    |  23 +-
 sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite.c |  23 +-
 .../unix/sysv/linux/powerpc/powerpc64/pwrite64.c   |  23 +-
 sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S |  73 +-
 .../sysv/linux/powerpc/powerpc64/sync_file_range.c |  12 +-
 .../sysv/linux/powerpc/powerpc64/sysdep-cancel.h   | 130 +---
 sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h |   9 +
 sysdeps/unix/sysv/linux/powerpc/syscall_cancel.S   |  56 ++
 sysdeps/unix/sysv/linux/powerpc/sysdep.c           |  11 +
 sysdeps/unix/sysv/linux/ppoll.c                    |  14 +-
 sysdeps/unix/sysv/linux/preadv.c                   |  20 +-
 sysdeps/unix/sysv/linux/pselect.c                  |  17 +-
 sysdeps/unix/sysv/linux/pthread_kill.c             |   9 +-
 sysdeps/unix/sysv/linux/pwritev.c                  |  20 +-
 sysdeps/unix/sysv/linux/readv.c                    |  20 +-
 sysdeps/unix/sysv/linux/recvmmsg.c                 |  11 +-
 sysdeps/unix/sysv/linux/sendmmsg.c                 |  11 +-
 sysdeps/unix/sysv/linux/sigsuspend.c               |  30 +-
 sysdeps/unix/sysv/linux/sigtimedwait.c             |  21 +-
 sysdeps/unix/sysv/linux/sigwait.c                  |  40 +-
 sysdeps/unix/sysv/linux/sigwaitinfo.c              |  19 +-
 sysdeps/unix/sysv/linux/sleep.c                    |   4 -
 sysdeps/unix/sysv/linux/sync_file_range.c          |  39 +-
 sysdeps/unix/sysv/linux/tcdrain.c                  |  12 +-
 sysdeps/unix/sysv/linux/timer_routines.c           |   6 +-
 sysdeps/unix/sysv/linux/wait.c                     |  14 +-
 sysdeps/unix/sysv/linux/waitid.c                   |   2 +-
 sysdeps/unix/sysv/linux/waitpid.c                  |  17 +-
 sysdeps/unix/sysv/linux/wordsize-64/fallocate.c    |  12 +-
 sysdeps/unix/sysv/linux/wordsize-64/openat.c       |   2 -
 sysdeps/unix/sysv/linux/wordsize-64/preadv.c       |  12 +-
 sysdeps/unix/sysv/linux/wordsize-64/pwritev.c      |  12 +-
 sysdeps/unix/sysv/linux/writev.c                   |  20 +-
 sysdeps/unix/sysv/linux/x86_64/cancellation.S      | 117 ---
 sysdeps/unix/sysv/linux/x86_64/libc-cancellation.S |  21 -
 .../unix/sysv/linux/x86_64/librt-cancellation.S    |  21 -
 sysdeps/unix/sysv/linux/x86_64/lowlevellock.h      |  41 +-
 .../sysv/linux/x86_64/pthread_cond_timedwait.S     | 840 ---------------------
 sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S | 555 --------------
 sysdeps/unix/sysv/linux/x86_64/recv.c              |  11 +-
 sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S     | 380 ----------
 sysdeps/unix/sysv/linux/x86_64/sem_wait.S          | 176 -----
 sysdeps/unix/sysv/linux/x86_64/send.c              |  12 +-
 sysdeps/unix/sysv/linux/x86_64/syscall_cancel.S    |  49 ++
 sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h     |  91 +--
 sysdeps/unix/sysv/linux/x86_64/sysdep.h            |   9 +
 sysdeps/x86_64/nptl/pthreaddef.h                   |  13 +
 sysdeps/x86_64/nptl/tcb-offsets.sym                |   1 -
 sysdeps/x86_64/nptl/tls.h                          |  11 -
 107 files changed, 1095 insertions(+), 3799 deletions(-)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]