public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/42159]  New: app compiled with 4.4.2 SIGABRTs after a trivial nested throw/stack unwinding
@ 2009-11-24  1:00 vlad at demoninsight dot com
  2009-11-24  1:25 ` [Bug c++/42159] " howarth at nitro dot med dot uc dot edu
                   ` (21 more replies)
  0 siblings, 22 replies; 23+ messages in thread
From: vlad at demoninsight dot com @ 2009-11-24  1:00 UTC (permalink / raw)
  To: gcc-bugs

A 64 bit build of gcc 4.4.2 installed via darwinports on a Mac Pro server
running Snow Leopard 10.6.2 causes a crash in the following program:

>cat src/test.cpp 

#include <iostream>

struct X
{
        ~X () // crash disappears if there is no destructor
        {
        }
};

void
dummy ()
{
    X x;

    throw 0;
}

int main()
{
        try
        {
            dummy ();
        }
        catch (...)
        {
            std::cout << "CAUGHT" << std::endl;
        }

        return 0;
}

Instead of the expected "CAUGHT" the system pops up with:

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Application Specific Information:
abort() called

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   libSystem.B.dylib                   0x00007fff801a3fe6 __kill + 10
1   libSystem.B.dylib                   0x00007fff80244e32 abort + 83
2   libgcc_s.1.dylib                    0x00000001001a2aa2 uw_init_context_1 +
146
3   libgcc_s.1.dylib                    0x00000001001a2ef8 _Unwind_Resume + 72
4   crash                               0x0000000100000cfe main + 0
5   crash                               0x0000000100000d0a main + 12
6   crash                               0x0000000100000c88 start + 52

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x00007fff5fbff560  rcx: 0x00007fff5fbff288 
rdx: 0x0000000000000000
  rdi: 0x0000000000014c96  rsi: 0x0000000000000006  rbp: 0x00007fff5fbff2a0 
rsp: 0x00007fff5fbff288
   r8: 0x00000001002fc0a0   r9: 0x00000001002fc0a4  r10: 0x00007fff801a0026 
r11: 0x0000000000000206
  r12: 0x00007fff5fbff6a0  r13: 0x0000000100000cfe  r14: 0x00007fff5fbff2b0 
r15: 0x0000000000000000
  rip: 0x00007fff801a3fe6  rfl: 0x0000000000000206  cr2: 0x00000001001a5924

Binary Images:
       0x100000000 -        0x100000ff7 +crash ??? (???)
<1795FC81-D57C-8C65-42CB-984BCE974933> /Users/vlad/PRJ/test/crash
       0x100003000 -        0x1000a9fe7 +libstdc++.6.dylib ??? (???)
<7ED4A235-4CEF-A737-9698-18B1301A9979> /sw/lib/gcc4.4/lib/libstdc++.6.dylib
       0x100195000 -        0x1001a8ff7 +libgcc_s.1.dylib ??? (???)
<A31CA578-6BE8-891F-8F79-680CAAA8DE22> /sw/lib/gcc4.4/lib/libgcc_s.1.dylib
    0x7fff5fc00000 -     0x7fff5fc3bdef  dyld 132.1 (???)
<B633F790-4DDB-53CD-7ACF-2A3682BCEA9F> /usr/lib/dyld
    0x7fff80155000 -     0x7fff80313ff7  libSystem.B.dylib ??? (???)
<526DD3E5-2A8B-4512-ED97-01B832369959> /usr/lib/libSystem.B.dylib
    0x7fff8373b000 -     0x7fff8373fff7  libmathCommon.A.dylib ??? (???)
<95718673-FEEE-B6ED-B127-BCDBDB60D4E5> /usr/lib/system/libmathCommon.A.dylib
    0x7fffffe00000 -     0x7fffffe01fff  libSystem.B.dylib ??? (???)
<526DD3E5-2A8B-4512-ED97-01B832369959> /usr/lib/libSystem.B.dylib

Model: MacPro4,1, BootROM MP41.0081.B04, 8 processors, Quad-Core Intel Xeon,
2.66 GHz, 16 GB, SMC 1.39f5

As long as a local object 'x' with a destructor is created prior to the 'throw'
inside dummy(), the problem occurs.

[18:53:02] test>g++-4 -v -save-temps src/test.cpp -o crash
Using built-in specs.
Target: x86_64-apple-darwin10
Configured with: ../gcc-4.4.2/configure --prefix=/sw --prefix=/sw/lib/gcc4.4
--mandir=/sw/share/man --infodir=/sw/share/info
--enable-languages=c,c++,fortran,objc,java --with-gmp=/sw
--with-libiconv-prefix=/sw --with-ppl=/sw --with-cloog=/sw --with-system-zlib
--x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib
--disable-libjava-multilib --build=x86_64-apple-darwin10
--host=x86_64-apple-darwin10 --target=x86_64-apple-darwin10
Thread model: posix
gcc version 4.4.2 (GCC) 
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.6.2' '-v' '-save-temps' '-o'
'crash' '-shared-libgcc' '-mtune=generic'
 /sw/lib/gcc4.4/libexec/gcc/x86_64-apple-darwin10/4.4.2/cc1plus -E -quiet -v
-D__DYNAMIC__ src/test.cpp -fPIC -mmacosx-version-min=10.6.2 -mtune=generic
-fpch-preprocess -o test.ii
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory
"/sw/lib/gcc4.4/lib/gcc/x86_64-apple-darwin10/4.4.2/../../../../x86_64-apple-darwin10/include"
#include "..." search starts here:
#include <...> search starts here:

