From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3505 invoked by alias); 29 Aug 2014 12:36:58 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 3474 invoked by uid 48); 29 Aug 2014 12:36:54 -0000 From: "dominik.strasser@onespin-solutions.com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/62305] New: throw segfaults on 64bit Cygwin Date: Fri, 29 Aug 2014 12:36:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.8.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: dominik.strasser@onespin-solutions.com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-08/txt/msg01978.txt.bz2 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.strasser@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 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(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(llIndex.llLeft(),llIndex.llRight()); } } catch(...) { // do nothing } return pair(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 ?