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

when i use the post method ,the progream coredump #352

Closed
zhanb opened this issue Nov 16, 2018 · 3 comments
Closed

when i use the post method ,the progream coredump #352

zhanb opened this issue Nov 16, 2018 · 3 comments

Comments

@zhanb
Copy link

zhanb commented Nov 16, 2018

(gdb) where
#0 0x00007fb706b9faf0 in std::unique_ptr<restbed::detail::RequestImpl, std::default_deleterestbed::detail::RequestImpl >::get() const () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#1 0x00007fb706b9e0ac in std::unique_ptr<restbed::detail::RequestImpl, std::default_deleterestbed::detail::RequestImpl >::operator->() const () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#2 0x00007fb706c31236 in restbed::Request::get_path(std::function<std::string (std::string const&)> const&) const () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#3 0x00000000004a4822 in RequestController::__lambda5::operator() (__closure=0x7fb6d4005920, session=..., body=...) at controller/RequestController.cpp:135
#4 0x00000000004a728e in std::_Function_handler<void(std::shared_ptrrestbed::Session, const std::vector<unsigned char, std::allocator >&), RequestController::postHandleMethodHandler(std::shared_ptrrestbed::Session)::__lambda5>::_M_invoke(const std::_Any_data &, std::shared_ptrrestbed::Session, const std::vector<unsigned char, std::allocator > &) (__functor=..., __args#0=..., __args#1=...) at /usr/include/c++/4.8.2/functional:2071
#5 0x00007fb706bedcfa in std::function<void (std::shared_ptrrestbed::Session, std::vector<unsigned char, std::allocator > const&)>::operator()(std::shared_ptrrestbed::Session, std::vector<unsigned char, std::allocator > const&) const () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#6 0x00007fb706bebad0 in restbed::detail::SessionImpl::fetch_body(unsigned long, std::shared_ptrrestbed::Session, std::function<void (std::shared_ptrrestbed::Session, std::vector<unsigned char, std::allocator > const&)> const&) const () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#7 0x00007fb706c514ff in restbed::Session::fetch(unsigned long, std::function<void (std::shared_ptrrestbed::Session, std::vector<unsigned char, std::allocator > const&)> const&)::{lambda(std::error_code const&, unsigned long)#1}::operator()(std::error_code const&, unsigned long) const () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#8 0x00007fb706c53f43 in std::_Function_handler<void (std::error_code const&, unsigned long), restbed::Session::fetch(unsigned long, std::function<void (std::shared_ptrrestbed::Session, std::vector<unsigned char, std::allocator > const&)> const&)::{lambda(std::error_code const&, unsigned long)#1}>::_M_invoke(std::_Any_data const&, std::error_code const&, unsigned long) () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#9 0x00007fb706c0b4d9 in std::function<void (std::error_code const&, unsigned long)>::operator()(std::error_code const&, unsigned long) const () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#10 0x00007fb706bf2227 in restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}::operator()(std::error_code const&, unsigned long) const () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#11 0x00007fb706c01e5e in asio::detail::binder2<restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, std::error_code, unsigned long>::operator()() () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#12 0x00007fb706c01684 in void asio::asio_handler_invoke<asio::detail::binder2<restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, std::error_code, unsigned long> >(asio::detail::binder2<restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, std::error_code, unsigned long>&, ...) () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#13 0x00007fb706c00bad in void asio_handler_invoke_helpers::invoke<asio::detail::binder2<restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, std::error_code, unsigned long>, {lambda(std::error_code const&, unsigned long)#1}>(asio::detail::binder2<restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, std::error_code, unsigned long>&, {lambda(std::error_code const&, unsigned long)#1}&) () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#14 0x00007fb706bffd1f in void asio::detail::asio_handler_invoke<asio::detail::binder2<restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, std::error_code, unsigned long>, {lambda(std::error_code const&, unsigned long)#1}, std::error_code, unsigned long>(asio::detail::binder2<restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, std::error_code, unsigned long>&, asio::detail::binder2<{lambda(std::error_code const&, unsigned long)#1}, std::error_code, unsigned long>) () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#15 0x00007fb706bfe2bd in void asio_handler_invoke_helpers::invoke<asio::detail::binder2<restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, std::error_code, unsigned long>, restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}>(asio::detail::binder2<restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, std::error_code, unsigned long>&, restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}&) () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#16 0x00007fb706bfbded in void asio::detail::strand_service::dispatch<asio::detail::binder2<restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, std::error_code, unsigned long> >(asio::detail::strand_service::strand_impl
&, asio::detail::binder2<restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, std::error_code, unsigned long>&) ()
from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#17 0x00007fb706bfa1bd in asio::async_result<std::decay<asio::detail::binder2<restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, std::error_code, unsigned long> >::type, void ()>::return_type asio::io_context::strand::dispatch<asio::detail::binder2<restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, std::error_code, unsigned long> >(std::decay&&) ()
from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#18 0x00007fb706bf8b40 in void asio::detail::wrapped_handler<asio::io_context::strand, restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, asio::detail::is_continuation_if_running>::operator()<std::error_code, unsigned long>(std::error_code const&, unsigned long const&) ()
from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#19 0x00007fb706bf65cc in asio::detail::read_dynbuf_op<asio::basic_stream_socketasio::ip::tcp, asio::basic_streambuf_ref<std::allocator >, asio::detail::transfer_at_least_t, asio::detail::wrapped_handler<asio::io_context::strand, restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, asio::detail::is_continuation_if_running> >::operator()(std::error_code const&, unsigned long, int) () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#20 0x00007fb706c0526e in asio::detail::binder2<asio::detail::read_dynbuf_op<asio::basic_stream_socketasio::ip::tcp, asio::basic_streambuf_ref<std::allocator >, asio::detail::transfer_at_least_t, asio::detail::wrapped_handler<asio::io_context::strand, restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, asio::detail::is_continuation_if_running> >, std::error_code, unsigned long>::operator()() () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#21 0x00007fb706c0515e in asio::detail::rewrapped_handler<asio::detail::binder2<asio::detail::read_dynbuf_op<asio::basic_stream_socketasio::ip::tcp, asio::basic_streambuf_ref<std::allocator >, asio::detail::transfer_at_least_t, asio::detail::wrapped_handler<asio::io_context::strand, restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, asio::detail::is_continuation_if_running> >, std::error_code, unsigned long>, {lambda(std::error_code const&, unsigned long)#1}>::operator()() ()
from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#22 0x00007fb706c04f67 in void asio::asio_handler_invoke<asio::detail::rewrapped_handler<asio::detail::binder2<asio::detail::read_dynbuf_op<asio::basic_stream_socketasio::ip::tcp, asio::basic_streambuf_ref<std::allocator >, asio::detail::transfer_at_least_t, asio::detail::wrapped_handler<asio::io_context::strand, restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, asio::detail::is_continuation_if_running> >, std::error_code, unsigned long>, {lambda(std::error_code const&, unsigned long)#1}> >(asio::detail::rewrapped_handler<asio::---Type to continue, or q to quit---
detail::binder2<asio::detail::read_dynbuf_op<asio::basic_stream_socketasio::ip::tcp, asio::basic_streambuf_ref<std::allocator >, asio::detail::transfer_at_least_t, asio::detail::wrapped_handler<asio::io_context::strand, restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, asio::detail::is_continuation_if_running> >, std::error_code, unsigned long>, {lambda(std::error_code const&, unsigned long)#1}>&, ...) () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#23 0x00007fb706c04bc4 in void asio_handler_invoke_helpers::invoke<asio::detail::rewrapped_handler<asio::detail::binder2<asio::detail::read_dynbuf_op<asio::basic_stream_socketasio::ip::tcp, asio::basic_streambuf_ref<std::allocator >, asio::detail::transfer_at_least_t, asio::detail::wrapped_handler<asio::io_context::strand, restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, asio::detail::is_continuation_if_running> >, std::error_code, unsigned long>, {lambda(std::error_code const&, unsigned long)#1}>, {lambda(std::error_code const&, unsigned long)#1}>(asio::detail::rewrapped_handler<asio::detail::binder2<asio::detail::read_dynbuf_op<asio::basic_stream_socketasio::ip::tcp, asio::basic_streambuf_ref<std::allocator >, asio::detail::transfer_at_least_t, asio::detail::wrapped_handler<asio::io_context::strand, restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, asio::detail::is_continuation_if_running> >, std::error_code, unsigned long>, {lambda(std::error_code const&, unsigned long)#1}>&, {lambda(std::error_code const&, unsigned long)#1}&) ()
from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#24 0x00007fb706c04523 in void asio::detail::asio_handler_invoke<asio::detail::rewrapped_handler<asio::detail::binder2<asio::detail::read_dynbuf_op<asio::basic_stream_socketasio::ip::tcp, asio::basic_streambuf_ref<std::allocator >, asio::detail::transfer_at_least_t, asio::detail::wrapped_handler<asio::io_context::strand, restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, asio::detail::is_continuation_if_running> >, std::error_code, unsigned long>, {lambda(std::error_code const&, unsigned long)#1}>, asio::detail::read_dynbuf_op<asio::basic_stream_socketasio::ip::tcp, asio::basic_streambuf_ref<std::allocator >, asio::detail::transfer_at_least_t, asio::detail::wrapped_handler<asio::io_context::strand, restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, asio::detail::is_continuation_if_running> >, {lambda(std::error_code const&, unsigned long)#1}>(asio::detail::rewrapped_handler<asio::detail::binder2<asio::detail::read_dynbuf_op<asio::basic_stream_socketasio::ip::tcp, asio::basic_streambuf_ref<std::allocator >, asio::detail::transfer_at_least_t, asio::detail::wrapped_handler<asio::io_context::strand, restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, asio::detail::is_continuation_if_running> >, std::error_code, unsigned long>, {lambda(std::error_code const&, unsigned long)#1}>&, asio::detail::rewrapped_handler<asio::detail::read_dynbuf_op<asio::basic_stream_socketasio::ip::tcp, asio::basic_streambuf_ref<std::allocator >, asio::detail::transfer_at_least_t, asio::detail::wrapped_handler<asio::io_context::strand, restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, asio::detail::is_continuation_if_running> >, {lambda(std::error_code const&, unsigned long)#1}>) () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#25 0x00007fb706c03b11 in void asio_handler_invoke_helpers::invoke<asio::detail::rewrapped_handler<asio::detail::binder2<asio::detail::read_dynbuf_op<asio::basic_stream_socketasio::ip::tcp, asio::basic_streambuf_ref<std::allocator >, asio::detail::transfer_at_least_t, asio::detail::wrapped_handler<asio::io_context::strand, restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, asio::detail::is_continuation_if_running> >, std::error_code, unsigned long>, {lambda(std::error_code const&, unsigned long)#1}>, asio::detail::binder2<asio::detail::read_dynbuf_op<asio::basic_stream_socketasio::ip::tcp, asio::basic_streambuf_ref<std::allocator >, asio::detail::transfer_at_least_t, asio::detail::wrapped_handler<asio::io_context::strand, restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, asio::detail::is_continuation_if_running> >, std::error_code, unsigned long> >(asio::detail::rewrapped_handler<asio::detail::binder2<asio::detail::read_dynbuf_op<asio::basic_stream_socketasio::ip::tcp, asio::basic_streambuf_ref<std::allocator >, asio::detail::transfer_at_least_t, asio::detail::wrapped_handler<asio::io_context::strand, restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, asio::detail::is_continuation_if_running> >, std::error_code, unsigned long>, {lambda(std::error_code const&, unsigned long)#1}>&, asio::detail::binder2<asio::detail::read_dynbuf_op<asio::basic_stream_socketasio::ip::tcp, asio::basic_streambuf_ref<std::allocator >, asio::detail::transfer_at_least_t, asio::detail::wrapped_handler<asio::io_context::strand, restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, asio::detail::is_continuation_if_running> >, std::error_code, unsigned long>&) () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#26 0x00007fb706c0474f in void asio::detail::handler_work<asio::detail::rewrapped_handler<asio::detail::binder2<asio::detail::read_dynbuf_op<asio::basic_stream_socketasio::ip::tcp, asio::basic_streambuf_ref<std::allocator >, asio::detail::transfer_at_least_t, asio::detail::wrapped_handler<asio::io_context::strand, restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, asio::detail::is_continuation_if_running> >, std::error_code, unsigned long>, {lambda(std::error_code const&, unsigned long)#1}>, asio::system_executor>::complete<asio::detail::binder2<asio::detail::read_dynbuf_op<asio::basic_stream_socketasio::ip::tcp, asio::basic_streambuf_ref<std::allocator >, asio::detail::transfer_at_least_t, asio::detail::wrapped_handler<asio::io_context::strand, restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, asio::detail::is_continuation_if_running> >, std::error_code, unsigned long> >(asio::detail::binder2<asio::detail::read_dynbuf_op<asio::basic_stream_socketasio::ip::tcp, asio::basic_streambuf_ref<std::allocator >, asio::detail::transfer_at_least_t, asio::detail::wrapped_handler<asio::io_context::strand, restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, asio::detail::is_continuation_if_running> >, std::error_code, unsigned long>&, asio::detail::binder2<asio::detail::read_dynbuf_op<asio::basic_stream_socketasio::ip::tcp, asio::basic_streambuf_ref<std::allocator >, asio::detail::transfer_at_least_t, asio::detail::wrapped_handler<asio::io_context::strand, restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, asio::detail::is_continuation_if_running> >, std::error_code, unsigned long>&) ()
from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#27 0x00007fb706c03ce9 in asio::detail::completion_handler<asio::detail::rewrapped_handler<asio::detail::binder2<asio::detail::read_dynbuf_op<asio::basic_stream_socketasio::ip::tcp, asio::basic_streambuf_ref<std::allocator >, asio::detail::transfer_at_least_t, asio::detail::wrapped_handler<asio::io_context::strand, restbed::detail::SocketImpl::read(std::shared_ptr<asio::basic_streambuf<std::allocator > > const&, unsigned long, std::function<void (std::error_code const&, unsigned long)> const&)::{lambda(std::error_code const&, unsigned long)#1}, asio::detail::is_continuation_if_running> >, std::error_code, unsigned long>, {lambda(std::error_code const&, unsigned long)#1}> >::do_complete(void
, asio::detail::scheduler_operation*, std::error_code const&, unsigned long) () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#28 0x00007fb706bd2608 in asio::detail::scheduler_operation::complete(void*, std::error_code const&, unsigned long) () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#29 0x00007fb706c08959 in asio::detail::strand_service::do_complete(void*, asio::detail::scheduler_operation*, std::error_code const&, unsigned long) () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#30 0x00007fb706bd2608 in asio::detail::scheduler_operation::complete(void*, std::error_code const&, unsigned long) () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#31 0x00007fb706c066ef in asio::detail::scheduler::do_run_one(asio::detail::conditionally_enabled_mutex::scoped_lock&, asio::detail::scheduler_thread_info&, std::error_code const&) () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#32 0x00007fb706c0636f in asio::detail::scheduler::run(std::error_code&) () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#33 0x00007fb706c06a47 in asio::io_context::run() () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#34 0x00007fb706c3d0e3 in restbed::Service::start(std::shared_ptr<restbed::Settings const> const&)::{lambda()#2}::operator()() const () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#35 0x00007fb706c43bec in void std::_Bind_simple<restbed::Service::start(std::shared_ptr<restbed::Settings const> const&)::{lambda()#2} ()>::_M_invoke<>(std::_Index_tuple<>) () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#36 0x00007fb706c439d3 in std::_Bind_simple<restbed::Service::start(std::shared_ptr<restbed::Settings const> const&)::{lambda()#2} ()>::operator()() () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#37 0x00007fb706c43705 in std::_Function_handler<void (), std::reference_wrapper<std::_Bind_simple<restbed::Service::start(std::shared_ptr<restbed::Settings const> const&)::{lambda()#2} ()> > >::_M_invoke(std::_Any_data const&) ()
from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#38 0x00007fb706c46cc0 in std::function<void ()>::operator()() const () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
---Type to continue, or q to quit---
#39 0x00007fb706c4e7a7 in std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result, std::__future_base::_Result_base::_Deleter>, void>::operator()() () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#40 0x00007fb706c4e63b in std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result, std::__future_base::_Result_base::_Deleter>, void> >::_M_invoke(std::_Any_data const&) () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#41 0x00007fb706c2bf9d in std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#42 0x00007fb706c2b5ee in std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>&, bool&) ()
from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#43 0x00007fb706c2f5ac in void std::_Mem_fn<void (std::__future_base::_State_baseV2::)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>&, bool&)>::operator()<std::reference_wrapper<std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()> >, std::reference_wrapper, void>(std::__future_base::_State_baseV2, std::reference_wrapper<std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()> >&&, std::reference_wrapper&&) const () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#44 0x00007fb706c2eeef in void std::_Bind_simple<std::_Mem_fn<void (std::__future_base::_State_baseV2::)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>&, bool&)> (std::__future_base::_State_baseV2, std::reference_wrapper<std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()> >, std::reference_wrapper)>::_M_invoke<0ul, 1ul, 2ul>(std::_Index_tuple<0ul, 1ul, 2ul>) () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#45 0x00007fb706c2e461 in std::_Bind_simple<std::_Mem_fn<void (std::__future_base::_State_baseV2::)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>&, bool&)> (std::__future_base::_State_baseV2, std::reference_wrapper<std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()> >, std::reference_wrapper)>::operator()() ()
from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#46 0x00007fb706c2d041 in void std::__once_call_impl<std::_Bind_simple<std::_Mem_fn<void (std::__future_base::_State_baseV2::)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>&, bool&)> (std::__future_base::_State_baseV2, std::reference_wrapper<std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()> >, std::reference_wrapper)> >() ()
from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#47 0x00007fb706374e70 in pthread_once () from /lib64/libpthread.so.0
#48 0x00007fb706c2567d in __gthread_once(int*, void ()()) () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#49 0x00007fb706c2be43 in void std::call_once<void (std::__future_base::_State_baseV2::
)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>&, bool&), std::__future_base::_State_baseV2*, std::reference_wrapper<std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()> >, std::reference_wrapper >(std::once_flag&, void (std::__future_base::_State_baseV2::&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>&, bool&), std::__future_base::_State_baseV2&&, std::reference_wrapper<std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()> >&&, std::reference_wrapper&&) () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#50 0x00007fb706c2b41c in std::__future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool) ()
from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#51 0x00007fb706c42f07 in _ZZNSt13__future_base17_Async_state_implISt12_Bind_simpleIFZN7restbed7Service5startERKSt10shared_ptrIKNS2_8SettingsEEEUlvE0_vEEvEC4EOSC_ENKUlvE_clEv () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#52 0x00007fb706c44df8 in _ZNSt12_Bind_simpleIFZNSt13__future_base17_Async_state_implIS_IFZN7restbed7Service5startERKSt10shared_ptrIKNS2_8SettingsEEEUlvE0_vEEvEC4EOSC_EUlvE_vEE9_M_invokeIIEEEvSt12_Index_tupleIIXspT_EEE ()
from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#53 0x00007fb706c44c75 in _ZNSt12_Bind_simpleIFZNSt13__future_base17_Async_state_implIS_IFZN7restbed7Service5startERKSt10shared_ptrIKNS2_8SettingsEEEUlvE0_vEEvEC4EOSC_EUlvE_vEEclEv () from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#54 0x00007fb706c447fc in _ZNSt6thread5_ImplISt12_Bind_simpleIFZNSt13__future_base17_Async_state_implIS1_IFZN7restbed7Service5startERKSt10shared_ptrIKNS4_8SettingsEEEUlvE0_vEEvEC4EOSE_EUlvE_vEEE6_M_runEv ()
from /usr/local/handle-proxy/bin/..//lib/librestbed.so.4
#55 0x00007fb706113c70 in std::(anonymous namespace)::execute_native_thread_routine (__p=) at ../../../../../libstdc++-v3/src/c++11/thread.cc:84
#56 0x00007fb70636fe25 in start_thread () from /lib64/libpthread.so.0

