This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
CREAD buggy?
- From: howarth at bromo dot msbb dot uc dot edu (Jack Howarth)
- To: fortran at gcc dot gnu dot org
- Date: Sat, 30 Jul 2005 14:20:57 -0400 (EDT)
- Subject: CREAD buggy?
I have been able to build xplor-nih using the new cray pointer patches
and xplor-nih passes most of its testsuite. However, I see subset of tests
fail with segfaults that all seem to be in calls to CREAD. The gdb output
shows...
COOR>ATOM 1 C4 DNP 250 -4.070 58.954 181.339 1.00 0.00
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x00016ff0
0xffff8c94 in ___memcpy () at /System/Library/Frameworks/System.framework/PrivateHeaders/ppc/cpu_capabilities.h:189
189 /System/Library/Frameworks/System.framework/PrivateHeaders/ppc/cpu_capabilities.h: No such file or directory.
in /System/Library/Frameworks/System.framework/PrivateHeaders/ppc/cpu_capabilities.h
(gdb)
...a backtrace shows...
#0 0xffff8c94 in ___memcpy () at /System/Library/Frameworks/System.framework/PrivateHeaders/ppc/cpu_capabilities.h:189
#1 0x0122f604 in *__gfortrani_format_error (f=0xbfffd406, message=0xfffffeea <Address 0xfffffeea out of bounds>) at ../../../libgfortran/io/format.c:923
#2 0x0123e2dc in formatted_transfer (type=BT_CHARACTER, p=0x4fdc8, len=44) at ../../../libgfortran/io/transfer.c:431
#3 0x0123c874 in *__gfortran_transfer_character (p=0x2, len=-278) at ../../../libgfortran/io/transfer.c:884
#4 0x0003e00c in cread_ (x=0x4011400, y=0x4011c00, z=0x4012400, wmain=0x4010400, qmain=0x4010c00, flags=0x3c0f2e0, segid=0x4018000, res=0x4018400, resid=0x4018800, type=0x4018c00, _segid=-1073752064, _res=4, _resid=4, _type=1) at coorio.f:422
#5 0x019612c8 in corma2_ (islct=0x3c0f2e0, rmsd=0x400ac00, kcnstr=0x400b400, refx=0x400c400, refy=0x400cc00, refz=0x400d400, xcomp=0x400dc00, ycomp=0x400e400, zcomp=0x400ec00, wcomp=0x400f400, qcomp=0x400fc00, fbeta=0x400bc00, wmain=0x4010400, qmain=0x4010c00, x=0x4011400, y=0x4011c00, z=0x4012400, dx=0x4012c00, dy=0x4013400, dz=0x4013c00, amass=0x4016400) at corman.f:162
#6 0x019606a8 in corman_ () at corman.f:37
#7 0x00044f68 in xplor_parse_ (qsubshell=@0xbfffe328) at xplorFunc.f:446
#8 0x00002940 in main (argc=1, argv=0xbfffe440) at xplor.c:116
The CREAD call in question is of the form...
CALL CREAD(X, Y, Z, WMAIN, QMAIN, ISLCT, heap(p_segid),
& heap(p_res), heap(p_resid), heap(p_type))
where the types for the parameters in the subroutine making this
call are..
double precision z(*)
double precision y(*)
double precision x(*)
double precision wmain(*)
double precision qmain(*)
INTEGER ISLCT(*)
INTEGER HEAPDM
PARAMETER (HEAPDM=2)
C dummy array to be able to use pointers in FORTRAN.
INTEGER HEAP(HEAPDM)
I'll ponder this to see if I can come up with a test case. Unfortunately
its rather complex code and the CREAD call seems to make it through the
first time in this case, hence the...
COOR>ATOM 1 C4 DNP 250 -4.070 58.954 181.339 1.00 0.00
output. Its the second time it calls CREAD with the same parameters that
I get the segfault.
Jack
ps I see this with both 4.0 and 4.1 branch and at -O0, -O2 and -O3
optimizations.