This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/4381: Exceptions virtually inherited from a class cause segmentation fault at run time
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/4381: Exceptions virtually inherited from a class cause segmentation fault at run time
- From: topiolli at ee dot oulu dot fi
- Date: 24 Sep 2001 09:44:53 -0000
- Reply-To: topiolli at ee dot oulu dot fi
>Number: 4381
>Category: c++
>Synopsis: Exceptions virtually inherited from a class cause segmentation fault at run time
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Sep 24 02:46:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: topiolli@ee.oulu.fi
>Release: g++ 3.0.1
>Organization:
>Environment:
SunOS 5.8 Generic_108528-09 sun4u sparc SUNW,Ultra-80
Reading specs from /local/bin/../lib/gcc-lib/sparc-sun-solaris2.8/3.0.1/specs
Configured with: ../configure --with-cpu=ultrasparc
Thread model: posix
gcc version 3.0.1
>Description:
If an exception is virtually inherited from a base class, it
causes a segmentation fault when thrown at run time. The
problem occurs only when a throw clause is specified in
a function description. The exception that is specified
first in the clause will work fine, the rest not.
There are also some other problems with virtually inherited
exceptions, but I haven't been able to track them down this
far. One of them occurs with long try blocks. I get an error
message from the assembler which says "constant value out
of range".
>How-To-Repeat:
Compile the attached program with g++ -o test Test3.cc and
run it. It should cause a segmentation fault.
>Fix:
N/A
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="Test3.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="Test3.cc"
I2luY2x1ZGUgPHN0cmluZz4KI2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0
ZDsKCmNsYXNzIEJhc2Uge307CgpjbGFzcyBBIDogdmlydHVhbCBwdWJsaWMgQmFzZQp7CnB1Ymxp
YzoKCUEoaW50IGZvbykge30KfTsKCmNsYXNzIEIgOiB2aXJ0dWFsIHB1YmxpYyBCYXNlCnsKcHVi
bGljOgoJQihpbnQgZm9vKSB7fQp9OwoKCnZvaWQgZnVuYygpIHRocm93IChCJixBJikgLy9yZW1v
dmUgdGhyb3cgY2xhdXNlIGFuZCBpdCB3aWxsIHdvcmsKewoJdGhyb3cgQSgxKTsgLy9jYXVzZXMg
YSBzZWdtZW50YXRpb24gZmF1bHQKCS8vdGhyb3cgQigxKTsgLy93b3JrcwoJLy9Cb3RoIHdvcmsg
aWYgdGhleSBhcmUgbm90IF92aXJ0dWFsbHlfIGluaGVyaXRlZCBmcm9tIEJhc2UKfQoKaW50IG1h
aW4odm9pZCkKewoJdHJ5CXsJZnVuYygpOyB9CgljYXRjaCAoQSYgYSkgeyBjZXJyIDw8ICJBIiA8
PCBlbmRsOyB9CgljYXRjaCAoQiYgYSkgeyBjZXJyIDw8ICJCIiA8PCBlbmRsOyB9Cn0K