Bug 38591 - [4.3 regression] erratic comparison failures on very fast machines
Summary: [4.3 regression] erratic comparison failures on very fast machines
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.3.3
: P3 normal
Target Milestone: 4.3.5
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-21 10:13 UTC by Eric Botcazou
Modified: 2010-05-14 12:51 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-09-06 21:18:42


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Botcazou 2008-12-21 10:13:22 UTC
Since we started building the 4.3.x compiler on very fast Linux machines (bi-
quad cores) we have observed erratic but consistent comparison failures, say
a handful of times a month.  The problematic file is always the same:

Comparing stages 2 and 3
Bootstrap comparison failure!
./sparseset.o differs
make[2]: *** [compare] Error 1

The stage 3 object file is not compiled as it should be; in fact, it can be
obtained manually by changing

#define ENABLE_ASSERT_CHECKING 1

to

/* #undef ENABLE_ASSERT_CHECKING */

in gcc/auto-host.h.

so there might be a race condition somewhere in the top-level bootstrap (note
that we have never built 4.2.x on the same machines).
Comment 1 H.J. Lu 2008-12-21 15:20:44 UTC
What are the differences? While working on a patch, I had an
uninitialized stack variable, which caused random comparison
failures.
Comment 2 Eric Botcazou 2008-12-21 16:07:43 UTC
> What are the differences?

This is explained in the message.
Comment 3 H.J. Lu 2008-12-21 16:18:16 UTC
auto-host.h must exist when those files were compiled. I guess
it was generated more than once.
Comment 4 Eric Botcazou 2008-12-21 17:12:33 UTC
> auto-host.h must exist when those files were compiled. I guess
> it was generated more than once.

My understanding is that it is re-generated at each stage:

auto-host.h: cstamp-h ; @true
cstamp-h: config.in config.status
	CONFIG_HEADERS=auto-host.h:config.in \
	CONFIG_FILES= \
	LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status


In case this can make a difference, the compiler is configured as follows:
--enable-languages=c,ada,c++ --disable-libada --enable-checking=release
Comment 5 H.J. Lu 2008-12-21 17:21:39 UTC
Each stage has its own directory and auto-host.h should be
regenerated in each directory. I think it was regenerated
more than once in the same directory.
Comment 6 Richard Biener 2008-12-29 22:25:07 UTC
We also see this from time to time.
Comment 7 Eric Botcazou 2009-09-06 21:18:42 UTC
In comment #6.
Comment 8 Ralf Wildenhues 2009-09-17 16:27:45 UTC
Does this also happen on trunk, or with branch-4_3 only?  AFAICS 4.3.3 had
  sparseset.o: sparseset.c $(SYSTEM_H) sparseset.h

in gcc/Makefile.in, which means it was lacking $(CONFIG_H) thus lacking
dependency on auto-host.h.  This was fixed in
<http://gcc.gnu.org/ml/gcc-patches/2008-07/msg01022.html>
and glancing at that patch, there may be quite a few other dependency issues
in branch-4_3.

No idea why the borked build does not fail but pick up auto-host.h from
elsewhere or so.  Or do you know for sure that auto-host.h was picked up
from the current directory?
Comment 9 Eric Botcazou 2009-09-17 16:58:36 UTC
> in gcc/Makefile.in, which means it was lacking $(CONFIG_H) thus lacking
> dependency on auto-host.h.  This was fixed in
> <http://gcc.gnu.org/ml/gcc-patches/2008-07/msg01022.html>
> and glancing at that patch, there may be quite a few other dependency issues
> in branch-4_3.

Thanks, will try to add the missing dependency.

> No idea why the borked build does not fail but pick up auto-host.h from
> elsewhere or so.  Or do you know for sure that auto-host.h was picked up
> from the current directory?

Couldn't a truncated auto-host.h have been picked up?
Comment 10 Ralf Wildenhues 2009-09-17 17:40:07 UTC
Subject: Re:  erratic comparison failures on very fast
 machines

* ebotcazou at gcc dot gnu dot org wrote on Thu, Sep 17, 2009 at 06:58:37PM CEST:
> > No idea why the borked build does not fail but pick up auto-host.h from
> > elsewhere or so.  Or do you know for sure that auto-host.h was picked up
> > from the current directory?
> 
> Couldn't a truncated auto-host.h have been picked up?

config.status uses mv from a temporary subdirectory to the final
location of the file, thus create it created atomically.  Autoconf 2.59
did this too.
Comment 11 Richard Biener 2010-05-14 12:51:46 UTC
Fixed (hopefully).
Comment 12 Richard Biener 2010-05-14 12:51:59 UTC
Subject: Bug 38591

Author: rguenth
Date: Fri May 14 12:51:31 2010
New Revision: 159392

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159392
Log:
2010-05-15  Richard Guenther  <rguenther@suse.de>

	PR bootstrap/38591
	* Makefile.in (graph.o): Add missing $(CONFIG_H) dependency.
	(sparseset.o): Likewise.

Modified:
    branches/gcc-4_3-branch/gcc/ChangeLog
    branches/gcc-4_3-branch/gcc/Makefile.in