error: tried to pass an SEH exception through a spawn

error: tried to pass an SEH exception through a spawn

Hi All,

Sometimes when running our cilk code one of my coworkers gets the title message and a crash:

error: tried to pass an SEH exception through a spawn

Can anyone suggest what might cause this or how to track it down? I've been assuming its a race condition, but per my other forum post I haven't had any success using cilkscreen.

We compile with /EHsc, not /EHa (or __try, __except, __finally - as mentioned by the cilk plus docs)

I haven't (yet) seen this on my Core 2 Duo system, but maybe thats because he has hyperthreading & I don't.

Daniel Faken

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

This is saying that the exception handler that is used for Cilk functions is seeing an exception other than a C++ exception, which is illegal since we have no idea how to handle it.

If you can reproduce the problem, you can set the Visual Studio debugger to break when an exception is thrown which will allow you to determine what's happening. If I had to guess, I'd say that there's an access violation occurring that's propagating up.

What you might try is adding a catchall handler to your spawned function to at least report on any non-C++ exceptions.

I'll look at modifying the code to at least tell you what the exception ins.

- Barry


OK, thank you for the explanation. We can't reliably reproduce it though, alas.


Hi Daniel,

I've seen this come up a couple times due to issues with the optimizer. Has your coworker ever seen it with a /Od or -O0 build?

Brandon Hewitt
Technical Consulting Engineer

For 1:1 technical support:

Software Product Support info:

Leave a Comment

Please sign in to add a comment. Not a member? Join today