NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 20040629:nf_get_vara_real under Linux



>To: address@hidden
>cc: address@hidden
>From: Ben Foster <address@hidden>
>Subject: nf_get_vara_real under Linux
>Organization: UCAR/Unidata
>Keywords: 200406292115.i5TLFhWb013666

Hi Ben,

> this is a problem regarding netcdf on a Linux box:
> 
> I have a fairly large f90 post-processor code that reads netcdf history
> files. It runs fine on IBM and SGI machines, and I am porting to Linux.
> 
> I finally got it to compile with pgf90 under RedHat 9. Everthing goes
> fine until it comes time to read a var using nf_get_vara_real. If the
> nf_get_vara_real call is not commented out, the program crashes with
> SIGSEGV at the first executable statement of the routine that calls
> nf_get_vara_real (it does not matter what the 1st exec statement is).
> If I do comment out the nf_get_vara_real call, everything works fine,
> I just don't get my array!
> 
> I have pulled the routine out of the large code, and put it in a small
> test program with minor changes, and everything works fine, including
> the nf_get_vara_real. The problem appears to lie in the environment
> of the larger code.
> 
> A run under pgdbg gives the following error:
> 
> Signalled SIGSEGV at 0x401bd89e, function _int_malloc, line 463
> 401bd89e:  89 7a 04                     movl   %edi,4(%edx)
> 
> And the last 6 levels of traceback is as follows:
> 
>    #6  nc_rdfld line: 463 in "nchist_mod.F" address: 0x81c3306 
>      ncid = 17 , name = 0x14b6b680, itime = 2 , nzp = 45 , ixfld = 0 , ier = 
> 0 
>    #5  pgf90_ptr_alloc address: 0x83bf9e1 
>    #4  __hpf_alloc address: 0x83bf614 
>    #3  __hpf_gmalloc_without_abort address: 0x83c61c1 
>    #2  __hpf_malloc_without_abort address: 0x83c5fe4 
>    #1  __malloc address: 0x401bc8a0 
> => #0  _int_malloc address: 0x401bd89e 
> 
> #1-#5 not shown are in my code. Line 463 of nchist_mod.F is the first 
> executable statement of sub nc_rdfld (which has the nf_gat_vara_real call).
> 
> Does this indicate a memory problem?  I have tried "limit data unlimited"
> and "limit stack unlimited". I can send parts of the source code if that
> would be helpful. Thanks for any suggestions,

There was a bug in the PG F90 compiler, version 5.1, on Linux that
might be the cause of the problem you are seeing:

  
http://my.unidata.ucar.edu/cgi-bin/getfile?file=/content/support/help/MailArchives/netcdf/msg05332.html

But if you have version 5.1-5 or later, that's probably not it.  We
would need something that reproduces the problem here to debug it
further.  I hope it's the compiler error that Portland Group has
provided a fix for, otherwise it will require some serious debugging.

--Russ