A dumb mistake

by Yi Zhang

This dumb mistake made me debugging for a whole night….

I am trying to solve a linear system using SGESV.f, a standard procedure. OK, source file is done, and compiled under Sun Studio 10, using

% f95 -dalign my_file.f -xlic_lib=sunperf

But running the a.out gave me ‘Segmentation fault’ . And debugging using dbx gave me “access to address exceeded protections”. What I didn’t realize was that the arguments of SGESV.f is set to be ‘PARAMETER’, and it was two hours later when I found it out:

INTEGER(KIND=4),PARAMETER :: N,NRHS,LDA,LDB,INFO

Of course the address was “protected”!

Advertisements