Opened 9 years ago

Closed 9 years ago

#8605 closed Bugs (worksforme)

SIGSEGV at asio/detail/impl/epoll_reactor.ipp

Reported by: Vadim Grinchishin <vadimgrn@…> Owned by: chris_kohlhoff
Milestone: To Be Determined Component: asio
Version: Boost 1.49.0 Severity: Problem
Keywords: Cc:

Description

Program received signal SIGSEGV, Segmentation fault.

(gdb) bt #0 0x0000000000505e69 in boost::asio::detail::epoll_reactor::start_op (this=0x7fffd4002bf0, op_type=1, descriptor=39,

descriptor_data=@0x7fffd4003920: 0x0, op=0x7fffc8002940, allow_speculative=false) at /usr/include/boost/asio/detail/impl/epoll_reactor.ipp:217

#1 0x00000000005086e2 in boost::asio::detail::reactive_descriptor_service::start_op (this=0x7fffd40039d8, impl=..., op_type=1,

op=0x7fffc8002940, is_non_blocking=false, noop=false) at /usr/include/boost/asio/detail/impl/reactive_descriptor_service.ipp:189

#2 0x000000000050b877 in boost::asio::detail::reactive_descriptor_service::async_write_some<boost::_bi::bind_t<void, boost::_mfi::mf1<void, eve::USBDeviceProxy::Impl, boost::system::error_code const&>, boost::_bi::list2<boost::_bi::value<eve::USBDeviceProxy::Impl*>, boost::arg<1> (*)()> > > (this=0x7fffd40039d8, impl=..., handler=...)

at /usr/include/boost/asio/detail/reactive_descriptor_service.hpp:221

#3 0x000000000050ae03 in boost::asio::posix::stream_descriptor_service::async_write_some<boost::asio::null_buffers, boost::_bi::bind_t<void, boost::_mfi::mf1<void, eve::USBDeviceProxy::Impl, boost::system::error_code const&>, boost::_bi::list2<boost::_bi::value<eve::USBDeviceProxy::Impl*>, boost::arg<1> (*)()> > > (this=0x7fffd40039b0, impl=..., buffers=..., handler=...)

at /usr/include/boost/asio/posix/stream_descriptor_service.hpp:205

#4 0x0000000000509fe5 in boost::asio::posix::basic_stream_descriptor<boost::asio::posix::stream_descriptor_service>::async_write_some<boost::asio::null_buffers, boost::_bi::bind_t<void, boost::_mfi::mf1<void, eve::USBDeviceProxy::Impl, boost::system::error_code const&>, boost::_bi::list2<boost::_bi::value<eve::USBDeviceProxy::Impl*>, boost::arg<1> (*)()> > > (this=0x7fffd4003910,

buffers=..., handler=...) at /usr/include/boost/asio/posix/basic_stream_descriptor.hpp:235

#5 0x00000000004fe402 in eve::USBDeviceProxy::Impl::schedule_async_write (this=0x7fffd4003870) at usbdevice_proxy.cpp:513 #6 0x00000000004fe5d7 in eve::USBDeviceProxy::Impl::do_write (this=0x7fffd4003870, ec=...) at usbdevice_proxy.cpp:551 #7 0x000000000050ce18 in boost::_mfi::mf1<void, eve::USBDeviceProxy::Impl, boost::system::error_code const&>::operator() (

this=0x7fffe55df9e0, p=0x7fffd4003870, a1=...) at /usr/include/boost/bind/mem_fn_template.hpp:165

#8 0x000000000050ccf7 in boost::_bi::list2<boost::_bi::value<eve::USBDeviceProxy::Impl*>, boost::arg<1> (*)()>::operator()<boost::_mfi::mf1<void, eve::USBDeviceProxy::Impl, boost::system::error_code const&>, boost::_bi::list2<boost::system::error_code const&, unsigned long const&> > (this=0x7fffe55df9f0, f=..., a=...) at /usr/include/boost/bind/bind.hpp:313 #9 0x000000000050cc34 in boost::_bi::bind_t<void, boost::_mfi::mf1<void, eve::USBDeviceProxy::Impl, boost::system::error_code const&>, boost::_bi::list2<boost::_bi::value<eve::USBDeviceProxy::Impl*>, boost::arg<1> (*)()> >::operator()<boost::system::error_code, unsigned long> (this=0x7fffe55df9e0, a1=..., a2=@0x7fffe55dfa08: 0) at /usr/include/boost/bind/bind_template.hpp:102 #10 0x000000000050cbe5 in boost::asio::detail::binder2<boost::_bi::bind_t<void, boost::_mfi::mf1<void, eve::USBDeviceProxy::Impl, boost::system::error_code const&>, boost::_bi::list2<boost::_bi::value<eve::USBDeviceProxy::Impl*>, boost::arg<1> (*)()> >, boost::system::error_code, unsigned long>::operator() (this=0x7fffe55df9e0) at /usr/include/boost/asio/detail/bind_handler.hpp:118 #11 0x000000000050ca8a in boost::asio::asio_handler_invoke<boost::asio::detail::binder2<boost::_bi::bind_t<void, boost::_mfi::mf1<void, eve::USBDeviceProxy::Impl, boost::system::error_code const&>, boost::_bi::list2<boost::_bi::value<eve::USBDeviceProxy::Impl*>, boost::arg<1> (*)()> >, boost::system::error_code, unsigned long> > (function=...)

at /usr/include/boost/asio/handler_invoke_hook.hpp:64

