Code Monkey home page Code Monkey logo

Comments (13)

olk avatar olk commented on August 16, 2024

I don't use Windows, could you try your example with a larger stack size + uncommented cout?
coro_t::pull_type coro(fixedsize_stack(1024*1024), [&](coro_t::push_type& yield) {

from coroutine2.

 avatar commented on August 16, 2024

fixedsize_stack(1024*1024) doesn't change behaviour.
I've also tried to run it in VS2017:

(boost\context\continuation_fcontext.hpp)

transfer_t context_unwind( transfer_t t) {
    throw forced_unwind( t.fctx);  <---- Unhandled exception at 0x761633AB (ucrtbase.dll) in CoroTest.exe: Fatal program exit requested.
    return { nullptr, nullptr };
}

from coroutine2.

olk avatar olk commented on August 16, 2024

I can't reproduce your problem. I've used msvc-14.1 (VS 2017) and built the test code in directory coroutine2/example.

from coroutine2.

 avatar commented on August 16, 2024

Every example from coroutine2/example work fine, but my test code does not. Is empty coroutine prohibited? Project attached, I build it in release/x86 configuration.
CoroTest.zip

from coroutine2.

olk avatar olk commented on August 16, 2024

I'm not familair with MSVC/Windows but I guess your problem is related to incompatible compiler flags used to compile the boost libraries and the settings in you MSVC project.

from coroutine2.

 avatar commented on August 16, 2024

Flags used to compile boost do not affect my issue. Problem goes away if I turn off global program optimization (/GL) or change /EHsc (default, tells the compiler to assume that functions declared as extern "C" never throw a C++ exception) to /EHs (tells the compiler to assume that functions declared as extern "C" may throw an exception). Does boost throw exceptions from extern "C" functions?

from coroutine2.

olk avatar olk commented on August 16, 2024

yes, an exception might be thrown by ontop_fcontext() (declared as extern 'C') is used in the dtor if stack was not destructed.
I'll add a hint to the documentation

from coroutine2.

 avatar commented on August 16, 2024

Ok, thank you for help!

from coroutine2.

olk avatar olk commented on August 16, 2024

thank you too

from coroutine2.

devshgraphicsprogramming avatar devshgraphicsprogramming commented on August 16, 2024

@olk any chance of using coroutine2/context with global program optimization under MSVC?

from coroutine2.

olk avatar olk commented on August 16, 2024

@devshgraphicsprogramming : I don't know - becaue I don't use Windows

from coroutine2.

devshgraphicsprogramming avatar devshgraphicsprogramming commented on August 16, 2024

is there a particular reason \GL must be disabled?

from coroutine2.

 avatar commented on August 16, 2024

Actually, /EHs should be enough.

from coroutine2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.