You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@brpc.apache.org by "waruto210 (via GitHub)" <gi...@apache.org> on 2026/03/09 10:03:25 UTC

[I] builtin service执行过程中coredump (brpc)

waruto210 opened a new issue, #3239:
URL: https://github.com/apache/brpc/issues/3239

   **Describe the bug**
   brpc服务运行过程中coredump,查看corefile,发现是builtin_service导致的
   
   ```bash
   #0  0x00007fa87f448baf in raise () from /lib64/libpthread.so.0
   #1  0x0000000002443790 in backward::SignalHandling::sig_handler (signo=6, info=0x7fa2fd69d0f0, _ctx=0x7fa2fd69cfc0)
       at /data00/kernel/docker/dev-build-run/tcqa-table/build/vcpkg_installed/x64-linux/include/backward.hpp:4299
   #2  <signal handler called>
   #3  0x00007fa87d16852f in raise () from /lib64/libc.so.6
   #4  0x00007fa87d13be65 in abort () from /lib64/libc.so.6
   #5  0x000000000354ada7 in google::LogMessage::Fail ()
       at /root/vcpkg/buildtrees/glog/src/v0.7.1-795557b621.clean/src/logging.cc:1953
   #6  0x000000000354e2aa in google::LogMessageFatal::~LogMessageFatal (this=0x7fa2fd69df40, __in_chrg=<optimized out>)
       at /root/vcpkg/buildtrees/glog/src/v0.7.1-795557b621.clean/src/logging.cc:2645
   #7  0x0000000002be4a82 in brpc::VersionedRefWithId<brpc::Socket>::Dereference (this=0x7fa35a8bc800)
       at /root/vcpkg/buildtrees/brpc/src/1.11.0-fbf5526c8b.clean/src/brpc/versioned_ref_with_id.h:576
   #8  0x0000000002d0f022 in brpc::DereferenceSocket (s=0x7fa35a8bc800)
       at /root/vcpkg/buildtrees/brpc/src/1.11.0-fbf5526c8b.clean/src/brpc/socket.cpp:2275
   #9  0x0000000002b194fe in brpc::VersionedRefWithIdDeleter<brpc::Socket>::operator() (this=0x7fa2fd69e390, m=0x7fa35a8bc800)
       at /root/vcpkg/buildtrees/brpc/src/1.11.0-fbf5526c8b.clean/src/brpc/socket_id.h:46
   #10 0x0000000002b1a30a in std::unique_ptr<brpc::Socket, brpc::VersionedRefWithIdDeleter<brpc::Socket> >::~unique_ptr (
       this=0x7fa2fd69e390, __in_chrg=<optimized out>) at /opt/rh/gcc-toolset-10/root/usr/include/c++/10/bits/unique_ptr.h:361
   #11 0x0000000002d108e7 in brpc::Socket::DebugSocket (os=..., id=17179869742)
       at /root/vcpkg/buildtrees/brpc/src/1.11.0-fbf5526c8b.clean/src/brpc/socket.cpp:2565
   #12 0x0000000002cfebe9 in brpc::SocketsService::default_method (this=0x7fa877946ae8, cntl_base=0x7fa362a69f00,
       done=0x7fa1e9b1fe00) at /root/vcpkg/buildtrees/brpc/src/1.11.0-fbf5526c8b.clean/src/brpc/builtin/sockets_service.cpp:46
   #13 0x0000000002d60b88 in brpc::sockets::CallMethod (this=0x7fa877946ae8, method=0x7fa877b917e0, controller=0x7fa362a69f00,
       request=0x7fa2eadb71a0, response=0x7fa266510040, done=0x7fa1e9b1fe00)
       at /root/vcpkg/buildtrees/brpc/x64-linux-dbg/brpc/builtin_service.pb.cc:3941
   #14 0x0000000002be2714 in brpc::policy::ProcessHttpRequest (msg=0x7fa362a69c10)
       at /root/vcpkg/buildtrees/brpc/src/1.11.0-fbf5526c8b.clean/src/brpc/policy/http_rpc_protocol.cpp:1645
   #15 0x0000000002b70e50 in brpc::ProcessInputMessage (void_arg=0x7fa362a69c10)
       at /root/vcpkg/buildtrees/brpc/src/1.11.0-fbf5526c8b.clean/src/brpc/input_messenger.cpp:177
   #16 0x0000000002b70f45 in brpc::InputMessenger::InputMessageClosure::~InputMessageClosure (this=0x7fa2fd69ed80,
       __in_chrg=<optimized out>) at /root/vcpkg/buildtrees/brpc/src/1.11.0-fbf5526c8b.clean/src/brpc/input_messenger.cpp:213
   #17 0x0000000002b71d33 in brpc::InputMessenger::OnNewMessages (m=0x7fa31eb04f40)
       at /root/vcpkg/buildtrees/brpc/src/1.11.0-fbf5526c8b.clean/src/brpc/input_messenger.cpp:399
   --Type <RET> for more, q to quit, c to continue without paging--f 6
   #18 0x0000000002d09c00 in brpc::Socket::ProcessEvent (arg=0x7fa31eb04f40)
       at /root/vcpkg/buildtrees/brpc/src/1.11.0-fbf5526c8b.clean/src/brpc/socket.cpp:1185
   #19 0x0000000002b03967 in bthread::TaskGroup::task_runner (skip_remained=0)
       at /root/vcpkg/buildtrees/brpc/src/1.11.0-fbf5526c8b.clean/src/bthread/task_group.cpp:305
   #20 0x0000000002a999c1 in bthread_make_fcontext ()
   #21 0x0000000000000000 in ?? ()
   ```
   
   
   **Versions**
   OS: rhel8.2
   Compiler: gcc version 10.3.1 20210422 (Red Hat 10.3.1-1) (GCC)
   brpc: 1.11.0
   protobuf: 3.21.8
   
   
   


-- 
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: issues-unsubscribe@brpc.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@brpc.apache.org
For additional commands, e-mail: issues-help@brpc.apache.org


Re: [I] builtin service执行过程中coredump (brpc)

Posted by "waruto210 (via GitHub)" <gi...@apache.org>.
waruto210 commented on issue #3239:
URL: https://github.com/apache/brpc/issues/3239#issuecomment-4029571913

   > [brpc/src/brpc/versioned_ref_with_id.h](https://github.com/apache/brpc/blob/04d15c08506c4614e2c373662c53ba4ca7055945/src/brpc/versioned_ref_with_id.h#L547)
   > 
   > Line 547 in [04d15c0](/apache/brpc/commit/04d15c08506c4614e2c373662c53ba4ca7055945)
   > 
   >  if (__builtin_expect(ver == id_ver || ver == id_ver + 1, 1)) { 
   > 
   > brpc的Socket被重复销毁了?可以p一下ver和id_ver看一下值
   
   (gdb) info local
   ver = 4
   id_ver = 2
   id = 8589935150
   vref = 17179869185
   nref = 1


-- 
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: issues-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@brpc.apache.org
For additional commands, e-mail: issues-help@brpc.apache.org


Re: [I] builtin service执行过程中coredump (brpc)

Posted by "wenjiecn (via GitHub)" <gi...@apache.org>.
wenjiecn commented on issue #3239:
URL: https://github.com/apache/brpc/issues/3239#issuecomment-4090033362

   @waruto210 有复现方法吗?我用brpc1.11的echo_server demp访问/socket服务没有问题


-- 
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: issues-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@brpc.apache.org
For additional commands, e-mail: issues-help@brpc.apache.org


Re: [I] builtin service执行过程中coredump (brpc)

Posted by "waruto210 (via GitHub)" <gi...@apache.org>.
waruto210 commented on issue #3239:
URL: https://github.com/apache/brpc/issues/3239#issuecomment-4023246071

   > coredump在下面这一行,id是一个uint64_t类型的,很奇怪
   > 
   > ```
   > LOG(FATAL) << "Invalid VRefId=" << id;
   > ```
   
   应该是LOG(FATAL)主动进行的abort导致了coredump,但我疑惑的是,为什么会走到LOG(FATAL)这里


-- 
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: issues-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@brpc.apache.org
For additional commands, e-mail: issues-help@brpc.apache.org


Re: [I] builtin service执行过程中coredump (brpc)

Posted by "wenjiecn (via GitHub)" <gi...@apache.org>.
wenjiecn commented on issue #3239:
URL: https://github.com/apache/brpc/issues/3239#issuecomment-4023235885

   coredump在下面这一行,id是一个uint64_t类型的,很奇怪
   ```
   LOG(FATAL) << "Invalid VRefId=" << id;
   ```


-- 
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: issues-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@brpc.apache.org
For additional commands, e-mail: issues-help@brpc.apache.org


Re: [I] builtin service执行过程中coredump (brpc)

Posted by "wenjiecn (via GitHub)" <gi...@apache.org>.
wenjiecn commented on issue #3239:
URL: https://github.com/apache/brpc/issues/3239#issuecomment-4024021888

   https://github.com/apache/brpc/blob/04d15c08506c4614e2c373662c53ba4ca7055945/src/brpc/versioned_ref_with_id.h#L547
   brpc的Socket被重复销毁了?


-- 
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: issues-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@brpc.apache.org
For additional commands, e-mail: issues-help@brpc.apache.org


Re: [I] builtin service执行过程中coredump (brpc)

Posted by "waruto210 (via GitHub)" <gi...@apache.org>.
waruto210 commented on issue #3239:
URL: https://github.com/apache/brpc/issues/3239#issuecomment-4090045107

   > [@waruto210](https://github.com/waruto210) 有复现方法吗?我用brpc1.11的echo_server demp访问/socket服务没有问题
   
   这个问题只在我们有比较高频的rpc请求的时候出现过,非稳定复现。


-- 
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: issues-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@brpc.apache.org
For additional commands, e-mail: issues-help@brpc.apache.org