[Boost-bugs] [Boost C++ Libraries] #11357: bug for coroutines with segmented stack

Subject: [Boost-bugs] [Boost C++ Libraries] #11357: bug for coroutines with segmented stack
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-05-28 14:58:44

#11357: bug for coroutines with segmented stack
 Reporter: wilhelm.lee <wilhelm.lee@…> | Owner: olli
     Type: Bugs | Status: new
Milestone: Boost 1.58.0 | Component: coroutine
  Version: Boost 1.58.0 | Severity: Problem
 Keywords: coroutines segmented stack |
 when I test asymmetric coroutines with segmented stack with boost
 /example/cpp03/asymmetric/segmented_stack.cpp , but test failed for
 segment fault .

 boost 1.58 , build with toolset=gcc segmented-stacks=on
 gcc version 4.8.1 , -fsplit-stack

 the bug description :
 in asymmetric_coroutine.hpp:
 boost use tow stack_context object(stack_ctx and internal_stack_ctx),but
 only stack_ctx.segments_ctx saved information(split stacks chain and
 boundary..) filled by __splitstack_makecontext() , and
 coroutine_context::jump() use internal_stack_ctx , when call
 __splitstack_setcontext( other.stack_ctx_.segments_ctx) ,
 other.stack_ctx_.segments_ctx is empty !

 and push_coroutine_object/pull_coroutine_object::deallocate_(obj_t * obj)
 use stack_ctx not internal_stack_ctx

 I try to modify source with :
   all "stack_context internal_stack_ctx;" => "stack_context
   all :
   static void deallocate_( obj_t * obj){
     stack_context stack_ctx( obj->stack_ctx_);
 + memcpy(
 + # endif
     StackAllocator stack_alloc( obj->stack_alloc_);
 and test passed . but this modification seems not the best. to combine
 stack_ctx and internal_stack_ctx to a single object seems better !

Ticket URL: <https://svn.boost.org/trac/boost/ticket/11357>
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-02-16 18:50:18 UTC