You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/06/21 10:16:10 UTC

[GitHub] [doris] k-i-d-d opened a new issue, #10309: [Bug] [UBSAN] TCMalloc Hook deadlocks when ThreadContext is initialized

k-i-d-d opened a new issue, #10309:
URL: https://github.com/apache/doris/issues/10309

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Version
   
   trunk
   
   ### What's Wrong?
   
   be.out
   ```
   /mnt/disk1/liyifan/doris/core/be/src/runtime/tcmalloc_hook.h:40:27: runtime error: member call on null pointer of type 'doris::ThreadContext'
   SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /mnt/disk1/liyifan/doris/core/be/src/runtime/tcmalloc_hook.h:40:27 in
   /mnt/disk1/liyifan/doris/core/be/src/runtime/thread_context.h:156:10: runtime error: member call on null pointer of type 'doris::ThreadContext *'
   SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /mnt/disk1/liyifan/doris/core/be/src/runtime/thread_context.h:156:10 in
   ```
   
   pstack
   ```
   Thread 3 (Thread 0x7ff256fff700 (LWP 4044198) "doris-be"):
   #0  0x00007ff2581e9376 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
   #1  0x00005648c375ffac in background_thread_sleep (tsdn=<optimized out>, interval=<optimized out>, info=<optimized out>) at src/background_thread.c:232
   #2  background_work_sleep_once (ind=0, info=<optimized out>, tsdn=<optimized out>) at src/background_thread.c:307
   #3  background_thread0_work (tsd=<optimized out>) at src/background_thread.c:452
   #4  background_work (ind=<optimized out>, tsd=<optimized out>) at src/background_thread.c:490
   #5  background_thread_entry (ind_arg=<optimized out>) at src/background_thread.c:522
   #6  0x00007ff2581e2609 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
   #7  0x00007ff25831c133 in clone () from /lib/x86_64-linux-gnu/libc.so.6
   Thread 2 (Thread 0x7ff2581ce700 (LWP 4044197) "doris-be"):
   #0  0x00005648c44b1157 in __sanitizer::internal_sched_yield() ()
   #1  0x00005648c44a53ec in __sanitizer::StaticSpinMutex::LockSlow() ()
   #2  0x00005648c44aaa8c in __ubsan::InitAsStandalone() ()
   #3  0x00005648c44aa33b in _ubsan::IsPCSuppressed(_ubsan::ErrorType, unsigned long, char const*) ()
   #4  0x00005648c449ea6f in handleTypeMismatchImpl(__ubsan::TypeMismatchData*, unsigned long, __ubsan::ReportOptions) ()
   #5  0x00005648c449ffb1 in __ubsan_handle_type_mismatch_v1 ()
   #6  0x00005648b79d13fe in delete_hook (ptr=0x0) at /home/zcp/repo_center/selectdb_selectdb-1.0/selectdb/be/src/runtime/tcmalloc_hook.h:43
   #7  0x00005648c431a13d in MallocHook::InvokeDeleteHookSlow (p=0x0) at src/malloc_hook.cc:505
   #8  0x00005648c44d5fad in MallocHook::InvokeDeleteHook (p=0x0) at src/malloc_hook-inl.h:138
   #9  tcmalloc::invoke_hooks_and_free (ptr=0x0) at src/tcmalloc.cc:1753
   #10 0x00007ff258232e0c in ?? () from /lib/x86_64-linux-gnu/libc.so.6
   #11 0x00007ff25853fa4c in dlerror () from /lib/x86_64-linux-gnu/libdl.so.2
   #12 0x00005648c44aaaf2 in __ubsan::InitAsStandalone() ()
   #13 0x00005648c44aa33b in _ubsan::IsPCSuppressed(_ubsan::ErrorType, unsigned long, char const*) ()
   #14 0x00005648c449ea6f in handleTypeMismatchImpl(__ubsan::TypeMismatchData*, unsigned long, __ubsan::ReportOptions) ()
   #15 0x00005648c449ffb1 in __ubsan_handle_type_mismatch_v1 ()
   #16 0x00005648b79d13a1 in new_hook (ptr=0x5648d4397650, size=104) at /home/zcp/repo_center/selectdb_selectdb-1.0/selectdb/be/src/runtime/tcmalloc_hook.h:39
   #17 0x00005648c431a008 in MallocHook::InvokeNewHookSlow (p=p@entry=0x5648d4397650, s=s@entry=104) at src/malloc_hook.cc:498
   #18 0x00005648c44d7881 in MallocHook::InvokeNewHook (s=104, p=0x5648d4397650) at src/malloc_hook-inl.h:127
   #19 tcmalloc::do_allocate_full<tcmalloc::cpp_throw_oom> (size=104) at src/tcmalloc.cc:1805
   #20 tcmalloc::allocate_full_cpp_throw_oom (size=104) at src/tcmalloc.cc:1815
   #21 0x00005648b916b3ba in doris::ThreadContextPtr::ThreadContextPtr (this=0x7ff2581ca291) at /home/zcp/repo_center/selectdb_selectdb-1.0/selectdb/be/src/runtime/thread_context.cpp:28
   #22 0x00005648b79db318 in __tls_init () at /home/zcp/repo_center/selectdb_selectdb-1.0/selectdb/be/src/runtime/thread_context.h:216
   #23 0x00005648b79f2764 in TLS wrapper function for doris::thread_local_ctx ()
   #24 0x00005648b79d116c in doris::tls_ctx () at /home/zcp/repo_center/selectdb_selectdb-1.0/selectdb/be/src/runtime/thread_context.h:223
   #25 0x00005648b79d1379 in new_hook (ptr=0x5648d460e960, size=72) at /home/zcp/repo_center/selectdb_selectdb-1.0/selectdb/be/src/runtime/tcmalloc_hook.h:39
   #26 0x00005648c431a008 in MallocHook::InvokeNewHookSlow (p=p@entry=0x5648d460e960, s=s@entry=72) at src/malloc_hook.cc:498
   #27 0x00005648c44d7881 in MallocHook::InvokeNewHook (s=72, p=0x5648d460e960) at src/malloc_hook-inl.h:127
   #28 tcmalloc::do_allocate_full<tcmalloc::cpp_throw_oom> (size=size@entry=72) at src/tcmalloc.cc:1805
   #29 tcmalloc::allocate_full_cpp_throw_oom (size=size@entry=72) at src/tcmalloc.cc:1815
   #30 0x00005648c44d79e9 in tcmalloc::dispatch_allocate_full<tcmalloc::cpp_throw_oom> (size=72) at src/tcmalloc.cc:1822
   #31 0x00005648c21fca9c in bvar::detail::SamplerCollector::run (this=0x5648d400c420) at /home/zcp/repo_center/selectdb_selectdb-1.0/selectdb/thirdparty/src/incubator-brpc-1.0.0/src/bvar/detail/sampler.cpp:138
   #32 0x00005648c21fd409 in bvar::detail::SamplerCollector::sampling_thread (arg=<optimized out>) at /home/zcp/repo_center/selectdb_selectdb-1.0/selectdb/thirdparty/src/incubator-brpc-1.0.0/src/bvar/detail/sampler.cpp:110
   #33 0x00007ff2581e2609 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
   #34 0x00007ff25831c133 in clone () from /lib/x86_64-linux-gnu/libc.so.6
   ```
   
   ### What You Expected?
   
   no error
   
   ### How to Reproduce?
   
   _No response_
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] yiguolei closed issue #10309: [Bug] [UBSAN] TCMalloc Hook deadlocks when ThreadContext is initialized

Posted by GitBox <gi...@apache.org>.
yiguolei closed issue #10309: [Bug] [UBSAN] TCMalloc Hook deadlocks when ThreadContext is initialized
URL: https://github.com/apache/doris/issues/10309


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org