/sw/lib/gcc4.4/lib/gcc/x86_64-apple-darwin10/4.4.2/../../../../include/c++/4.4.2

/sw/lib/gcc4.4/lib/gcc/x86_64-apple-darwin10/4.4.2/../../../../include/c++/4.4.2/x86_64-apple-darwin10

/sw/lib/gcc4.4/lib/gcc/x86_64-apple-darwin10/4.4.2/../../../../include/c++/4.4.2/backward
 /sw/lib/gcc4.4/include
 /sw/lib/gcc4.4/lib/gcc/x86_64-apple-darwin10/4.4.2/include
 /sw/lib/gcc4.4/lib/gcc/x86_64-apple-darwin10/4.4.2/include-fixed
 /usr/include
 /System/Library/Frameworks
 /Library/Frameworks
End of search list.
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.6.2' '-v' '-save-temps' '-o'
'crash' '-shared-libgcc' '-mtune=generic'
 /sw/lib/gcc4.4/libexec/gcc/x86_64-apple-darwin10/4.4.2/cc1plus -fpreprocessed
test.ii -fPIC -quiet -dumpbase test.cpp -mmacosx-version-min=10.6.2
-mtune=generic -auxbase test -version -o test.s
GNU C++ (GCC) version 4.4.2 (x86_64-apple-darwin10)
        compiled by GNU C version 4.4.2, GMP version 4.3.1, MPFR version 2.4.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: e5506cfd76732233066589d06543f3ba
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.6.2' '-v' '-save-temps' '-o'
'crash' '-shared-libgcc' '-mtune=generic'
 as -arch x86_64 -force_cpusubtype_ALL -o test.o test.s
COMPILER_PATH=/sw/lib/gcc4.4/libexec/gcc/x86_64-apple-darwin10/4.4.2/:/sw/lib/gcc4.4/libexec/gcc/x86_64-apple-darwin10/4.4.2/:/sw/lib/gcc4.4/libexec/gcc/x86_64-apple-darwin10/:/sw/lib/gcc4.4/lib/gcc/x86_64-apple-darwin10/4.4.2/:/sw/lib/gcc4.4/lib/gcc/x86_64-apple-darwin10/
LIBRARY_PATH=/sw/lib/gcc4.4/lib/gcc/x86_64-apple-darwin10/4.4.2/:/sw/lib/gcc4.4/lib/gcc/x86_64-apple-darwin10/4.4.2/../../../:/usr/lib/
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.6.2' '-v' '-save-temps' '-o'
'crash' '-shared-libgcc' '-mtune=generic'
 /sw/lib/gcc4.4/libexec/gcc/x86_64-apple-darwin10/4.4.2/collect2 -dynamic -arch
x86_64 -macosx_version_min 10.6.2 -weak_reference_mismatches non-weak -o crash
-lcrt1.10.5.o -L/sw/lib/gcc4.4/lib/gcc/x86_64-apple-darwin10/4.4.2
-L/sw/lib/gcc4.4/lib/gcc/x86_64-apple-darwin10/4.4.2/../../.. test.o -lstdc++
-lgcc_s.10.5 -lgcc -lSystem
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.6.2' '-v' '-save-temps' '-o'
'crash' '-shared-libgcc' '-mtune=generic'

>./crash


-- 
           Summary: app compiled with 4.4.2 SIGABRTs after a trivial nested
                    throw/stack unwinding
           Product: gcc
           Version: 4.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: vlad at demoninsight dot com
 GCC build triplet: x86_64-apple-darwin10
  GCC host triplet: x86_64-apple-darwin10
GCC target triplet: x86_64-apple-darwin10


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42159


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

end of thread, other threads:[~2010-07-15 17:03 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-24  1:00 [Bug c++/42159] New: app compiled with 4.4.2 SIGABRTs after a trivial nested throw/stack unwinding vlad at demoninsight dot com
2009-11-24  1:25 ` [Bug c++/42159] " howarth at nitro dot med dot uc dot edu
2009-11-24  1:37 ` vlad at demoninsight dot com
2009-11-24 15:49 ` vlad at demoninsight dot com
2009-11-25 15:59 ` aufpasser at gmail dot com
2009-11-25 17:16 ` vlad at demoninsight dot com
2009-11-25 17:28 ` howarth at nitro dot med dot uc dot edu
2009-11-25 17:29 ` howarth at nitro dot med dot uc dot edu
2009-11-28  6:42 ` [Bug target/42159] " vlad at demoninsight dot com
2009-11-29 16:04 ` vlad at demoninsight dot com
2009-11-30 15:19 ` vlad at demoninsight dot com
2009-11-30 15:27 ` rguenth at gcc dot gnu dot org
2009-11-30 16:07 ` vlad at demoninsight dot com
2009-11-30 16:47 ` redi at gcc dot gnu dot org
2009-12-01  5:50 ` vlad at demoninsight dot com
2009-12-31 17:42 ` [Bug target/42159] [4.4 only] " simon at pushface dot org
2010-05-18 10:29 ` [Bug target/42159] [4.4/4.5/4.6] app " fxcoudert at gcc dot gnu dot org
2010-05-19 22:06 ` simon at pushface dot org
2010-06-06 19:33 ` michael at jarvis dot net
2010-07-15 16:58 ` pinskia at gcc dot gnu dot org
2010-07-15 16:59 ` pinskia at gcc dot gnu dot org
2010-07-15 16:59 ` pinskia at gcc dot gnu dot org
2010-07-15 17:03 ` redi at gcc dot gnu dot org

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).