This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: CREAD buggy?


On Sat, Jul 30, 2005 at 02:20:57PM -0400, Jack Howarth wrote:
>     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

My initial guess would be that you are stepping outside of
an array bounds. 

> 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))
> 

Will these cause an aliasing problem heap(p_segid), heap(p_res),
heap(p_resid), and heap(p_type)?

>       INTEGER ISLCT(*) 
>       INTEGER HEAPDM
>       PARAMETER (HEAPDM=2)
> C dummy array to be able to use pointers in FORTRAN.
>       INTEGER HEAP(HEAPDM)

The heap has 2 elements, and I'm suspicious that you have 
an aliasing problem.  Unfortnately, xplor-nih requires 
registeration to get access to the source, so I can't 
look at the code.

-- 
Steve


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]