public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/64247] New: program result depends on environment ?
@ 2014-12-10  5:50 Joost.VandeVondele at mat dot ethz.ch
  2014-12-10 12:27 ` [Bug middle-end/64247] " rguenth at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Joost.VandeVondele at mat dot ethz.ch @ 2014-12-10  5:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64247

            Bug ID: 64247
           Summary: program result depends on environment ?
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Joost.VandeVondele at mat dot ethz.ch

This is a bit an odd bug report, as it so far is just a somewhat worrying
observation:

If I run our simulation package, the output appears to change if we pipe (|) an
output to file via tee or if we direct the output (>) to file. This can be
reproduced with setting the flag GFORTRAN_UNBUFFERED_ALL as in :

> GFORTRAN_UNBUFFERED_ALL=0  ../../../exe/local/cp2k.sopt O_KG.inp 
POWELL| Number of function evaluations 3658

or

> GFORTRAN_UNBUFFERED_ALL=1  ../../../exe/local/cp2k.sopt O_KG.inp 
 POWELL| Number of function evaluations   10000

once the code converges (3658), once not.

If I run the same code under valgrind, I get no warnings/errors, but the
iteration count changes again to the old value.

 GFORTRAN_UNBUFFERED_ALL=1  valgrind ../../../exe/local/cp2k.sopt O_KG.inp 
 POWELL| Number of function evaluations   3658
[..]
==453== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 5 from 5)

This is all pretty reproducible on that particular machine. Only with gcc
4.9.2, not with earlier versions. In fact, if I pick up the old fortran runtime
libs (4.8.X) (but same cp2k binary) the problem seems to disappear.

However, I believe that this odd behavior with GFORTRAN_UNBUFFERED_ALL is maybe
coincidental. Indeed, our nightly tester can change value 'randomly' and it
looks like the result depends on the environment, in a surprising way.

Any suggestions ? 

The only wild guess I have so far is that, maybe, code flow is influenced by
the alignment of buffers returned by malloc, but I won't know how to prove that
?


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-12-11 21:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-10  5:50 [Bug middle-end/64247] New: program result depends on environment ? Joost.VandeVondele at mat dot ethz.ch
2014-12-10 12:27 ` [Bug middle-end/64247] " rguenth at gcc dot gnu.org
2014-12-10 12:28 ` Joost.VandeVondele at mat dot ethz.ch
2014-12-10 12:30 ` Joost.VandeVondele at mat dot ethz.ch
2014-12-11 16:29 ` [Bug middle-end/64247] malloc alignment and -mavx Joost.VandeVondele at mat dot ethz.ch
2014-12-11 19:22 ` Joost.VandeVondele at mat dot ethz.ch
2014-12-11 20:26 ` Joost.VandeVondele at mat dot ethz.ch
2014-12-11 20:51 ` neleai at seznam dot cz
2014-12-11 20:54 ` Joost.VandeVondele at mat dot ethz.ch
2014-12-11 21:18 ` Joost.VandeVondele at mat dot ethz.ch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).