From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14542 invoked by alias); 6 Dec 2002 17:13:00 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 14488 invoked by uid 61); 6 Dec 2002 17:12:59 -0000 Date: Fri, 06 Dec 2002 09:13:00 -0000 Message-ID: <20021206171259.14485.qmail@sources.redhat.com> To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, hans.utz@informatik.uni-ulm.de, nobody@gcc.gnu.org From: bangerth@dealii.org Reply-To: bangerth@dealii.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, hans.utz@informatik.uni-ulm.de, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: c++/8847: dynamic_cast segfaults with shared lib X-SW-Source: 2002-12/txt/msg00372.txt.bz2 List-Id: Synopsis: dynamic_cast segfaults with shared lib State-Changed-From-To: open->feedback State-Changed-By: bangerth State-Changed-When: Fri Dec 6 09:12:57 2002 State-Changed-Why: I can confirm the problem with a slightly smaller program: ------------------------------ struct Foo { virtual ~Foo(){}; }; struct myBar : public Foo { virtual ~myBar(){}; }; int main(int, char **) { dynamic_cast((Foo*)new myBar()); return 0; } ---------------------------------- Linking with libGLU alone suffices to crash the program. However: on my system, which is very much like yours, libGLU and libGL are located in /usr/lib, i.e. are system libraries and are thus probably compiled with gcc 2.95. In contrast to libGL, libGLU has C++ symbols in it, so I am pretty sure that the problem stems from the ABI incompatibilities between the 2.95 C++ compiler and the 3.2 C++ compiler. This has to be expected. Linking C++ libraries together that have not been created with the same compiler asks for trouble (or at least did, prior to the standard gcc is trying to follow since 3.2). Can you report what happens if you try to use a libGLU that is compiled with the same compiler as the one you use for the rest of the project, i.e. 3.2.1? Thanks Wolfgang http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8847