identical executables, different results, continued

From: Irrational Number (nospam_at_nospam.com)
Date: 01/31/04


Date: Fri, 30 Jan 2004 15:41:23 -0800

Hello everyone,

A few weeks ago, I'd posted about identical executables
(ftp-d from one Linux RH 7.2 box to another Linux RH 7.2
box) running on two different machines. My test suite
contains 34 runs and 31 of them were identical, but 3
were different.

>From the responses in the group, I started searching for
variables that were typed incorrectly in Fortran (double
vs. real, implicitly-typed variables, etc.). Turns out,
that was not the problem.

The problem is actually in a memory allocation function,
whilst malloc-ing a linked list in C. (Our code contains
Fortran, C, and C++.) Also, the debuggable version (-g)
of the code does NOT have any result differences, only
optimized versions (-O1 and -O2). (We could go with the
-g version, but the analysts need to run thousands of
tests...)

So, now my question is: are there any esoteric problems
with optimizing a malloc call in C? The code LOOKS
correct to me...

    newlist = (List_Type) malloc (sizeof(struct _List_Type));

with subsequent initializations. How should I go about
finding this insect?

Thanks,
Anita



Relevant Pages

  • Re: Linux Advocates Fear Solaris 10.
    ... > family has put great effort into optimizing the Linux port for that family, ... But I suspect that the optimization areas depend on the ...
    (comp.unix.solaris)
  • Re: Linux Advocates Fear Solaris 10.
    ... unless some computer vendor that uses a different processor ... >>family has put great effort into optimizing the Linux port for that family, ... > Then tell me why gcc in most cases creates less performant x86 code than ...
    (comp.unix.solaris)
  • Re: Building Fruit 2.1 from source: best options for Intel Compiler 9.0?
    ... But that compiler is free for evaluation, ... But he definetly did a lot of optimizing during compilation with other ... I'm experimenting with GCC under Windows. ... I will check this with Linux. ...
    (rec.games.chess.computer)