opencilk-project
opencilk-project copied to clipboard
Out of order exceptions might call std::terminate
trafficstars
(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.