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

thread sanitizerを有効化すると、セグフォが発生する #269

Open
atsushi421 opened this issue Nov 14, 2024 · 0 comments
Open

Comments

@atsushi421
Copy link
Contributor

おそらく sanitizer もメモリ関連の命令をフックしており、それが heaphook と競合しているため。
https://star4.slack.com/archives/C07FL8616EM/p1731558213840899

以下はback traceの内容

(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x000077a38dc2db22 in __interceptor___tls_get_addr (arg=0x77a38e953d80) at ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:2554
#2  0x000077a38e9124f6 in malloc () from /lib/libpreloaded.so
#3  0x000077a38e99acca in malloc (size=69) at ../include/rtld-malloc.h:56
#4  __GI__dl_exception_create_format (exception=exception@entry=0x7ffc55b4d200, objname=0x77a38e9951d0 "/lib/x86_64-linux-gnu/libtsan.so.0", fmt=fmt@entry=0x77a38e9c3eb4 "undefined symbol: %s%s%s") at ./elf/dl-exception.c:157
#5  0x000077a38e9a23dc in _dl_lookup_symbol_x (undef_name=0x77a38dcde1bf "__isoc99_printf", undef_map=0x77a38e995200, ref=0x7ffc55b4d278, symbol_scope=<optimized out>, version=0x0, type_class=0, flags=0, skip_map=0x77a38e995200)
    at ./elf/dl-lookup.c:877
#6  0x000077a38cb75954 in do_sym (flags=2, vers=0x0, who=0x77a38dcc4099 <__interception::InterceptFunction(char const*, unsigned long*, unsigned long, unsigned long)+41>, name=0x77a38dcde1bf "__isoc99_printf", handle=<optimized out>)
    at ./elf/dl-sym.c:146
#7  _dl_sym (handle=<optimized out>, name=0x77a38dcde1bf "__isoc99_printf", who=0x77a38dcc4099 <__interception::InterceptFunction(char const*, unsigned long*, unsigned long, unsigned long)+41>) at ./elf/dl-sym.c:195
#8  0x000077a38ca90738 in dlsym_doit (a=a@entry=0x7ffc55b4d4f0) at ./dlfcn/dlsym.c:40
#9  0x000077a38cb74a98 in __GI__dl_catch_exception (exception=exception@entry=0x7ffc55b4d440, operate=<optimized out>, args=<optimized out>) at ./elf/dl-error-skeleton.c:208
#10 0x000077a38cb74b63 in __GI__dl_catch_error (objname=0x7ffc55b4d498, errstring=0x7ffc55b4d4a0, mallocedp=0x7ffc55b4d497, operate=<optimized out>, args=<optimized out>) at ./elf/dl-error-skeleton.c:227
#11 0x000077a38ca9012e in _dlerror_run (operate=operate@entry=0x77a38ca90720 <dlsym_doit>, args=args@entry=0x7ffc55b4d4f0) at ./dlfcn/dlerror.c:138
#12 0x000077a38ca907b4 in dlsym_implementation (dl_caller=<optimized out>, name=0x77a38dcde1bf "__isoc99_printf", handle=<optimized out>) at ./dlfcn/dlsym.c:54
#13 ___dlsym (handle=<optimized out>, name=0x77a38dcde1bf "__isoc99_printf") at ./dlfcn/dlsym.c:68
#14 0x000077a38dcc4099 in __interception::GetFuncAddr (wrapper_addr=131544341809936, name=0x77a38dcde1bf "__isoc99_printf") at ../../../../src/libsanitizer/interception/interception_linux.cpp:42
#15 __interception::InterceptFunction (name=name@entry=0x77a38dcde1bf "__isoc99_printf", ptr_to_real=ptr_to_real@entry=0x77a38dd1d768 <__interception::real___isoc99_printf>, func=func@entry=131544341809936, 
    wrapper=wrapper@entry=131544341809936) at ../../../../src/libsanitizer/interception/interception_linux.cpp:61
#16 0x000077a38dc6f910 in InitializeCommonInterceptors () at ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:10094
#17 __tsan::InitializeInterceptors () at ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:2645
#18 0x000077a38dc931b3 in __tsan::Initialize (thr=0x77a38cd80fc0) at ../../../../src/libsanitizer/tsan/tsan_rtl.cpp:387
#19 0x000077a38e99c5be in _dl_init (main_map=0x77a38e9d12e0, argc=6, argv=0x7ffc55b4d668, env=0x7ffc55b4d6a0) at ./elf/dl-init.c:102
#20 0x000077a38e9b62ca in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#21 0x0000000000000006 in ?? ()
#22 0x00007ffc55b4eb00 in ?? ()
#23 0x00007ffc55b4eb72 in ?? ()
#24 0x00007ffc55b4eb7d in ?? ()
#25 0x00007ffc55b4eb80 in ?? ()
#26 0x00007ffc55b4eb9b in ?? ()
#27 0x00007ffc55b4eb9e in ?? ()
#28 0x0000000000000000 in ?? ()
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

1 participant