Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#13064 closed Bugs (fixed)

Different behavior coroutine and coroutine2

Reported by: big.black.fox@… Owned by: olli
Milestone: To Be Determined Component: coroutine
Version: Boost 1.64.0 Severity: Problem
Keywords: coroutine coroutine2 Cc:

Description

I noticed different behavior in Coroutine and Coroutine2. There is a source file in attachment. Code creates void asymmetric coroutine and calls it once. Coroutine returns execution to an invoker, then coroutine destructor calls. At this moment coroutine unwind stack. After I switch to Coroutine2 behavior changed: after coroutine destructor calls it returns execution to coroutine ("coro call 2" in the log) and then unwind stack.

Test app log output with Coroutine:
main: before coro call...
TestRAII::ctor
coro call 1
main: after coro call...
TestRAII::dtor
main: after coro delete...

Test app log output with Coroutine2:
main: before coro call...
TestRAII::ctor
coro call 1
main: after coro call...
coro call 2
TestRAII::dtor
main: after coro delete...

Not sure but i think "coro call 2" must not be appeared.

Build with GCC 7.1.0:

g++ -c -pipe -g -std=gnu++1z -Wall -W -fPIC -I../../../../boost_1_64_0 -o main.o ./main.cpp

g++ -o ./main main.o -L./ -lboost_coroutine -lboost_system -lboost_context -lboost_thread

Attachments (2)

main_coro.cpp (932 bytes ) - added by anonymous 5 years ago.
coroutine version
main_coro2.cpp (933 bytes ) - added by anonymous 5 years ago.
coroutine2 version

Download all attachments as: .zip

Change History (4)

by anonymous, 5 years ago

Attachment: main_coro.cpp added

coroutine version

by anonymous, 5 years ago

Attachment: main_coro2.cpp added

coroutine2 version

comment:1 by olli, 5 years ago

Resolution: fixed
Status: newclosed

comment:2 by olli, 5 years ago

ty

Note: See TracTickets for help on using tickets.