Comments (13)
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.
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.
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.
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.
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.
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.
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.
Ok, thank you for help!
from coroutine2.
thank you too
from coroutine2.
@olk any chance of using coroutine2/context with global program optimization under MSVC?
from coroutine2.
@devshgraphicsprogramming : I don't know - becaue I don't use Windows
from coroutine2.
is there a particular reason \GL
must be disabled?
from coroutine2.
Actually, /EHs should be enough.
from coroutine2.
Related Issues (20)
- Boost failed to compile test in coroutine2 lib due to the error C2039 HOT 1
- Undefined behaviour documentation HOT 2
- which detail::forced_unwind should user code propagate: boost::coroutines2 or boost::context? HOT 1
- forced_unwind exception thrown on destroy where no unwind is needed HOT 6
- apply() ambiguity compilation error with C++17 HOT 8
- abi::__forced_unwind is not respected
- test_coroutine_native run where they are not supported HOT 2
- emscripten support? HOT 1
- std::begin and std::end are not overloaded for coroutine<>::pull_type HOT 1
- ASAN Compatibility HOT 2
- Creating a coroutine2 in catch statement results in abort() if an exception is raised. HOT 5
- Crash on cygwin x64 HOT 4
- Refactor the API (possibly adding overhead) to fix a corner case
- Boost\libs\coroutine2 failed to build due to error C2668 on MSVC. HOT 1
- How coroutine2 communicates between coroutines HOT 7
- ambiguous call to begin end for coroutine<>::pull_type breaks range-based for (C++17 mode)
- C++20 not supported HOT 5
- Same executable behaves differently (exception handling) being run with Wine and in native Windows HOT 1
- unable to create not-a-coroutine HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coroutine2.