public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/62305] New: throw segfaults on 64bit Cygwin
@ 2014-08-29 12:36 dominik.strasser@onespin-solutions.com
  2014-10-28  8:50 ` [Bug c++/62305] " dominik.strasser@onespin-solutions.com
  0 siblings, 1 reply; 2+ messages in thread
From: dominik.strasser@onespin-solutions.com @ 2014-08-29 12:36 UTC (permalink / raw)
  To: gcc-bugs

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<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 ?


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/62305] throw segfaults on 64bit Cygwin
  2014-08-29 12:36 [Bug c++/62305] New: throw segfaults on 64bit Cygwin dominik.strasser@onespin-solutions.com
@ 2014-10-28  8:50 ` dominik.strasser@onespin-solutions.com
  0 siblings, 0 replies; 2+ messages in thread
From: dominik.strasser@onespin-solutions.com @ 2014-10-28  8:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62305

dominik.strasser@onespin-solutions.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from dominik.strasser@onespin-solutions.com ---
Problem has disappeared both due to code changes and cygwin/mingw updates.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-10-28  8:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-29 12:36 [Bug c++/62305] New: throw segfaults on 64bit Cygwin dominik.strasser@onespin-solutions.com
2014-10-28  8:50 ` [Bug c++/62305] " dominik.strasser@onespin-solutions.com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).