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

AARCH64架构,brpc启动时候,卡死在bthread初始化的时候 #1203

Closed
lzk90s opened this issue Aug 10, 2020 · 1 comment
Closed

Comments

@lzk90s
Copy link

lzk90s commented Aug 10, 2020

Describe the bug (描述bug)
AARCH64架构,brpc启动时候,卡死在bthread初始化的时候。

To Reproduce (复现方法)

Expected behavior (期望行为)
正常执行

Versions (各种版本)
OS: ubuntu16.04
Compiler: gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.12) Target: aarch64-linux-gnu
brpc: master
protobuf:

Additional context/screenshots (更多上下文/截图)

(gdb) bt
#0 0x0000ffffbe23ae94 in nanosleep () at ../sysdeps/unix/syscall-template.S:86
#1 0x0000ffffbe260368 in usleep (useconds=useconds@entry=100) at ../sysdeps/posix/usleep.c:32
#2 0x0000ffffa2f17e18 in bthread::TaskControl::init (this=this@entry=0x280ddf0, concurrency=) at /root/brpc/src/bthread/task_control.cpp:180
#3 0x0000ffffa2f294e4 in bthread::get_or_new_task_control () at /root/brpc/src/bthread/bthread.cpp:91
#4 bthread::start_from_non_worker (arg=0x0, fn=0xffffa2ff9d50 brpc::GlobalUpdate(void*), attr=0x0, tid=0xffffffffc8d0) at /root/brpc/src/bthread/bthread.cpp:128
#5 bthread_start_background (tid=0xffffffffc8d0, tid@entry=0xffffffffc910, attr=attr@entry=0x0, fn=fn@entry=0xffffa2ff9d50 brpc::GlobalUpdate(void*), arg=arg@entry=0x0)
at /root/brpc/src/bthread/bthread.cpp:193
#6 0x0000ffffa2ffc084 in brpc::GlobalInitializeOrDieImpl () at /root/brpc/src/brpc/global.cpp:604
#7 0x0000ffffbe4aea3c in __pthread_once_slow (once_control=0xffffa3ef6450 brpc::register_extensions_once, init_routine=0xffffa2ffb038 brpc::GlobalInitializeOrDieImpl()) at pthread_once.c:116
#8 0x0000ffffbe4aeaec in __GI___pthread_once (once_control=once_control@entry=0xffffa3ef6450 brpc::register_extensions_once,
init_routine=init_routine@entry=0xffffa2ffb038 brpc::GlobalInitializeOrDieImpl()) at pthread_once.c:143
#9 0x0000ffffa2ff9cc4 in brpc::GlobalInitializeOrDie () at /root/brpc/src/brpc/global.cpp:609
#10 0x0000ffffa301be6c in brpc::StringToProtocolType (name=..., print_log_on_unknown=true) at /root/brpc/src/brpc/protocol.cpp:160
#11 0x0000ffffb96f8290 in brpc::StringToProtocolType (type=...) at /usr/local/include/brpc/adaptive_protocol_type.h:37
#12 0x0000ffffb96f835c in brpc::AdaptiveProtocolType::operator= (this=0xffffffffd380, name=...) at /usr/local/include/brpc/adaptive_protocol_type.h:62

--------------定时器线程-------------
(gdb) bt
#0 syscall () at ../sysdeps/unix/sysv/linux/aarch64/syscall.S:38
#1 0x0000ffffa2f27a04 in bthread::futex_wait_private (timeout=, expected=, addr1=0x27f7608) at /root/brpc/src/bthread/sys_futex.h:40
#2 bthread::TimerThread::run (this=0x27f75c0) at /root/brpc/src/bthread/timer_thread.cpp:431
#3 0x0000ffffa2f281e4 in bthread::TimerThread::run_this (arg=) at /root/brpc/src/bthread/timer_thread.cpp:120
#4 0x0000ffffbe4a6fc4 in start_thread (arg=0xffffa2f281d8 bthread::TimerThread::run_this(void*)) at pthread_create.c:335
#5 0x0000ffffbe2663f0 in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:89

