From mboxrd@z Thu Jan 1 00:00:00 1970 From: topiolli@ee.oulu.fi To: gcc-gnats@gcc.gnu.org Subject: c++/4381: Exceptions virtually inherited from a class cause segmentation fault at run time Date: Mon, 24 Sep 2001 02:46:00 -0000 Message-id: <20010924094453.25922.qmail@sourceware.cygnus.com> X-SW-Source: 2001-09/msg00468.html List-Id: >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