We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm embedding Pion in a small console application (MSVC-12.0). Unfortunately it crashes when handling a simple HTTP GET request.
I've built it with boost_1_57_0, openssl-1.0.2 and zlib-1.2.8 and no logging.
boost_1_57_0
openssl-1.0.2
zlib-1.2.8
Here's a small example program reproducing the issue,
#include <pion/http/server.hpp> #include <pion/http/response_writer.hpp> using namespace pion; using namespace pion::http; struct test_server { void start() { m_server = pion::http::server_ptr(new pion::http::server(4500)); m_server->add_resource("/", boost::bind(&test_server::handle_request, this, _1, _2)); m_server->start(); } void handle_request(http::request_ptr& req, tcp::connection_ptr& conn) { http::response_writer_ptr writer( http::response_writer::create( conn, *req, boost::bind(&tcp::connection::finish, conn))); // Crashes in this callback writer->write("hello world"); writer->send(); } pion::http::server_ptr m_server; }; int main() { test_server svr; svr.start(); while (1) { Sleep(0); } }
It crashes in the &tcp::connection::finish callback with the following stack trace,
&tcp::connection::finish
pion_test.exe!boost::function1<void,boost::shared_ptr<pion::tcp::connection> >::operator()(boost::shared_ptr<pion::tcp::connection> a0) Line 767 C++ pion_test.exe!pion::tcp::connection::finish() Line 596 C++ pion_test.exe!boost::_mfi::mf0<void,pion::tcp::connection>::call<boost::shared_ptr<pion::tcp::connection> >(boost::shared_ptr<pion::tcp::connection> & u, const void * __formal) Line 40 C++ pion_test.exe!boost::_mfi::mf0<void,pion::tcp::connection>::operator()<boost::shared_ptr<pion::tcp::connection> >(boost::shared_ptr<pion::tcp::connection> & u) Line 56 C++ pion_test.exe!boost::_bi::list1<boost::_bi::value<boost::shared_ptr<pion::tcp::connection> > >::operator()<boost::_mfi::mf0<void,pion::tcp::connection>,boost::_bi::list1<boost::system::error_code const &> >(boost::_bi::type<void> __formal, boost::_mfi::mf0<void,pion::tcp::connection> & f, boost::_bi::list1<boost::system::error_code const &> & a, int __formal) Line 254 C++ pion_test.exe!boost::_bi::bind_t<void,boost::_mfi::mf0<void,pion::tcp::connection>,boost::_bi::list1<boost::_bi::value<boost::shared_ptr<pion::tcp::connection> > > >::operator()<boost::system::error_code>(const boost::system::error_code & a1) Line 48 C++ pion_test.exe!boost::detail::function::void_function_obj_invoker1<boost::_bi::bind_t<void,boost::_mfi::mf0<void,pion::tcp::connection>,boost::_bi::list1<boost::_bi::value<boost::shared_ptr<pion::tcp::connection> > > >,void,boost::system::error_code const &>::invoke(boost::detail::function::function_buffer & function_obj_ptr, const boost::system::error_code & a0) Line 154 C++ pion.dll!boost::function1<void,boost::system::error_code const &>::operator()(const boost::system::error_code & a0) Line 767 C++ pion.dll!pion::http::writer::finished_writing(const boost::system::error_code & ec) Line 82 C++ pion.dll!pion::http::response_writer::handle_write(const boost::system::error_code & write_error, unsigned int bytes_written) Line 161 C++ pion.dll!boost::_mfi::mf2<void,pion::http::response_writer,boost::system::error_code const &,unsigned int>::call<boost::shared_ptr<pion::http::response_writer>,boost::system::error_code const ,unsigned int>(boost::shared_ptr<pion::http::response_writer> & u, const void * __formal, const boost::system::error_code & b1, unsigned int & b2) Line 271 C++ pion.dll!boost::_mfi::mf2<void,pion::http::response_writer,boost::system::error_code const &,unsigned int>::operator()<boost::shared_ptr<pion::http::response_writer> >(boost::shared_ptr<pion::http::response_writer> & u, const boost::system::error_code & a1, unsigned int a2) Line 287 C++ pion.dll!boost::_bi::list3<boost::_bi::value<boost::shared_ptr<pion::http::response_writer> >,boost::arg<1>,boost::arg<2> >::operator()<boost::_mfi::mf2<void,pion::http::response_writer,boost::system::error_code const &,unsigned int>,boost::_bi::list2<boost::system::error_code const &,unsigned int &> >(boost::_bi::type<void> __formal, boost::_mfi::mf2<void,pion::http::response_writer,boost::system::error_code const &,unsigned int> & f, boost::_bi::list2<boost::system::error_code const &,unsigned int &> & a, int __formal) Line 393 C++ pion.dll!boost::_bi::bind_t<void,boost::_mfi::mf2<void,pion::http::response_writer,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<pion::http::response_writer> >,boost::arg<1>,boost::arg<2> > >::operator()<boost::system::error_code,unsigned int>(const boost::system::error_code & a1, unsigned int & a2) Line 77 C++ pion.dll!boost::detail::function::void_function_obj_invoker2<boost::_bi::bind_t<void,boost::_mfi::mf2<void,pion::http::response_writer,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<pion::http::response_writer> >,boost::arg<1>,boost::arg<2> > >,void,boost::system::error_code const &,unsigned int>::invoke(boost::detail::function::function_buffer & function_obj_ptr, const boost::system::error_code & a0, unsigned int a1) Line 154 C++ pion.dll!boost::function2<void,boost::system::error_code const &,unsigned int>::operator()(const boost::system::error_code & a0, unsigned int a1) Line 767 C++ pion.dll!boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::function2<void,boost::system::error_code const &,unsigned int> >::operator()(const boost::system::error_code & ec, unsigned int bytes_transferred, int start) Line 194 C++ pion.dll!boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::function2<void,boost::system::error_code const &,unsigned int> >,boost::system::error_code,unsigned int>::operator()() Line 129 C++ pion.dll!boost::asio::asio_handler_invoke<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::function2<void,boost::system::error_code const &,unsigned int> >,boost::system::error_code,unsigned int> >(boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::function2<void,boost::system::error_code const &,unsigned int> >,boost::system::error_code,unsigned int> & function, ...) Line 70 C++ pion.dll!boost_asio_handler_invoke_helpers::invoke<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::function2<void,boost::system::error_code const &,unsigned int> >,boost::system::error_code,unsigned int>,boost::function2<void,boost::system::error_code const &,unsigned int> >(boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::function2<void,boost::system::error_code const &,unsigned int> >,boost::system::error_code,unsigned int> & function, boost::function2<void,boost::system::error_code const &,unsigned int> & context) Line 37 C++ pion.dll!boost::asio::detail::asio_handler_invoke<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::function2<void,boost::system::error_code const &,unsigned int> >,boost::system::error_code,unsigned int>,boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::function2<void,boost::system::error_code const &,unsigned int> >(boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::function2<void,boost::system::error_code const &,unsigned int> >,boost::system::error_code,unsigned int> & function, boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::function2<void,boost::system::error_code const &,unsigned int> > * this_handler) Line 566 C++ pion.dll!boost_asio_handler_invoke_helpers::invoke<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::function2<void,boost::system::error_code const &,unsigned int> >,boost::system::error_code,unsigned int>,boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::function2<void,boost::system::error_code const &,unsigned int> > >(boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::function2<void,boost::system::error_code const &,unsigned int> >,boost::system::error_code,unsigned int> & function, boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::function2<void,boost::system::error_code const &,unsigned int> > & context) Line 37 C++ pion.dll!boost::asio::detail::win_iocp_socket_send_op<boost::asio::detail::consuming_buffers<boost::asio::const_buffer,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> > >,boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::function2<void,boost::system::error_code const &,unsigned int> > >::do_complete(boost::asio::detail::win_iocp_io_service * owner, boost::asio::detail::win_iocp_operation * base, const boost::system::error_code & result_ec, unsigned int bytes_transferred) Line 92 C++ pion.dll!boost::asio::detail::win_iocp_operation::complete(boost::asio::detail::win_iocp_io_service & owner, const boost::system::error_code & ec, unsigned int bytes_transferred) Line 46 C++ pion.dll!boost::asio::detail::win_iocp_io_service::do_one(bool block, boost::system::error_code & ec) Line 406 C++ pion.dll!boost::asio::detail::win_iocp_io_service::run(boost::system::error_code & ec) Line 164 C++ pion.dll!boost::asio::io_service::run() Line 59 C++ pion.dll!pion::scheduler::process_service_work(boost::asio::io_service & service) Line 111 C++ pion.dll!boost::_mfi::mf1<void,pion::scheduler,boost::asio::io_service &>::call<pion::single_service_scheduler *,boost::asio::io_service>(pion::single_service_scheduler * & u, const void * __formal, boost::asio::io_service & b1) Line 156 C++ pion.dll!boost::_mfi::mf1<void,pion::scheduler,boost::asio::io_service &>::operator()<pion::single_service_scheduler *>(pion::single_service_scheduler * & u, boost::asio::io_service & a1) Line 172 C++ pion.dll!boost::_bi::list2<boost::_bi::value<pion::single_service_scheduler *>,boost::reference_wrapper<boost::asio::io_service> >::operator()<boost::_mfi::mf1<void,pion::scheduler,boost::asio::io_service &>,boost::_bi::list0>(boost::_bi::type<void> __formal, boost::_mfi::mf1<void,pion::scheduler,boost::asio::io_service &> & f, boost::_bi::list0 & a, int __formal) Line 314 C++ pion.dll!boost::_bi::bind_t<void,boost::_mfi::mf1<void,pion::scheduler,boost::asio::io_service &>,boost::_bi::list2<boost::_bi::value<pion::single_service_scheduler *>,boost::reference_wrapper<boost::asio::io_service> > >::operator()() Line 21 C++ pion.dll!boost::detail::thread_data<boost::_bi::bind_t<void,boost::_mfi::mf1<void,pion::scheduler,boost::asio::io_service &>,boost::_bi::list2<boost::_bi::value<pion::single_service_scheduler *>,boost::reference_wrapper<boost::asio::io_service> > > >::run() Line 117 C++ boost_thread-vc120-mt-gd-1_57.dll!boost::`anonymous namespace'::thread_start_function(void * param) Line 305 C++
The text was updated successfully, but these errors were encountered:
I tried this on OSX and it seems to work fine.
Sorry, something went wrong.
No branches or pull requests
I'm embedding Pion in a small console application (MSVC-12.0). Unfortunately it crashes when handling a simple HTTP GET request.
I've built it with
boost_1_57_0
,openssl-1.0.2
andzlib-1.2.8
and no logging.Here's a small example program reproducing the issue,
It crashes in the
&tcp::connection::finish
callback with the following stack trace,The text was updated successfully, but these errors were encountered: