public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: snyder@fnal.gov To: gcc-gnats@gcc.gnu.org Subject: c++/3006: bad code for complicated virtual inheritance (regression from 2.95) Date: Wed, 30 May 2001 13:36:00 -0000 [thread overview] Message-ID: <200105302022.f4UKMWX04545@karma.fnal.gov> (raw) >Number: 3006 >Category: c++ >Synopsis: bad code for complicated virtual inheritance (regression from 2.95) >Confidential: no >Severity: critical >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Wed May 30 13:36:02 PDT 2001 >Closed-Date: >Last-Modified: >Originator: scott snyder >Release: 3.0 20010529 (prerelease) >Organization: >Environment: System: Linux karma 2.2.16-22 #1 Tue Aug 22 16:49:06 EDT 2000 i686 unknown Architecture: i686 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: ../egcs/configure --prefix=/usr/local/egcs --enable-threads=posix --enable-long-long >Description: When the program below is compiled with gcc 3, it crashes with a SEGV when run. When compiled with gcc 2.95, it executes normally. >How-To-Repeat: ----------------------------------------------------- struct CORBA_Object { virtual ~CORBA_Object() {} }; class CORBA_Object_skel : public virtual CORBA_Object {}; class CORBA_IRObject_skel : virtual public CORBA_Object_skel {}; class CORBA_Container_skel : virtual public CORBA_IRObject_skel {}; class CORBA_IRObject_impl : public virtual CORBA_IRObject_skel {}; class CORBA_Repository_impl : public virtual CORBA_Container_skel, public virtual CORBA_IRObject_impl { }; int main(int argc, char* argv[]) { new CORBA_Repository_impl; return 0; } ----------------------------------------------------- [sss@karma translator]$ g++ -g -o xidl xidl.cpp [sss@karma translator]$ ./xidl Segmentation fault (core dumped) Here's the stack trace where it crashed: #0 0x804990d in _ZN19CORBA_IRObject_implC2Ev (this=0x804b62c, __vtt_parm=0x804ae3c) at xidl.cpp:21 #1 0x80488c8 in _ZN21CORBA_Repository_implC1Ev (__vtt_parm=0x804b628) at xidl.cpp:21 #2 0x80487c1 in main (argc=1, argv=0xbfffd3b4) at xidl.cpp:21 (gdb) x/i $pc 0x804990d <_ZN19CORBA_IRObject_implC2Ev+109>: mov (%edx),%edx (gdb) p/x $edx $1 = 0x10094048 (gdb) x/x 0x10094048 0x10094048: Cannot access memory at address 0x10094048 >Fix: >Release-Note: >Audit-Trail: >Unformatted:
next reply other threads:[~2001-05-30 13:36 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2001-05-30 13:36 snyder [this message] 2001-06-08 6:57 nathan 2001-06-08 7:32 nathan
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=200105302022.f4UKMWX04545@karma.fnal.gov \ --to=snyder@fnal.gov \ --cc=gcc-gnats@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).