id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 5311,"io_service::post/dispatch, io_service::stop, deadline_timer crashes",nfries88@…,chris_kohlhoff,"I've used programs using boost::asio before, but never used it directly myself. I made a test program using boost::asio that models communications from a synchronous TCP server to an asynchronous TCP client. The program launches one thread for the server, which creates an acceptor and calls async_accept; then runs the io_service. Upon accepting a new connection with success, it immediately begins an async read on the new connection and another async_accept. On the original thread, I create a TCP socket (using a separate io_service), connect it to the server, and send a packet saying ""Hello, Server"". When the server thread receives this ""Hello, Server"" packet, it responds with a ""Hello, Client"" packet and begins another async_read with a newly-allocated buffer. When the client receives this ""Hello, Client"" packet, since the test program has nothing else to do, I begin cleaning up by calling io_service::stop on the server's io_service. That crashed. I guessed that maybe it was my fault, so instead I called service.post(bind(&io_service::stop, &service));. This crashed, so I tried the same with service.dispatch(). Now I was confused, so I tried a third time with a deadline_timer that expired after 1 millisecond. This also crashes. io_service::post, io_service::dispatch, and io_service::stop are all crashing when called from a thread other than the one running the io_service. An async_read and async_accept are in progress, but no reading or connecting is being done. deadline_timer::async_wait() crashes when called from a thread other than the one calling io_service::run Also, none of these crashes are caught by try{}catch(){}. Compiler: TDM-MinGW GCC 4.4.1 32-bit Compiler Flags: -Wall -s -O2 Boost Version: 1.46.0 System: Windows 7 Home Premium 64-bit CPU: AMD Turion II P540 (dual-core, 2.40ghz) Problem signature: Problem Event Name: APPCRASH Application Name: nettest.exe Application Version: 0.0.0.0 Application Timestamp: 4d7fc897 Fault Module Name: nettest.exe Fault Module Version: 0.0.0.0 Fault Module Timestamp: 4d7fc897 Exception Code: c0000005 Exception Offset: 0002c702 OS Version: 6.1.7600.2.0.0.768.3 Locale ID: 1033 Additional Information 1: 0a9e Additional Information 2: 0a9e372d3b4ad19135b953a78882e789 Additional Information 3: 0a9e Additional Information 4: 0a9e372d3b4ad19135b953a78882e789 ",Bugs,closed,To Be Determined,asio,Boost 1.46.0,Problem,invalid,"asio, io_service, post, dispatch, stop, deadline_timer, crash",