On Tue, 10 Aug 2021, Thomas Klausner wrote:
I was looking for memory leaks in a threaded program using
-fsanitize=leak when I had a weird issue with pthread_join not working
after pthread_cancel.
So I wrote a small test program. When I compile this with leak
detection, it doesn't even start:
==23045==Sanitizer CHECK failed:
/usr/src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_thread_registry.cc:284
((tid)) < ((n_contexts_)) (4294967295, 1)
Any ideas?
To reproduce, install NetBSD/9.99.88/amd64 and do
gcc -g -fsanitize=leak -o join join.c -lpthread
./join
Compile pthread-using programs with `-pthread':
$ gcc -pthread -g -fsanitize=leak -o join join.c
$ ./join
canceled
$
-RVP