[gdal-dev] Segmentation fault using gdal 1.4.4 and 1.5.2 on netcdf

Dylan Beaudette dylan.beaudette at gmail.com
Wed Aug 27 17:10:44 EDT 2008


On Wednesday 27 August 2008, Even Rouault wrote:
> Any chance that you are building GDAL with HDF4 support too ?
>
> http://trac.osgeo.org/gdal/wiki/NetCDF says :
>
> "If building GDAL with both HDF4 and NetCDF support it is necessary to
> build the HDF library specially or a dangerous conflict will occur. See the
> http://trac.osgeo.org/gdal/wiki/HDF topic for details."
>
> On my ubuntu 7.04, the hdf4 library coming from the .deb is not build
> properly as indicated in the wiki and GDAL does crash.

Thanks for the tip Even.

I can confirm that I had built my copy of GDAL with both NetCDF and HDF 
support. I re-built after removing support for HDF, and now 

gdalinfo netcdf_file_that_was_broken 

returns the expected results!

Great tip.

Vishal: you will need to remove the hdf packages, and re-configure GDAL, then 
re-compile GDAL. I would do something like this

sudo aptitude purge {name of hdf package}
cd gdal/
make clean
./configure [options from last time ....]
make
sudo make install

Cheers,
Dylan


> Le Wednesday 27 August 2008 22:38:04 Vishal Mehta, vous avez écrit :
> > Hello all,
> >
> > I continue to have 'segmentation fault' error using gdal-1.5.2 on Ubuntu
> > 8.04 with netcdf files.
> >
> > I re-compiled gdal from source again, this time with Dylan Beaudette's
> > gracious help (thanks Dylan!). I still got segmentation fault.
> >
> > Below are the last few lines of strace - hope that helps in identifying
> > what the problem is... I have libnetcdf 3.6-2-2
> >
> > Please note that the two netcdf files I've tried do open using FWTools
> > for Windows as well as starspan for Windows - so I don't think anything
> > is wrong with the netcdf files..
> >
> > -vishal
> >
> > -------excerpt from strace follows---
> >
> > read(3, "CDF\1\0\0\0\1\0\0\0\n\0\0\0\3\0\0\0\3lat\0\0\0\1h\0\0\0"...,
> > 4096) = 4096 _llseek(3, 0, [0], SEEK_SET)            = 0
> > open(".", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|0x80000) = 4
> > fstat64(4, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
> > fcntl64(4, F_GETFD)                     = 0x1 (flags FD_CLOEXEC)
> > getdents(4, /* 6 entries */, 4096)      = 136
> > getdents(4, /* 0 entries */, 4096)      = 0
> > close(4)                                = 0
> > open("airtemp.nc", O_RDONLY|O_LARGEFILE) = 4
> > fstat64(4, {st_mode=S_IFREG|0666, st_size=265644, ...}) = 0
> > fstat64(4, {st_mode=S_IFREG|0666, st_size=265644, ...}) = 0
> > _llseek(4, 0, [0], SEEK_SET)            = 0
> > read(4, "CDF\1\0\0\0\1\0\0\0\n\0\0\0\3\0\0\0\3lat\0\0\0\1h\0\0\0"...,
> > 8192) = 8192 --- SIGSEGV (Segmentation fault) @ 0 (0) ---
> > +++ killed by SIGSEGV +++
> > Process 395 detached
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev



-- 
Dylan Beaudette
Soil Resource Laboratory
http://casoilresource.lawr.ucdavis.edu/
University of California at Davis
530.754.7341


More information about the gdal-dev mailing list