The problem here is most likely due to Visual C++ using SEH to implement C++ exceptions. SEH uses a linked list of function pointers on the stack to process exceptions. SEH requires this linked list be on the stack, and will kill the process if it encounters one that is not. SEH is also used for normally fatal program errors (divide by zero, null pointer dereference, invalid instruction, etc) no matter what compiler is used, so even MinGW or any other C++ compiler will need this change for everything to work as it should.

The solution is actually pretty simple - push the current SEH list's head onto the stack before the context switch, and restore it when resuming execution, with each context initializing its own list with UnhandledExceptionFilter during either construction or first run (like a new thread would). But maybe such a fix is out of scope for the context library?l