Periodically (every 20 times or so) I get a segfault when the
destructor for ioService_ is called. A representative stack trace
looks like this:
#0 0x0921bfd6 in ?? ()
#1 0x08125877 in boost::asio::detail::reactor_op_queue<int>::destroy_operations
(
this=0x8ec5f40)
at
opt/linux/include/boost/asio/detail/reactor_op_queue.hpp:268
#2
0x081274ad in boost::asio::detail::epoll_reactor<false>::shutdown_service
(
this=0x8ec5ed8)
at opt/linux/include/boost/asio/detail/epoll_reactor.hpp:119
#3
0x08127b3b in ~service_registry (this=0x8ec5958)
at
opt/linux/include/boost/asio/detail/service_registry.hpp:75
#4 0x08127c29 in ~io_service (this=0x8492360)
at
opt/linux/include/boost/asio/impl/io_service.ipp:62
#5
0x08117110 in ~ClassifierContext (this=0x8492360)
at
ClassifierContext.cpp:91
#6 0xb781cbb9 in exit () from /lib/tls/i686/cmov/libc.so.6
#7
0xb780477d in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
#8
0x081079c1 in _start () at ../sysdeps/i386/elf/start.S:119
Has anyone seen a segfault like this before?
It's intermittent so that tells me there's some kind of race condition.
Any idea how I can work around it?