[Boost-bugs] [Boost C++ Libraries] #10213: Reproducible crash with Boost Asio and io_service::post

Subject: [Boost-bugs] [Boost C++ Libraries] #10213: Reproducible crash with Boost Asio and io_service::post
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-07-18 00:31:30


#10213: Reproducible crash with Boost Asio and io_service::post
------------------------------+----------------------------
 Reporter: boost-bugs@… | Owner: chris_kohlhoff
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: asio
  Version: Boost 1.55.0 | Severity: Showstopper
 Keywords: |
------------------------------+----------------------------
 On OSX, running the following code repeatedly results in an occasional
 crash with the stack trace following. Unfortunately, I can't find a
 workaround nor a fix since I don't actually understand why it is
 crashing...

 {{{#!c++
   using namespace boost::asio;

   io_service service;
   io_service::work work(service);
   boost::thread thread{[&](){
       service.reset();
       service.run();
     }
   };
   service.post([&service](){service.stop();});
   thread.join();
 }}}

 {{{
 Error: signal 11:
 0 KimiTestApp 0x0000000105534a02 _Z7handleri +
 34
 1 libsystem_platform.dylib 0x00007fff97a075aa _sigtramp + 26
 2 KimiTestApp 0x00000001054f154d
 _ZN5boost6detail12shared_countD2Ev + 45
 3 libsystem_pthread.dylib 0x00007fff9665691e
 _pthread_cond_signal + 612
 4 KimiTestApp 0x0000000105642c43
 _ZN5boost4asio6detail11posix_event17signal_and_unlockINS1_11scoped_lockINS1_11posix_mutexEEEEEvRT_
 + 115
 5 KimiTestApp 0x0000000105642ab4
 _ZN5boost4asio6detail15task_io_service31wake_one_idle_thread_and_unlockERNS1_11scoped_lockINS1_11posix_mutexEEE
 + 100
 6 KimiTestApp 0x000000010564293f
 _ZN5boost4asio6detail15task_io_service26wake_one_thread_and_unlockERNS1_11scoped_lockINS1_11posix_mutexEEE
 + 47
 7 KimiTestApp 0x000000010564247e
 _ZN5boost4asio6detail15task_io_service25post_immediate_completionEPNS1_25task_io_service_operationEb
 + 206
 8 KimiTestApp 0x000000010564002e
 _ZN5boost4asio6detail15task_io_service4postIZN42GlobalTestModule_TestNoOpDieImmediate_Test8TestBodyEvE3$_0EEvRT_
 + 190
 9 KimiTestApp 0x000000010563ff24
 _ZN5boost4asio10io_service4postIZN42GlobalTestModule_TestNoOpDieImmediate_Test8TestBodyEvE3$_0EENS0_12async_resultINS0_12handler_typeIT_FvvEE4typeEE4typeEOS7_
 + 68
 10 KimiTestApp 0x000000010563fded
 _ZN42GlobalTestModule_TestNoOpDieImmediate_Test8TestBodyEv + 125
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10213>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:16 UTC