From markd@osprey.grizzly.com  Wed Apr 30 11:35:50 1997
Received: from who.cdrom.com (who.cdrom.com [204.216.27.3])
          by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id LAA09738
          for <FreeBSD-gnats-submit@FreeBSD.org>; Wed, 30 Apr 1997 11:35:50 -0700 (PDT)
Received: from osprey.grizzly.com (med.sc.scruznet.com [165.227.115.28])
          by who.cdrom.com (8.8.5/8.6.11) with ESMTP id LAA06708
          for <FreeBSD-gnats-submit@freebsd.org>; Wed, 30 Apr 1997 11:21:51 -0700 (PDT)
Received: (from markd@localhost) by osprey.grizzly.com (8.8.5/8.7.3) id LAA08925; Wed, 30 Apr 1997 11:23:46 -0700 (PDT)
Message-Id: <199704301823.LAA08925@osprey.grizzly.com>
Date: Wed, 30 Apr 1997 11:23:46 -0700 (PDT)
From: Mark Diekhans <markd@Grizzly.COM>
Reply-To: markd@Grizzly.COM
To: FreeBSD-gnats-submit@FreeBSD.org
Subject: C++ exceptions don't work in shared libraries.
X-Send-Pr-Version: 3.2

>Number:         3441
>Category:       gnu
>Synopsis:       C++ exceptions don't work in shared libraries.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    obrien
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May  1 00:53:48 PDT 1997
>Closed-Date:    Sat Jan 22 08:06:00 PST 2000
>Last-Modified:  Sat Jan 22 08:06:34 PST 2000
>Originator:     Mark Diekhans
>Release:        FreeBSD 2.2.1-RELEASE i386
>Organization:
The Information Refinery
>Environment:

        Nothing special.

>Description:

	Throwing a C++ exception within a shared library causes a segmentation
violation.  If the same code is linked in staticly, it works fine.


>How-To-Repeat:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	Makefile
#	foo.cc
#	main.cc
#
echo x - Makefile
sed 's/^X//' >Makefile << 'END-of-Makefile'
XCXX=g++
XCXXFLAGS=-g -fpic -fhandle-exceptions
X
Xall: arf
X
Xarf: main.o foo.so
X	${CXX} -o arf main.o foo.so
X
X
Xfoo.so: foo.o
X	ld -Bshareable -o foo.so foo.o
X
Xclean:
X	rm -f arf *.o *.so
END-of-Makefile
echo x - foo.cc
sed 's/^X//' >foo.cc << 'END-of-foo.cc'
X#include <stdio.h>
X
Xint Foo ();
X
Xint Baz ()
X{
X    char *msg = "Bax thowing..."; 
X    printf ("in baz\n");
X    throw msg;
X    printf ("baz should not be here.\n");
X}
X
X
Xint Foo ()
X{
X    try {
X        Baz ();
X    } catch (char *msg) {
X        printf ("foo caught %s\n", msg);
X    }
X}
END-of-foo.cc
echo x - main.cc
sed 's/^X//' >main.cc << 'END-of-main.cc'
X#include <stdio.h>
X
Xint Foo ();
X
Xint
Xmain ()
X{
X    try {
X        printf ("calling foo\n");
X        Foo ();
X        printf ("returned from foo\n");
X    } catch (char *msg) {
X        printf ("exception from foo: %s\n", msg);
X    } catch (...) {
X        printf ("unknown exception\n");
X    }
X}
END-of-main.cc
exit



>Fix:
	
        Unknown.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->obrien 
Responsible-Changed-By: obrien 
Responsible-Changed-When: Sat May 1 15:54:46 PDT 1999 
Responsible-Changed-Why:  
I'll try to see what is wrong. 

From: Maxim Sobolev <sobomax@altavista.net>
To: freebsd-gnats-submit@freebsd.org, markd@Grizzly.COM,
	obrien@freebsd.org
Cc:  
Subject: Re: gnu/3441: C++ exceptions don't work in shared libraries.
Date: Tue, 11 Jan 2000 13:14:04 +0200

 As of gcc-2.95.2 this problem is still valid and prevents some software (Mico
 for example) from functioning properly.
 
 -Maxim
 
 
State-Changed-From-To: open->closed 
State-Changed-By: obrien 
State-Changed-When: Sat Jan 22 08:06:00 PST 2000 
State-Changed-Why:  
The GCC Project fixed the code and I imported their fix into our tree. 
>Unformatted:
