Skip to content

which detail::forced_unwind should user code propagate: boost::coroutines2 or boost::context? #23

@bezkrovatki

Description

@bezkrovatki

Hello,

the documentation says:

Code executed by coroutine-function must not prevent the propagation of the detail::forced_unwind exception

... and the subsequent example propagates boost::coroutines2::detail::forced_unwind.

However, simple grep over boost/coroutine2 sources shows boost::coroutines2::detail::forced_unwind is not referenced anywhere except the place it was declared.
Pull/push coroutines implementation catches and re-throws the boost::context::detail::forced_unwind instead.

So which exception a user code should propagate?

Background
I've patched boost.asio to use boost.coroutine2 for our product in order to allow our code to be instrumented with ASan. Both the code and ASan instrumentation seem to work after the migration however one of our unit tests fails. It explicitly throws boost::coroutines2::detail::forced_unwind from the coroutine to check whether the exception is propagated correctly by our code and expects the coroutine collapses. This worked perfectly with boost.coroutine (v1), but crashes with unhandled exception for boost.coroutine2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions