SUMMARY: malloc/calloc problem on OSF1 v3.0?

From: Andrew Gillies <anaru_at_cns.ed.ac.uk>
Date: Sat, 4 Mar 1995 10:57:15 GMT

Thanks to all the replied to the memory allocation question.

A recap of what I asked (2 Mar 95):

> A few months back I installed OSF1 v3.0 on a DEC alpha 3000/500S
> (complete installation from OSF1 v1.3A). Everything seems to be
> running fine, however, one of the C programs often used here,
> (compiled with cc) produces a segmentation fault at the line:
>
> tau = (double *) malloc(lm*sizeof(double));
>
> lm is too small to be hitting a memory limit (& still shouldn't cause
> a segmentation fault at this line). The DEC has 380Mb.
>
> The program calls calloc and malloc many times, and there seems no
> reason why this particular line should cause a problem (this program
> uses only the standard C and math libraries)?
>
> The program works fine on an identical DEC that is still running OSF1
> v1.3A, and runs fine on the SUN sparcs.
>
> If I compile it with the "-non_shared" option on the OSF1 v1.3A
> machine, then copy it to the DEC running OSF1 v3.0 - it works fine
> then also (but not without the -non_shared).
>
> We have a few "off the shelf" DECs pre-installed with OSF1 v3.0, and
> it fails to work on them as well.
>
> Is this a known problem with OSF1 v3.0 and are there any fixes?
>
> Any help, or pointers would be most appreciated.

Basicly, everyone said the same thing: the likely cause is a memory
leak, or overrun earlier in the program, that OSF1 is stricter about
memory boundaries than other operating systems, and that the malloc
procedures were changed in OSF1 v2.0. After searching through
every allocation call and reference in the program, I found one array
that was being deallocated incorrectly. Upon fixing this, the program
seems to now work fine on the OSF1 v3.0 machine.

Thanks very much,
Andrew

PS: the pun in the last sentence of the original post, that was
also pointed out to me, (hmmm) was completely unintentional.
                          --------------------
  System Administration e-mail operator_at_cns.ed.ac.uk
  Centre for Neural Systems (CNS) anaru_at_cns.ed.ac.uk
  Centre for Cognitive Science
  2 Buccleuch Place, phone 031 650 4422
  Edinburgh EH8 9LW fax 031 650 6626
Received on Sat Mar 04 1995 - 05:58:29 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:45 NZDT