Modify

Opened 12 months ago

Closed 12 months ago

Last modified 12 months 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 12 months ago.
coroutine version
main_coro2.cpp (933 bytes) - added by anonymous 12 months ago.
coroutine2 version

Download all attachments as: .zip

Change History (4)

Changed 12 months ago by anonymous

Attachment: main_coro.cpp added

coroutine version

Changed 12 months ago by anonymous

Attachment: main_coro2.cpp added

coroutine2 version

comment:1 Changed 12 months ago by olli

Resolution: fixed
Status: newclosed

comment:2 Changed 12 months ago by olli

ty

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain olli.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.