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 Segmentation fault #1551

Open
OldChicken1 opened this issue Jul 14, 2022 · 1 comment
Open

TSAN Segmentation fault #1551

OldChicken1 opened this issue Jul 14, 2022 · 1 comment

Comments

@OldChicken1
Copy link

I am running a project with tsan inside a docker. The library and binary files were compiled with gcc 9.3, and triggered segmentation fault when running in docker.

The binary runs fine on real environment but not in docker environment. I made sure that libtsan.so and libstdc++.so are the same version as gcc 9.3, what can be wrong?

And I tried to set allocator_release_to_os_interval_ms=0 as mentioned in #1338, but it's not helping.

here is the trace:
#0 0x0000000000000000 in ?? ()
#1 0x00007ffff23a0d47 in __sanitizer::MonotonicNanoTime () at ../../.././libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:794
#2 0x00007ffff237cfe6 in __sanitizer::SizeClassAllocator64<__tsan::AP64>::PopulateFreeArray (this=this@entry=0x7ffff26118c0 <__tsan::allocator_placeholder>,
stat=stat@entry=0x7fffeec0db70, class_id=class_id@entry=2, region=region@entry=0x7c0000000180, requested_count=)
at ../../.././libsanitizer/sanitizer_common/sanitizer_allocator_primary64.h:743
#3 0x00007ffff237d1fa in __sanitizer::SizeClassAllocator64<__tsan::AP64>::GetFromAllocator (this=this@entry=0x7ffff26118c0 <__tsan::allocator_placeholder>,
stat=stat@entry=0x7fffeec0db70, class_id=class_id@entry=2, chunks=chunks@entry=0x7fffeec00840, n_chunks=n_chunks@entry=128)
at ../../.././libsanitizer/sanitizer_common/sanitizer_allocator_primary64.h:148
#4 0x00007ffff237d26e in __sanitizer::SizeClassAllocator64LocalCache<__sanitizer::SizeClassAllocator64<__tsan::AP64> >::Refill (this=this@entry=0x7fffeec00010,
c=c@entry=0x7fffeec00830, allocator=allocator@entry=0x7ffff26118c0 <__tsan::allocator_placeholder>, class_id=class_id@entry=2)
at ../../.././libsanitizer/sanitizer_common/sanitizer_allocator_local_cache.h:104
#5 0x00007ffff237bacf in Allocate (class_id=2, allocator=0x7ffff26118c0 <__tsan::allocator_placeholder>, this=)
at ../../.././libsanitizer/sanitizer_common/sanitizer_common.h:385
#6 Allocate (alignment=16, size=, cache=, this=0x7ffff26118c0 <__tsan::allocator_placeholder>)
at ../../.././libsanitizer/sanitizer_common/sanitizer_allocator_combined.h:62
#7 user_alloc_internal (signal=, align=16, sz=32, pc=140737256853942, thr=0x7ffff7f93780) at ../../.././libsanitizer/tsan/tsan_mman.cc:162
#8 __tsan::user_alloc_internal (thr=0x7ffff7f93780, pc=140737256853942, sz=32, align=16, signal=) at ../../.././libsanitizer/tsan/tsan_mman.cc:154
#9 0x00007ffff237bc9b in __tsan::user_calloc (thr=thr@entry=0x7ffff7f93780, pc=, size=size@entry=1, n=n@entry=32)
at ../../.././libsanitizer/tsan/tsan_mman.cc:197
#10 0x00007ffff23391c7 in __interceptor_calloc (size=1, n=32) at ../../.././libsanitizer/tsan/tsan_interceptors.cc:681
#11 0x00007ffff1eff550 in _dlerror_run () from /usr/lib64/libdl.so.2
#12 0x00007ffff1eff058 in dlsym () from /usr/lib64/libdl.so.2
#13 0x00007ffff23adaf5 in __interception::GetRealFunctionAddress (func_name=func_name@entry=0x7ffff23c3451 "mmap",
func_addr=func_addr@entry=0x7ffff25ff828 <__interception::real_mmap>, real=real@entry=140737257009216, wrapper=wrapper@entry=140737257009216)
at ../../.././libsanitizer/interception/interception_linux.cc:31
#14 0x00007ffff235f385 in InitializeCommonInterceptors () at ../../.././libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:7240
#15 __tsan::InitializeInterceptors () at ../../.././libsanitizer/tsan/tsan_interceptors.cc:2595
#16 0x00007ffff23836b8 in __tsan::Initialize (thr=thr@entry=0x7ffff7f93780) at ../../.././libsanitizer/tsan/tsan_rtl.cc:372
#17 0x00007ffff2337a83 in _ZN6__tsan17ScopedInterceptorC4EPNS_11ThreadStateEPKcm (this=this@entry=0x7fffffffe440, thr=0x7ffff7f93780, pc=140737247615198,
fname=0x7ffff23c2285 "__cxa_atexit") at ../../.././libsanitizer/tsan/tsan_interceptors.cc:242
#18 0x00007ffff2338d26 in __interceptor___cxa_atexit (
f=f@entry=0x7ffff1a66590 <std::pmr::(anonymous namespace)::constant_init<std::pmr::(anonymous namespace)::newdel_res_t>::~constant_init()>,
arg=arg@entry=0x7ffff1cde1e8 <std::pmr::(anonymous namespace)::newdel_res>, dso=0x7ffff1cde040) at ../../.././libsanitizer/tsan/tsan_interceptors.cc:405
#19 0x00007ffff1a698de in __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535)
at ../../../.././libstdc++-v3/src/c++17/memory_resource.cc:1402
#20 _GLOBAL__sub_I_memory_resource.cc(void) () at ../../../.././libstdc++-v3/src/c++17/memory_resource.cc:1402
#21 0x00007ffff1a812d2 in __do_global_ctors_aux () from /opt/dr/lib/libstdc++.so.6

@tarikkilic
Copy link

Did you solve this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants