Re: [asio-users] Can't catch Boost.Asio exceptions inside coroutines
Brought to you by:
chris_kohlhoff
From: Sergey S. <rk...@rk...> - 2016-10-27 06:33:38
|
Good to know that at least one configuration is working, thank you for testing! That MinGW build is for Windows, unfortunately, and I'd like to compile on Linux for Windows. 2016-10-27 8:40 GMT+03:00 niXman <i.n...@au...>: > Sergey Shpikin 2016-10-26 18:48: >> I have this little example of Boost.Asio code: >> http://codepad.org/tuQedXI7 It works as expected on Linux producing >> 1 >> 2 >> Caught Host not found (authoritative) >> >> but on Windows it crashes with: >> 1 >> 2 >> terminate called after throwing an instance of >> 'boost::system::system_error' >> what(): Unknown error >> >> Tested on Windows Server 2008, Windows 7 and Wine, everything is the >> same. I'm compiling on Linux for Windows with MXE ( http://mxe.cc/ ) >> on GCC 4.9.4, Boost version is 1.60.0. I'm really stuck at this point >> as nothing in Google looks a valid solution for the case and I already >> have a working application on Linux but it crashes on any network >> error on Windows. >> >> On Windows coroutines prevent any exceptions from being caught when >> the program is compiled with -O1/2/3 but they're caught with -O0 or >> -Os (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54267 — this is >> about GCC on FreeBSD but the same seemingly applies to MinGW). >> However, boost's own exceptions, like the aforementioned >> boost::system::system_error, still can't be caught. > > Works as expected for me using i686-6.2.0-release-posix-dwarf-rev1[1] & > boost-1.62. > > > > [1] > https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/6.2.0/threads-posix/dwarf/i686-6.2.0-release-posix-dwarf-rt_v5-rev1.7z > > -- > Regards, niXman > ___________________________________________________ > Dual-target(32 & 64-bit) MinGW-W64 compilers for 32 and 64-bit Windows: > http://sourceforge.net/projects/mingw-w64/ > > ------------------------------------------------------------------------------ > The Command Line: Reinvented for Modern Developers > Did the resurgence of CLI tooling catch you by surprise? > Reconnect with the command line and become more productive. > Learn the new .NET and ASP.NET CLI. Get your free copy! > http://sdm.link/telerik > _______________________________________________ > asio-users mailing list > asi...@li... > https://lists.sourceforge.net/lists/listinfo/asio-users > _______________________________________________ > Using Asio? List your project at > http://think-async.com/Asio/WhoIsUsingAsio |