Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TSAN encountered segmentation fault at __sanitizer::CombinedAllocatorTsan::Allocate due to thread created by glibc2.36 aio_write() #109742

Open
JpengYounger opened this issue Sep 24, 2024 · 0 comments
Labels
compiler-rt:tsan Thread sanitizer crash Prefer [crash-on-valid] or [crash-on-invalid]

Comments

@JpengYounger
Copy link

JpengYounger commented Sep 24, 2024

The function aio_write() in glibc2.36 (including higher versions of glibc) calls the internal function __pthread_create to create a thread.TSAN is unable to intercept internal function __pthread_create (https://sourceware.org/git/?p=glibc.git;a=commit;h=f47f1d91af985a9028fb399da21eab460d887a15), which may lead to a crash.
segmentation fault call trace:
0x0000000000462000 in __sanitizer::CombinedAllocatorTsan<__sanitizer::SizeClassAllocator64<__tsan::AP64>, __sanitizer::LargeMmapAllocatorPtrArrayDynamic>::Allocate(__sanitizer::SizeClassAllocator64LocalCache<__sanitizer::SizeClassAllocator64<__tsan::AP64> >, unsigned long, unsigned long) ()
0x000000000045effa in __tsan::user_alloc_internal(__tsan::ThreadState
, unsigned long, unsigned long, unsigned long, bool) ()
0x000000000045f128 in __tsan::user_alloc(__tsan::ThreadState*, unsigned long, unsigned long) ()
0x000000000041d88e in malloc ()
0x00007ffff7ab61b3 in __aio_notify_only () from /lib64/libc.so.6
0x00007ffff7ab623b in __aio_notify () from /lib64/libc.so.6
0x00007ffff7ab579b in handle_fildes_io () from /lib64/libc.so.6
0x00007ffff7aacaa4 in start_thread () from /lib64/libc.so.6
0x00007ffff7b29740 in clone ()

Testcase preproduce bug: https://sourceware.org/git/?p=glibc.git;a=blob;f=rt/tst-aio5.c;h=15b6558eb8fc66575a098266229792ac007dd283;hb=HEAD

@EugeneZelenko EugeneZelenko added compiler-rt:tsan Thread sanitizer crash Prefer [crash-on-valid] or [crash-on-invalid] and removed new issue labels Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler-rt:tsan Thread sanitizer crash Prefer [crash-on-valid] or [crash-on-invalid]
Projects
None yet
Development

No branches or pull requests

2 participants