-----------有几个线程的调用栈全部是下面这样的,在等待mutex释放-------------
(gdb) bt
#0 0x0000ffffbe4b050c in __lll_lock_wait (futex=0xffffbe80d9b8 <_rtld_global+2440>, private=0) at lowlevellock.c:46
#1 0x0000ffffbe4a9858 in __GI___pthread_mutex_lock (mutex=0xffffbe80d9b8 <_rtld_global+2440>) at pthread_mutex_lock.c:115
#2 0x0000ffffbe7f4338 in _dl_tlsdesc_resolve_early_return_p (caller=0xffffb8b192d0 bthread::tls_bls@plt, td=0xffffb972bee8) at ./tlsdeschtab.h:146
#3 _dl_tlsdesc_resolve_rela_fixup (td=0xffffb972bee8, l=0x8000000000000000) at ../sysdeps/aarch64/tlsdesc.c:52
#4 0x0000ffffbe7f4768 in _dl_tlsdesc_resolve_rela () at ../sysdeps/aarch64/dl-tlsdesc.S:283
#5 0x0000ffffbe7f4768 in _dl_tlsdesc_resolve_rela () at ../sysdeps/aarch64/dl-tlsdesc.S:283
#6 0x0000ffffbe7f4768 in _dl_tlsdesc_resolve_rela () at ../sysdeps/aarch64/dl-tlsdesc.S:283
#7 0x0000ffffbe7f4768 in _dl_tlsdesc_resolve_rela () at ../sysdeps/aarch64/dl-tlsdesc.S:283
#8 0x0000ffffbe7f4768 in _dl_tlsdesc_resolve_rela () at ../sysdeps/aarch64/dl-tlsdesc.S:283
#9 0x0000ffffbe7f4768 in _dl_tlsdesc_resolve_rela () at ../sysdeps/aarch64/dl-tlsdesc.S:283
#10 0x0000ffffbe7f4768 in _dl_tlsdesc_resolve_rela () at ../sysdeps/aarch64/dl-tlsdesc.S:283
#11 0x0000ffffbe7f4768 in _dl_tlsdesc_resolve_rela () at ../sysdeps/aarch64/dl-tlsdesc.S:283
#12 0x0000ffffbe7f4768 in _dl_tlsdesc_resolve_rela () at ../sysdeps/aarch64/dl-tlsdesc.S:283
#13 0x0000ffffbe7f4768 in _dl_tlsdesc_resolve_rela () at ../sysdeps/aarch64/dl-tlsdesc.S:283
#14 0x0000ffffbe7f4768 in _dl_tlsdesc_resolve_rela () at ../sysdeps/aarch64/dl-tlsdesc.S:283
#15 0x0000ffffbe7f4768 in _dl_tlsdesc_resolve_rela () at ../sysdeps/aarch64/dl-tlsdesc.S:283
#16 0x0000ffffbe7f4768 in _dl_tlsdesc_resolve_rela () at ../sysdeps/aarch64/dl-tlsdesc.S:283
#17 0x0000ffffbe7f4768 in _dl_tlsdesc_resolve_rela () at ../sysdeps/aarch64/dl-tlsdesc.S:283
#18 0x0000ffffbe7f4768 in _dl_tlsdesc_resolve_rela () at ../sysdeps/aarch64/dl-tlsdesc.S:283
。。。。。。。。。

(gdb) frame 1
#1 0x0000ffffbe4a9858 in __GI___pthread_mutex_lock (mutex=0xffffbe80d9b8 <_rtld_global+2440>) at pthread_mutex_lock.c:115
115 in pthread_mutex_lock.c
(gdb) p *mutex
$4 = {
__data = {
__lock = 2,
__count = 1,
__owner = 12196, --------- mutex被bthread::TaskControl::init这个线程持有。
__nusers = 1,
__kind = 1,
__spins = 0,
__list = {
__prev = 0x0,
__next = 0x0
}
},
__size = "\002\000\000\000\001\000\000\000\244/\000\000\001\000\000\000\001", '\000' <repeats 30 times>,
__align = 4294967298
}

@wwbmmm
Copy link
Contributor

wwbmmm commented May 4, 2023

We close this issue because it is irreproducible and inactive for a long time.
If you can reproduce this issue with the latest version of bRPC, please reopen this issue and tell us how to reproduce.

@wwbmmm wwbmmm closed this as completed May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants