I have a situation that developed trying to port a valid OpenMP application to Intel Cilk Plus (this is my first time using Cilk Plus).
I was getting the fatal error at runtime: "error: tried to pass SEH exception c0000005 through a spawn", sometimes two of them in a row.
I found that while I had Cilk For and Syncs implemented my queries for cpu counts and thread numbers were still OpenMP.
With OpenMP Support=Generate Parallel Code (/Qopenmp) set, if I (inappropriately) simply trade out the corresponding Cilk calls for OpenMP I can induce this error. I suspect it's actually just the omp_get_thread_num() since that actually occurred in the worker. Of course if OpenMP support is disabled, the OpenMP calls are undefined and the problem goes away entirely.
#define CPU_COUNT omp_get_num_procs();
#define CPU_THREAD_NUM omp_get_thread_num()
#define CPU_COUNT __cilkrts_get_nworkers()
#define CPU_THREAD_NUM __cilkrts_get_worker_number()
Interestingly, I'm not seeing an exact equivalent to omp_get_num_procs() for Cilk. __cilkrts_get_nworkers() seems to be equivalent enough for me on the first call (avoiding hooking in unnecessary Windows calls here).