For Programmers: Free Programming Magazines  


Home > Archive > Fortran > July 2004 > xlf90 malloc problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author xlf90 malloc problem
Chris

2004-07-28, 9:06 pm

I hope this post is located in the correct group, if not I apologize
in advance.

I'm trying to compile a code on a Mac-(G5, OS X 10.3 Panther) using
xlf90 (IBM XL Fortran 8.1). The code uses BLAS/LAPACK extensively and
I've attempted linking with both the vecLib Framework and compiling my
own libraries both yielding the same result. The problem appears to be
related to the call of malloc or malloc_create_zone.

I've compiled smaller test codes in an effort to hunt down the problem
but gdb prints the error message
"Program received signal EXC_BAD_ACCESS, Could not access memory.
0x9001f654 in malloc_create_zone ()"
for anything I try using any set of linked libraries. I've set
breakpoints at the earliest stages of the code with no success. To get
the code to compile, I must link with the System.B, and crt1.o OS X
libraries.

I've also tried compiling a very simple code (shown below) pulled off
of lang.fortran that uses ALLOCATE/DEALLOCATE with no problems.

Any help or suggestion would certainly be appreciated.

-Chris

------------code below------------
PROGRAM testmem2
REAL, ALLOCATABLE :: A(:,:)
integer i,e,j

print *,'Press a numeric key & enter to start'
read *,e
allocate (A(10000,10000))
do 100 i=1, 10000, 1
do 200 j=1, 10000, 1
a(i,j)=4
200 continue
100 continue
print *,'Press a numeric key & enter to deallocate'
read *, e

deallocate(A, STAT=e)
print *, 'Error',e
call sleep(5)
END PROGRAM testmem2
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com