Re: [Boost-bugs] [Boost C++ Libraries] #13245: Coroutines2: Crashes Visual Studio when attached with a debugger (on Windows x86)

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #13245: Coroutines2: Crashes Visual Studio when attached with a debugger (on Windows x86)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-10-09 17:24:14


#13245: Coroutines2: Crashes Visual Studio when attached with a debugger (on
Windows x86)
----------------------------------------------+----------------------------
  Reporter: Michael Eiler <michael.eiler@…> | Owner: olli
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: context
   Version: Boost 1.65.0 | Severity: Showstopper
Resolution: | Keywords: coroutine2,
                                              | context
----------------------------------------------+----------------------------
Changes (by Michael Eiler <michael.eiler@…>):

 * keywords: coroutine2 => coroutine2, context
 * version: Boost 1.63.0 => Boost 1.65.0
 * component: coroutine => context

Comment:

 Hi,

 I did some further investigations and can provide some more details.
 The problem also occurs in the newest boost release (1.65.1).
 The behavior is still the same. It only crashes when the C# debugger
 (without native debugging) is attached but I can directly reproduce it
 with context, the coroutine2 wrapper around it is not necessary.

 This is the updated content of the Api.cpp file:
 {{{
 #include <boost/coroutine2/coroutine.hpp>
 #include <boost/context/all.hpp>

 class Foo
 {
 public:
         void bar() {
                 throw std::exception("Hello World!");
         }
 };

 int ApiInit()
 {
         boost::context::continuation source = boost::context::callcc(
                 [](boost::context::continuation && sink) {
                         Foo foo;
                         try {
                                 foo.bar();
                         }
                         catch (const std::exception& ex) {
                                 std::cerr << "caught ex: " << ex.what() <<
 std::endl;
                         }

                         return std::move(sink);
                 });

         if (source.operator bool())
                 source = source.resume();

         return 0;
 }
 }}}
 It's important that this is compiled without optimizations enabled (e.g.
 in debug mode) so that throwing the exception won't be optimized away.
 Because the actual issue is exactly the process of throwing an exception.

 Best Regards,

 Michael

-- 
Ticket URL: <https://svn.boost.org/trac10/boost/ticket/13245#comment:1>
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-10-09 17:30:55 UTC