Skip to content

Out of order exceptions might call std::terminate #347

@VoxSciurorum

Description

@VoxSciurorum

(This is to officially document a known bug.)

This code with well-defined serial behavior may call std::terminate when run on multiple threads:

int main(int argc, char *argv[])
{
  try {
    cilk_spawn throw 0;
    throw "1";
  } catch (int x) {
    return x;
  }
  return 1;
}

If the second throw executes it will find no handler. In serial execution the first throw always prevents the second from executing.

The search for a handler can not definitively say "no handler" until all logically earlier code paths have suspended.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions