guodongxiaren commented on issue #165:
URL: https://github.com/apache/incubator-brpc/issues/165#issuecomment-824970750


   > ```
   > #include <string>
   > std::stof("a");
   > ```
   > 
   > 在brpc接口内部使用该方法,导致服务core。通过分析core有办法能直接定位到哪一行出现的问题吗?
   > 
   > 使用gdb打开core文件,bt后得到下面的信息:
   > 
   > ```
   > (gdb) bt
   > #0  0x00007f98eb2b11f7 in raise () from /lib64/libc.so.6
   > #1  0x00007f98eb2b28e8 in abort () from /lib64/libc.so.6
   > #2  0x0000000000a7a6b5 in __gnu_cxx::__verbose_terminate_handler() ()
   > #3  0x0000000000a23406 in __cxxabiv1::__terminate(void (*)()) ()
   > #4  0x0000000000a7a159 in __cxa_call_terminate ()
   > #5  0x0000000000a232f4 in __gxx_personality_v0 ()
   > #6  0x0000000000a7eeb3 in _Unwind_RaiseException_Phase2 ()
   > #7  0x0000000000a7f6a7 in _Unwind_Resume ()
   > #8  0x00000000007bdd2a in operator() (this=<optimized out>, obj=<optimized 
out>) at ./src/brpc/destroyable.h:33
   > #9  ~unique_ptr (this=<synthetic pointer>, __in_chrg=<optimized out>) at 
/usr/include/c++/4.8.2/bits/unique_ptr.h:184
   > #10 ~DestroyingPtr (this=<synthetic pointer>, __in_chrg=<optimized out>) 
at ./src/brpc/destroyable.h:39
   > #11 brpc::policy::ProcessRpcRequest (msg_base=<optimized out>) at 
src/brpc/policy/baidu_rpc_protocol.cpp:508
   > #12 0x00000000008df7fa in brpc::ProcessInputMessage 
(void_arg=void_arg@entry=0x7f98a8021930) at src/brpc/input_messenger.cpp:132
   > #13 0x00000000008e07e4 in operator() (this=<optimized out>, 
last_msg=0x7f98a8021930) at src/brpc/input_messenger.cpp:138
   > #14 brpc::InputMessenger::OnNewMessages (m=0x7f987401ac80) at 
/usr/include/c++/4.8.2/bits/unique_ptr.h:184
   > #15 0x00000000008d04ed in brpc::Socket::ProcessEvent (arg=0x7f987401ac80) 
at src/brpc/socket.cpp:1049
   > #16 0x000000000071c1f4 in bthread::TaskGroup::task_runner 
(skip_remained=<optimized out>) at src/bthread/task_group.cpp:291
   > #17 0x0000000000834791 in bthread_make_fcontext ()
   > #18 0x0000000000000000 in ?? ()
   > ```
   > 
   > 
   > 
   很明显是出现了未捕获的异常,下次遇到这种core栈,给自己的业务代码多加noexcept来缩小排查范围


-- 
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to