Re: Program fails: can it be malloc()?
Richard Black (Richard.Black@cl.cam.ac.uk)
Thu, 25 Apr 1996 11:00:10 +0100
> Hello *,
>
> I have a program that uses quite a lot of malloc()s.
>
> Compiled on an Intel machine it runs quite fine (on that
> Intel machine); compile on my Alpha, it fails with odd
> errors, e.g. in not being able to fopen() a file, cannot
> create a temp file, and not enough memory for malloc.
>
> Editing the pertaining source file, and commenting out code
> run _after_ the error causing algorithm results in no errors.
>
> I really cannot find any C-related problem (casting or so),
> and gcc -Wall does not cause any warnings at all.
>
> Upgrading from libc 0.40.2 to 0.40.3 doesn't help.
> Upgrading memset.S with Linus' recent version doesn't help.
>
> Any ideas? Please?
One thing we've noticed here with some undergraduates porting code from
ix86_linux to alpha_linux is use of updates to the same thing both in an
lvalue and an rvalue. According to the C standard this is officially illegal
code, but gcc does not generate a warning and does DIFFERENT things in the
ix86 back end and the alpha back end. I mean code like
i += i++;
(this is obviously just a trivial example).
You might want to check for such things.
-----
Dr. Richard Black (usual disclaimers)
University of Cambridge
Computer Laboratory
Cambridge
United Kingdom