brpc icon indicating copy to clipboard operation
brpc copied to clipboard

tcmalloc deadlock

Open yqynju opened this issue 3 years ago • 2 comments

Thread 29 (Thread 0x7ee14ea5d700 (LWP 57194)): #0 0x000055cee64a4250 in sys_futex () #1 0x000055cee64a4401 in base::internal::SpinLockDelay(int volatile*, int, int) () #2 0x000055cee64a40c0 in SpinLock::SlowLock() () #3 0x000055cee648cce4 in SpinLock::Lock() () #4 0x000055cee648cd8c in SpinLockHolder::SpinLockHolder(SpinLock*) () #5 0x000055cee6490ea2 in tcmalloc::CentralFreeList::ReleaseToSpans(void*) () #6 0x000055cee6490c82 in tcmalloc::CentralFreeList::ReleaseListToSpans(void*) () #7 0x000055cee649142e in tcmalloc::CentralFreeList::InsertRange(void*, void*, int) () #8 0x000055cee64a28a1 in tcmalloc::ThreadCache::ReleaseToCentralCache(tcmalloc::ThreadCache::FreeList*, unsigned int, int) () #9 0x000055cee64a2649 in tcmalloc::ThreadCache::ListTooLong(tcmalloc::ThreadCache::FreeList*, unsigned int) () #10 0x000055cee67c0505 in tc_free () #11 0x000055cee6119453 in bvar::detail::SamplerCollector::run (this=) at incubator-brpc-0.9.7/src/bvar/detail/sampler.cpp:160 #12 0x000055cee611a019 in bvar::detail::SamplerCollector::sampling_thread (arg=) at bvar/detail/sampler.cpp:103 #13 0x00007f3f8fd1ae45 in start_thread () from /lib64/libpthread.so.0 #14 0x00007f3f8f1ae26d in clone () from /lib64/libc.so.6

Thread 19 (Thread 0x7e81d6db1700 (LWP 57459)): #0 0x000055cee64a4250 in sys_futex () #1 0x000055cee64a4401 in base::internal::SpinLockDelay(int volatile*, int, int) () #2 0x000055cee64a40c0 in SpinLock::SlowLock() () #3 0x000055cee648cce4 in SpinLock::Lock() () #4 0x000055cee648cd8c in SpinLockHolder::SpinLockHolder(SpinLock*) () #5 0x000055cee64a2a57 in tcmalloc::ThreadCache::IncreaseCacheLimit() () #6 0x000055cee64a2a09 in tcmalloc::ThreadCache::Scavenge() () #7 0x000055cee67c055d in tc_free () #8 0x000055cee612b19b in butil::ObjectPoolbthread::Butex::LocalPool::delete_local_pool (arg=0x7ee219489a80) at incubator-brpc-0.9.7/src/butil/object_pool_inl.h:141 #9 0x000055cee610fe3a in ~ThreadExitHelper (this=0x7ee2195ce860, __in_chrg=) at incubator-brpc-0.9.7/src/butil/thread_local.cpp:41 #10 butil::detail::helper_exit_global () at incubator-brpc-0.9.7/src/butil/thread_local.cpp:85 #11 0x00007f3f8f0ead49 in __run_exit_handlers () from /lib64/libc.so.6 #12 0x00007f3f8f0ead95 in exit () from /lib64/libc.so.6 #13 0x000055cee64a1eae in ShmSysAllocator::Alloc(unsigned long, unsigned long*, unsigned long) () #14 0x000055cee64a18dc in TCMalloc_SystemAlloc(unsigned long, unsigned long*, unsigned long) () #15 0x000055cee649c10d in tcmalloc::PageHeap::GrowHeap(unsigned long) () #16 0x000055cee649aa91 in tcmalloc::PageHeap::New(unsigned long) () #17 0x000055cee649187e in tcmalloc::CentralFreeList::Populate() () #18 0x000055cee6491677 in tcmalloc::CentralFreeList::FetchFromOneSpansSafe(int, void**, void**) () #19 0x000055cee6491591 in tcmalloc::CentralFreeList::RemoveRange(void**, void**, int) () #20 0x000055cee64a24be in tcmalloc::ThreadCache::FetchFromCentralCache(unsigned int, int, void* (*)(unsigned long)) () #21 0x000055cee67c00c2 in tc_malloc ()

锁死不动了,多线程使用tcmalloc分配内存,插入数据。

yqynju avatar Jul 16 '21 14:07 yqynju

遇到了同样的问题

jzy2009 avatar Dec 03 '21 07:12 jzy2009

跟这个问题有点像https://zhuanlan.zhihu.com/p/81683409

wangjinnana avatar Aug 05 '22 10:08 wangjinnana

才看到,感谢,我后来通过替换成jemalloc解决的

wangjin @.***> 于2022年8月5日周五 18:41写道:

跟这个问题有点像https://zhuanlan.zhihu.com/p/81683409

— Reply to this email directly, view it on GitHub https://github.com/apache/incubator-brpc/issues/1488#issuecomment-1206305333, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWYLHLRWNX7J53F53MNBQBDVXTVVNANCNFSM5APWEGJQ . You are receiving this because you commented.Message ID: @.***>

jzy2009 avatar Dec 07 '22 07:12 jzy2009