sparc64/119289: C++ throw/catch segfaults

Stephen Hurd shurd at sasktel.net
Wed Jan 2 19:40:01 PST 2008


>Number:         119289
>Category:       sparc64
>Synopsis:       C++ throw/catch segfaults
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-sparc64
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 03 03:40:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Stephen Hurd
>Release:        7.0-RC1
>Organization:
>Environment:
FreeBSD vorpal.hurd.local 7.0-RC1 FreeBSD 7.0-RC1 #0: Sun Dec 30 15:59:13 CST 2007     root at vorpal.bbsdev.local:/usr/obj/usr/src/sys/VORPAL  sparc64

>Description:
Even the most simple trow/catch programs appear to crash in the __cxa_* functions.  this appears to be at least part of the problem with OpenEXR.
>How-To-Repeat:
The following simple program crashes with the following backtrace:

(gdb) r
Starting program: /home/admin/a.out 
start
Inside try block
Caught an exception -- value is: 99

Program received signal SIGSEGV, Segmentation fault.
0x0000000040396aac in __cxa_end_catch () from /usr/lib/libstdc++.so.6
(gdb) bt
#0  0x0000000040396aac in __cxa_end_catch () from /usr/lib/libstdc++.so.6
#1  0x0000000000100f38 in main () at test.cpp:13


// A simple exception handling example.
#include <iostream>
int main()
{
  std::cout << "start\n";
try
{   // start a try block
    std::cout << "Inside try block\n";
    throw 99; // throw an error
    std::cout << "This will not execute";
  }

catch (int i)
 {   // catch an error
    std::cout << "Caught an exception -- value is: ";
    std::cout << i << "\n";
  }

  std::cout << "end";

  return 0;
}

>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-sparc64 mailing list