g++ serious bug in Ubuntu Lucid Lynx

David R. Doucette ddoucette@kldcompanies.com
Thu Jun 3 19:36:00 GMT 2010


Thank you for the response. I've attached everything that will show the
problem. This was compiled under g++. The test case I made is a very greatly
reduced version of one of the programs we wrote, so reduced that it's
actually C rather than C++ code. I tried to compile it under gcc and got an
error about "personality", so I stayed with g++ because that compiled the

Both gcc and g++ came straight from the Ubuntu distribution. Initially I
downloaded the g++ compiler using Synaptic Program Manager, and we've been
updating it using the System Update utility Ubuntu has. Everything was fine
until we did the system upgrade (using System Update) to Version 10.4 AKA
Lucid Lynx which upgraded the compiler as well. I used Synaptic to remove
g++ and then used Synaptic to reinstall it with the same results.

The system used to generate the reports in the tar file was Ubuntu 10.4
Lucid Lynx 64 bit edition running on a dual core i7 chip. I'm pretty sure
that the preceding release, 9.10 Karmic Koala was also a 64 bit release for
the upgrade, or it wouldn't have chosen a 64 bit update.

If downgrading to a 32 edition would solve the problem, we could probably do
that. Also, we've always run a vanilla g++ command from the command line and
some shell scripts, but using the -mnoalign-double option that somebody else
just told me about would be an option. After we get running again, then we
could take a look at writing a conversion program and recompiling everything
to get the doubleword mapping.

-----Original Message-----
From: Ian Lance Taylor [mailto:iant@google.com] 
Sent: Wednesday, June 02, 2010 8:13 PM
To: David R. Doucette
Cc: gcc-help@gnu.org
Subject: Re: g++ serious bug in Ubuntu Lucid Lynx

"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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug.tar
Type: application/x-tar
Size: 153519 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20100603/42eeb49a/attachment.tar>

More information about the Gcc-help mailing list