[lug] Something tweaked in RH 7.1 g++?

Scott A. Herod herod at interact-tv.com
Thu Sep 20 08:14:24 MDT 2001


Hi Keith,

  I can't comment on Dan's response.  However, I have had problems
running code that was compiled with gcc 2.96 that was also linked with
code compiled with 2.95 or 2.91.  I've not dug for details but most
often have problems when trying to do dynamic_casts of classes that
contain STL data types.  The typical error is a segfault somewhere deep
in the dynamic_cast code.  It works when I restrict to one compiler. The
problem can still occur even when everything is compilied -g -O.

  I only understand the details of how the compiler works enough to make
dangerous speculations but since I believe that the vtable layout
changed between 2.91 and 2.96, I wonder how how a dynamic_cast can work
at all.

  Anyway, a thing to check is what you are linking against.  Can you
reproduce the problem in a simple example that does not link against
external libs other than the gcc standard ones?

Scott

"Keith C. Herold" wrote:
> 
> I have a curious problem.  I know that 7.1 shipped with an "experimental"
> version of the gcc, but what problems exist beyond just trying to compile
> the kernel?  I ask because I am having a tremendous amount of trouble
> compiling simple code, that seems to work correctly.  I have also had
> trouble compiling code that is supposedly tested against 7.1 (no missing
> libraries, either).
> 
> For example, I am trying to retrieve an Entry from a class called Dataset.
> The copy and assignment constructors for Entry are implemented correctly
> (according to my testing :) ), and Dataset stores them in a list.  When I
> try to retrieve one item from the list using a list iterator in one
> particular function, it segfaults.  Every other function seems to operate
> correctly, and the various lists are populated with valid data.
> 
> Is there something about the 7.1 gcc that you folks know of that causes this
> problem?  I have looked on the gnu web site, but nothing jumps out.
> 
> --Keith



More information about the LUG mailing list