@ben-crowhurst
Copy link
Member

Could you please provide a code example for replication?

@zhanb
Copy link
Author

zhanb commented Dec 3, 2018

Could you please provide a code example for replication?

void RequestController::run()
{

Service service;

std::set<std::string> realHandleUrl = { Configure::handle_url + "/.*", Configure::handle_url + "/.*/.*" };

auto resource = make_shared< restbed::Resource >();
resource->set_paths(realHandleUrl);//

resource->set_method_handler(REQUEST_METHOD_POST, std::bind(&RequestController::postHandleMethodHandler, this, std::placeholders::_1));

service.publish(resource);
auto settings = make_shared< Settings >();

settings->set_port(Configure::proxy_port);
settings->set_default_header("Connection", "close");
settings->set_worker_limit(20);
service.start(settings);

}
void RequestController::postHandleMethodHandler(const shared_ptr< Session > session)
{
const auto request = session->get_request();
if (request->get_path().empty())
{
session->close(500);
return;
}
int content_length = request->get_header("Content-Length", 0);
session->fetch(content_length, [&](const shared_ptr< Session > session, const Bytes & body)
{
if (!body.empty())
{
std::string rspstr = "";
std::string reqstr = "";
int ret = RetSuccess;
reqstr.assign(body.begin(), body.end());
neb::CJsonObject handleJsonObj;
handleJsonObj.Parse(reqstr);
if (handleJsonObj("action") == "query")
{
ret = ap_serviceVec[0]->getHandle(request->get_path().substr(1), reqstr, rspstr);
}
else
{
ret = ap_serviceVec[0]->createHandle(request->get_path().substr(1), reqstr, rspstr);
}

		const multimap< string, string > headers
		{
			{ "Content-Length",::to_string(rspstr.length()) },
			{ "Content-Type", "application/json" }
		};
		session->close(ret, rspstr, headers);
	}
});

}

@zhanb
Copy link
Author

zhanb commented Dec 3, 2018

Could you please provide a code example for replication?

any wrong in my code ?

@zhanb zhanb closed this as completed Jan 11, 2019
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

2 participants