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

core dump: pure virtual method called #253

Closed
dusteye opened this issue Mar 2, 2018 · 5 comments
Closed

core dump: pure virtual method called #253

dusteye opened this issue Mar 2, 2018 · 5 comments

Comments

@dusteye
Copy link

dusteye commented Mar 2, 2018

I use brpc as http service run in a std::thread with a little modification from http_c++ example. When I access a invalid path, the server return a error message "failed to find method", which seems normal, but when I access / and the /HttpService/Echo, the server core with message "pure virtual method called"

the call stack :
#0 0x00007f5751c4f625 in raise () from /lib64/libc.so.6
#1 0x00007f5751c50e05 in abort () from /lib64/libc.so.6
#2 0x0000000000682675 in __gnu_cxx::__verbose_terminate_handler () at ../../.././libstdc++-v3/libsupc++/vterminate.cc:95
#3 0x000000000063a806 in __cxxabiv1::__terminate (handler=) at ../../.././libstdc++-v3/libsupc++/eh_terminate.cc:38
#4 0x000000000063a833 in std::terminate () at ../../.././libstdc++-v3/libsupc++/eh_terminate.cc:48
#5 0x000000000063ad5f in __cxxabiv1::__cxa_pure_virtual () at ../../.././libstdc++-v3/libsupc++/pure.cc:50
#6 0x0000000000816fea in FindMethodPropertyByURIImpl (unresolved_path=0x7f571003b240, server=0x3d19a40, uri_path=...)
at src/brpc/policy/http_rpc_protocol.cpp:802
#7 brpc::policy::FindMethodPropertyByURI (uri_path=..., server=0x3d19a40, unresolved_path=0x7f571003b240)
at src/brpc/policy/http_rpc_protocol.cpp:842
#8 0x000000000081aecc in brpc::policy::ProcessHttpRequest (msg=0x7f57100227a0) at src/brpc/policy/http_rpc_protocol.cpp:1150
#9 0x00000000007d2aca in brpc::ProcessInputMessage (void_arg=void_arg@entry=0x7f57100227a0) at src/brpc/input_messenger.cpp:132
#10 0x00000000007d3ad4 in operator() (this=, last_msg=0x7f57100227a0) at src/brpc/input_messenger.cpp:138
#11 brpc::InputMessenger::OnNewMessages (m=0x7f570c01ac80) at /usr/local/include/c++/4.8.4/bits/unique_ptr.h:184
#12 0x00000000006c4a1d in brpc::Socket::ProcessEvent (arg=0x7f570c01ac80) at src/brpc/socket.cpp:1051
#13 0x000000000077d5fa in bthread::TaskGroup::task_runner (skip_remained=) at src/bthread/task_group.cpp:297
#14 0x000000000076b811 in bthread_make_fcontext ()

@jamesge
Copy link
Contributor

jamesge commented Mar 2, 2018

The crash is abnormal. Check if the "Echo" function is implemented and overridden correctly.

@dusteye
Copy link
Author

dusteye commented Mar 2, 2018

@jamesge Sure, it is implemented. I just simply copy the echo server to my project in a std::thread. The index page / also can't be accessed.

@dusteye
Copy link
Author

dusteye commented Mar 2, 2018

more info: /index?as_more /healthy can be accessed but /status can not.
My os is centos 6.3 with linux kernel 2.6.32
I use my self-build gcc 4.8.4 with config --enable-languages=c,c++ --disable-multilib
gflags leveldb protobuf all self-build with newest code.
Cant it be the libstdc++ abi linking problem?

@chenzhangyi
Copy link
Member

Check if the instance of service is destroyed.

@dusteye
Copy link
Author

dusteye commented Mar 5, 2018

@chenzhangyi thanks. My mistake. Service should not be removed before server stopped.

@jamesge jamesge closed this as completed Mar 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants