sparc64/119289: C++ throw/catch segfaults

Stephen Hurd shurd at
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
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 03 03:40:01 UTC 2008
>Originator:     Stephen Hurd
>Release:        7.0-RC1
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

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.
The following simple program crashes with the following backtrace:

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

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

// A simple exception handling example.
#include <iostream>
int main()
  std::cout << "start\n";
{   // 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;



More information about the freebsd-sparc64 mailing list