g++ serious bug in Ubuntu Lucid Lynx

Ian Lance Taylor iant@google.com
Thu Jun 3 00:13:00 GMT 2010


"David R. Doucette" <ddoucette@kldcompanies.com> writes:

> We just installed Lucid Lynx a few days ago, and have hit a fatal flaw
> with g++ that has forced us to stop the deployment and roll back the
> systems we could.
>
> Structures in Lucid are now mapping differently than in the past, so
> we can no longer read our own files! Further, if any files are written
> by code produced by the new g++, they are corrupted.
>
> The problem is that doubles are now being mapped onto a boundary
> divisible by 8 rather than a boundary divisible by 4, meaning that
> offsets change and structs get bigger.
>
> I've attached a tar file showing the mapping on Jaunty, Karmic, and
> Lucid to show the change. This is a greatly simplified program that
> shows the problem, but it's happening in all of our C++ programs.

What are the old and new versions of gcc?  Did you build gcc yourself?
How were the versions of gcc configured?

You didn't say what processor you are using, but I assume it is x86.
Normally on 64-bit x86 doubles are always aligned on an 8-byte
boundary.  On 32-bit x86 they are normally aligned on a 4-byte
boundary, though this can be changed with the -malign-double option.

gcc works pretty hard to keep the same ABI across releases, so I
suspect that something else must have changed.

Ian



More information about the Gcc-help mailing list