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

[netCDF #OKY-144340]: ftst_vars4: SIGBUS on Solaris10/SPARC/gcc-4.5.1 when compiled with -m64



> Hi,
> 
> ftst_vars4 of netdcf-4.1.1 fails on SPARC with a SIGBUS when compiled
> with 64 bits enabled for the following reason:
> 
> The len member of nc_vlen_t is 64 bits wide (for -m64) and thus, it has
> to be aligned on a 8 byte boundrary.
> 
> A integer in gfortran is always 32 bits wide (independent of whether
> -m32 or -m64 has been given) and so your
> integer vlen(10)
> may be aligned on a 4 byte boundrary and gfortran does exactly this on
> my system resulting in a SIGBUS when nf_put_vlen_element gets invoked.
> 
> The attached diff fixes that (make check completes successfully).
> 
> You might also want to update that netcdf-f77.texi about how to proper
> use functions where a size_t is involved on 64 bit systems.
> 
> Wishes
> 
> Nicolai
> 
> 

Howdy Nicolai!

Thanks for pointing this out and providing a fix. I would have had a hard time 
figuring that one out!

I have checked your fix into the repository and it is in the current snapshot 
release:
ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4-daily.tar.gz

Please give it a try and let me know if it works for you.

Thanks,

Ed

Ticket Details
===================
Ticket ID: OKY-144340
Department: Support netCDF
Priority: Critical
Status: Closed