[Gdal-dev] gdal_translate segfaults at tiff->envi

Vincent Schut schut at sarvision.com
Thu Jun 5 10:55:28 EDT 2003


Replying my own post...

The problem appeared to be that my tiff files were *not* geotiff files, and 
thus contained no projection info. This resulting in an empty pszProjName and 
thus a segfaulting strstr(pszProjName, "UTM") (line 363 in envidataset.cpp).
If we want gdal_translate to export projection-less envi files, I suggest 
changing line 363 in something like:
if ( ( pszProjName != NULL ) && ( strstr( pszProjName, "UTM" ) ) )
which resolved the problem.

If we don't want it to write envi files without proj info, I suppose it should 
generate an error message and quit. Maybe a 'bin' or 'raw' output format 
could be added then to have envi-like (simple binary) files?

Regards,
Vincent Schut.

On Thursday 05 June 2003 16:35, Vincent Schut wrote:
> Using latest cvs, gdal_translate segfaults if I try to convert a tiff file
> to envi. The conversion seems to go well (reaches 100%) but then it
> crashes, apparently before closing the resulting envi file, because it is
> not finished (not all data is written to disk, half of the last line is
> missing).
>
> Here is the gdb backtrace:
>
> (gdb) run -of ENVI ag_199903_cl3_PP.tif ag_199903_cl3_PP.bin
> Starting program: /usr/local/bin/gdal_translate -of ENVI
> ag_199903_cl3_PP.tif ag_199903_cl3_PP.bin
> Input file size is 7600, 2460
> 0...10...20...30...40...50...60...70...80...90...100 - done.
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x405494a1 in strstr () from /lib/i686/libc.so.6
> (gdb) backtrace
> #0  0x405494a1 in strstr () from /lib/i686/libc.so.6
> #1  0x4027bb47 in typeinfo name for DOQ1Dataset () from
> /usr/local/lib/libgdal.1.1.so
> #2  0x400c6668 in ENVIDataset::~ENVIDataset() () from
> /usr/local/lib/libgdal.1.1.so
> #3  0x4014c817 in GDALClose () from /usr/local/lib/libgdal.1.1.so
> #4  0x0804a3ab in main ()
> #5  0x404ec082 in __libc_start_main () from /lib/i686/libc.so.6
> (gdb) q
>
> Regards,
> Vincent Schut.

-- 
______________________________________
Vincent Schut
Sarvision B.V.
Wageningen, The Netherlands
www.sarvision.com



More information about the Gdal-dev mailing list