Skip to content

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

Open
@JpengYounger

Description

@JpengYounger

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    compiler-rt:tsanThread sanitizercrashPrefer [crash-on-valid] or [crash-on-invalid]

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions