https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62305
Bug ID: 62305 Summary: throw segfaults on 64bit Cygwin Product: gcc Version: 4.8.2 Status: UNCONFIRMED Severity: critical Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: dominik.stras...@onespin-solutions.com The symptoms of this problems are quite similar to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56747, however it is no *always* cured by compiling with -O1. I tried compiling various source files I have with -O0, then the problem vanished, but later reappeared on a different exception path. Another thing I tried was to put the function below into a separate file and trying with optimization options which did not succeed. Is the problem maybe located not in the catching function but in the cleanup regions of a the stack between the throw and the catch ? Host triple: x86_64-w64-mingw32-g++ The function catching the exception looks like this: pair<unsigned,unsigned> ExpRef::getConstRange(CompEnv& rCompEnv,const NetReg& crNetReg) const { CompEnv::BoolVarToggler noSideEffects(rCompEnv.deactivateSideEffects()); unsigned uiWidth = 0; try { uiWidth = crNetReg.width(rCompEnv); if (!usePreciseConstRange) { return pair<unsigned,unsigned>(uiWidth-1,0); } Sel::LLRes llIndex = checkRange(rCompEnv); if (!llIndex.isEmpty() && !llIndex.isPartiallyEmpty() && llIndex.isConstant()) { assert(llIndex.left() >= llIndex.right()); assert(llIndex.right() >= 0); assert(llIndex.llLeft() >= llIndex.llRight()); // width might be 0 in error case ... assert(llIndex.llLeft()+1 <= uiWidth); return pair<unsigned,unsigned>(llIndex.llLeft(),llIndex.llRight()); } } catch(...) { // do nothing } return pair<unsigned,unsigned>(uiWidth-1,0); } The crash looks like this: gdb: unknown target exception 0x20474343 at 0x7fefcc8940d Program received signal ?, Unknown signal. [Switching to Thread 4920.0x1124] 0x000007fefcc8940d in RaiseException () from C:\Windows\system32\KernelBase.dll (gdb) where #0 0x000007fefcc8940d in RaiseException () from C:\Windows\system32\KernelBase.dll #1 0x000000006144cd4d in libgcc_s_seh-1!_Unwind_RaiseException () from C:\cygwin64\home\cve\distributions\unreleased_distributions\Distr\latest\onespin360\onespin\bin\cygwin64\libgcc_s_seh-1.dll #2 0x000000006fcb76c8 in libstdc++-6!.cxa_throw () from C:\cygwin64\home\cve\distributions\unreleased_distributions\Distr\latest\onespin360\onespin\bin\cygwin64\libstdc++-6.dll Stackframe #3 is the throw location. I know that this is not very much I have here for diagnosis, so it is morea call for help on debugging this crash. Is there a way to find out which function is currently unwound ?