Sorry, but I know very little about the inner details of exception handling. I can only suggest you try to replace setjmp(buf) with _setjmp(buf, NULL).
On 02.10.2015 00:28, Kevin Ushey wrote: > Hi Thomas, > > Is it possible that the value of the second argument depends on whether SJLJ > or SEH handling is used? > > FWIW, we (a team trying to prepare a MinGW toolchain for R) were bumping into > longjmp crashes using > a 64bit version of the toolchain with SJLJ exceptions; however, we don't > encounter such crashes > when using an SEH version of the toolchain. > > It would be excellent to have a minimal, reproducible example that exercises > the longjmp crash -- > while I was able to get a reproducible example, it was not quite minimal. > However, the 'parameters' > that lead to a crash on longjmp in C++ code seemed to be: > > 1) Having 'stuff' on the stack, > 2) Calling a C++ function that throws an exception, > 3) Catching said exception, > 4) Attempting to longjmp after catching said exception. > > Of course, one should not normally mix SJLJ with C++ exceptions. However, in > our case, we have C++ > code that interfaces with a C library (the R runtime); the goal is to ensure > that C library can > safely longjmp (ie, it's done at the top level, with no C++ destructors on > the stack). > > It sounds like you had a reproducible case when using only C code; is that > correct? Yes my code always crashed ever since I switched from 32-bit to 64-bit. Thomas ------------------------------------------------------------------------------ _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
