summaryrefslogtreecommitdiff
path: root/nptl/tst-create-detached.c
AgeCommit message (Collapse)Author
2018-01-01Update copyright dates with scripts/update-copyrights.Joseph Myers
* All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
2017-07-06Increase some test timeouts.Joseph Myers
This patch increases the timeouts for some tests that I've seen timing out on slow systems in my 2.26 release testing. (In the case of tst-tsearch.c, increasing the timeout means removing a setting of 10 that was put there before the default timeout was increased to 20 seconds, so putting the default into effect.) * iconvdata/tst-loading.c (TIMEOUT): Define to 30. * misc/tst-tsearch.c (TIMEOUT): Remove. * nptl/tst-create-detached.c (TIMEOUT): Define to 100. * nptl/tst-robust-fork.c (TIMEOUT): Likewise. * nptl/tst-rwlock19.c (TIMEOUT): Likewise. * string/tst-cmp.c (TIMEOUT): Define to 600.
2017-01-28Bug 20116: Fix use after free in pthread_create()Carlos O'Donell
The commit documents the ownership rules around 'struct pthread' and when a thread can read or write to the descriptor. With those ownership rules in place it becomes obvious that pd->stopped_start should not be touched in several of the paths during thread startup, particularly so for detached threads. In the case of detached threads, between the time the thread is created by the OS kernel and the creating thread checks pd->stopped_start, the detached thread might have already exited and the memory for pd unmapped. As a regression test we add a simple test which exercises this exact case by quickly creating detached threads with large enough stacks to ensure the thread stack cache is bypassed and the stacks are unmapped. Before the fix the testcase segfaults, after the fix it works correctly and completes without issue. For a detailed discussion see: https://www.sourceware.org/ml/libc-alpha/2017-01/msg00505.html