#12 0x000000000050c944 in boost_asio_handler_invoke_helpers::invoke<boost::asio::detail::binder2<boost::_bi::bind_t<void, boost::---Type <return> to continue, or q <return> to quit--- _mfi::mf1<void, eve::USBDeviceProxy::Impl, boost::system::error_code const&>, boost::_bi::list2<boost::_bi::value<eve::USBDeviceProxy::Impl*>, boost::arg<1> (*)()> >, boost::system::error_code, unsigned long>, boost::_bi::bind_t<void, boost::_mfi::mf1<void, eve::USBDeviceProxy::Impl, boost::system::error_code const&>, boost::_bi::list2<boost::_bi::value<eve::USBDeviceProxy::Impl*>, boost::arg<1> (*)()> > > (function=..., context=...) at /usr/include/boost/asio/detail/handler_invoke_helpers.hpp:39 #13 0x000000000050c51a in boost::asio::detail::reactive_null_buffers_op<boost::_bi::bind_t<void, boost::_mfi::mf1<void, eve::USBDeviceProxy::Impl, boost::system::error_code const&>, boost::_bi::list2<boost::_bi::value<eve::USBDeviceProxy::Impl*>, boost::arg<1> (*)()> > >::do_complete (owner=0x7fffd40029e0, base=0x7fffc8002940)

at /usr/include/boost/asio/detail/reactive_null_buffers_op.hpp:75

#14 0x0000000000504f30 in boost::asio::detail::task_io_service_operation::complete (this=0x7fffc8002940, owner=..., ec=...,

bytes_transferred=0) at /usr/include/boost/asio/detail/task_io_service_operation.hpp:37

#15 0x0000000000506b29 in boost::asio::detail::epoll_reactor::descriptor_state::do_complete (owner=0x7fffd40029e0,

base=0x7fffd4002b00, ec=..., bytes_transferred=24) at /usr/include/boost/asio/detail/impl/epoll_reactor.ipp:624

#16 0x0000000000504f30 in boost::asio::detail::task_io_service_operation::complete (this=0x7fffd4002b00, owner=..., ec=...,

bytes_transferred=24) at /usr/include/boost/asio/detail/task_io_service_operation.hpp:37

#17 0x00000000005075c4 in boost::asio::detail::task_io_service::do_run_one (this=0x7fffd40029e0, lock=..., this_thread=...,

private_op_queue=..., ec=...) at /usr/include/boost/asio/detail/impl/task_io_service.ipp:369

#18 0x0000000000507061 in boost::asio::detail::task_io_service::run (this=0x7fffd40029e0, ec=...)

at /usr/include/boost/asio/detail/impl/task_io_service.ipp:146

#19 0x00000000005079a3 in boost::asio::io_service::run (this=0x7fffd40038e8) at /usr/include/boost/asio/impl/io_service.ipp:59 #20 0x00000000004fe2c1 in eve::USBDeviceProxy::Impl::do_run (this=0x7fffd4003870) at usbdevice_proxy.cpp:495 #21 0x000000000050d421 in boost::_mfi::mf0<void, eve::USBDeviceProxy::Impl>::operator() (this=0x7fffd4004b88, p=0x7fffd4003870)

at /usr/include/boost/bind/mem_fn_template.hpp:49

#22 0x000000000050d3a2 in boost::_bi::list1<boost::_bi::value<eve::USBDeviceProxy::Impl*> >::operator()<boost::_mfi::mf0<void, eve::USBDeviceProxy::Impl>, boost::_bi::list0> (this=0x7fffd4004b98, f=..., a=...) at /usr/include/boost/bind/bind.hpp:253 #23 0x000000000050d347 in boost::_bi::bind_t<void, boost::_mfi::mf0<void, eve::USBDeviceProxy::Impl>, boost::_bi::list1<boost::_bi::value<eve::USBDeviceProxy::Impl*> > >::operator() (this=0x7fffd4004b88) at /usr/include/boost/bind/bind_template.hpp:20 #24 0x000000000050d21a in boost::detail::thread_data<boost::_bi::bind_t<void, boost::_mfi::mf0<void, eve::USBDeviceProxy::Impl>, boost::_bi::list1<boost::_bi::value<eve::USBDeviceProxy::Impl*> > > >::run (this=0x7fffd4004a00)

at /usr/include/boost/thread/detail/thread.hpp:62

#25 0x00007ffff72f66e9 in ?? () from /usr/lib/libboost_thread.so.1.49.0 #26 0x00007ffff770ff8e in start_thread (arg=0x7fffe55e0700) at pthread_create.c:311 #27 0x00007ffff659be1d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

void epoll_reactor::start_op(int op_type, socket_type descriptor,

epoll_reactor::per_descriptor_data& descriptor_data, reactor_op* op, bool allow_speculative)

{

if (!descriptor_data) {

op->ec_ = boost::asio::error::bad_descriptor; post_immediate_completion(op); return;

}

mutex::scoped_lock descriptor_lock(descriptor_data->mutex_);

if (descriptor_data->shutdown_) segfault, line 217

Attachments (1)

asio (7.8 KB ) - added by Vadim Grinchishin <vadimgrn@…> 9 years ago.

Download all attachments as: .zip

Change History (2)

by Vadim Grinchishin <vadimgrn@…>, 9 years ago

Attachment: asio added

comment:1 by chris_kohlhoff, 9 years ago

Resolution: worksforme
Severity: ShowstopperProblem
Status: newclosed

I suspect your program is destroying the socket from one thread while it is still in use from another. If this is not the case, please attach a small, self-contained test case that reproduces the problem with the most recent version of boost. Thanks.

Note: See TracTickets for help on using tickets.