   Crash on Exception stack unwinding (C++)
  Currently I've got a mutli threaded application that uses lua in multiple threads. For each thread a sparate lua state is created and used. I've compiled lua as a c++ libary so it uses exceptions instead of longjmp/setjmp.The problem now is, that if there is a syntax error or any other error in lua the application crashes on stack unwinding inside the lua.dll, but only when two or more threads are used. If the application does only use one thread it runs perfectly.Now I've got absolutly no clue what could cause the stack unwinding to fail. For what possible causes should I search?   
  Bear in mind that every thread has a stack and thus it's own exception chain. Maybe this will help: lua and thread safety. 