Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#3874 closed defect (duplicate)

Segmentation fault from ecw.py test on Linux

Reported by: Mateusz Łoskot Owned by: warmerdam
Priority: normal Milestone:
Component: GDAL_Raster Version: svn-trunk
Severity: normal Keywords: ecw
Cc:

Description

I'm running tests against trunk r21223 on Linux 64-bit (Ubuntu 10.04.1 LTS) with ECW enabled (libecwj2-3.3). The ecw.py test throws segmentation fault.

  • Configuration summary
GDAL is now configured for x86_64-unknown-linux-gnu

  Installation directory:    /usr/local
  C compiler:                gcc -g -O2 -fPIC
  C++ compiler:              g++ -g -O2 -fPIC

  LIBTOOL support:           no

  LIBZ support:              external
  GRASS support:             no
  CFITSIO support:           no
  PCRaster support:          internal
  NetCDF support:            yes
  LIBPNG support:            external
  LIBTIFF support:           internal (BigTIFF=yes)
  LIBGEOTIFF support:        internal
  LIBJPEG support:           external
  8/12 bit JPEG TIFF:        no
  LIBGIF support:            internal
  OGDI support:              no
  HDF4 support:              yes
  HDF5 support:              yes
  Kakadu support:            no
  JasPer support:            yes (GeoJP2=yes)
  OpenJPEG support:          no
  ECW support:               yes
  MrSID support:             no
  MrSID/MG4 Lidar support:   no
  MSG support:               no
  GRIB support:              no
  EPSILON support:           no
  cURL support (wms/wcs/...):yes
  PostgreSQL support:        yes
  MySQL support:             no
  Ingres support:            no
  Xerces-C support:          yes
  NAS support:               yes
  Expat support:             no
  Google libkml support:     no
  ODBC support:              no
  PGeo support:              no
  PCIDSK support:            old
  OCI support:               no
  GEORASTER support:         no
  SDE support:               no
  Rasdaman support:          no
  DODS support:              no
  SQLite support:            yes
  SpatiaLite support:        no
  DWGdirect support          no
  INFORMIX DataBlade support:no
  GEOS support:              yes
  VFK support:               no
  Poppler support:           no
  OpenCL support:            no


  SWIG Bindings:          python 

  Statically link PROJ.4:    no
  enable OGR building:       yes
  enable pthread support:    yes
  hide internal symbols:     no
  • Quick installation review
$ ldd /usr/local/lib/libgdal.so
	linux-vdso.so.1 =>  (0x00007ffff3af7000)
	libgeos_c.so.1 => /usr/local/lib/libgeos_c.so.1 (0x00007fb61c297000)
	libsqlite3.so.0 => /usr/lib/libsqlite3.so.0 (0x00007fb61c00a000)
	libxerces-c.so.28 => /usr/lib/libxerces-c.so.28 (0x00007fb61ba36000)
	libpthread.so.0 => /lib/libpthread.so.0 (0x00007fb61b819000)
	libNCSEcw.so.0 => /usr/local/lib/libNCSEcw.so.0 (0x00007fb61b4db000)
	libNCSCnet.so.0 => /usr/local/lib/libNCSCnet.so.0 (0x00007fb61b2c4000)
	libNCSUtil.so.0 => /usr/local/lib/libNCSUtil.so.0 (0x00007fb61b09e000)
	libjasper.so.1 => /usr/lib/libjasper.so.1 (0x00007fb61ae47000)
	libhdf5.so.6 => /usr/lib/libhdf5.so.6 (0x00007fb61a898000)
	libmfhdfalt.so.0 => /usr/lib/libmfhdfalt.so.0 (0x00007fb61a675000)
	libdfalt.so.0 => /usr/lib/libdfalt.so.0 (0x00007fb61a3d3000)
	libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x00007fb61a1ae000)
	libpng12.so.0 => /lib/libpng12.so.0 (0x00007fb619f87000)
	libnetcdf.so.4 => /usr/lib/libnetcdf.so.4 (0x00007fb619cb7000)
	libpq.so.5 => /usr/lib/libpq.so.5 (0x00007fb619a8e000)
	libz.so.1 => /lib/libz.so.1 (0x00007fb619877000)
	librt.so.1 => /lib/librt.so.1 (0x00007fb61966f000)
	libdl.so.2 => /lib/libdl.so.2 (0x00007fb61946a000)
	libcurl.so.4 => /usr/lib/libcurl.so.4 (0x00007fb619222000)
	libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007fb618f0e000)
	libm.so.6 => /lib/libm.so.6 (0x00007fb618c8a000)
	libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007fb618a73000)
	libc.so.6 => /lib/libc.so.6 (0x00007fb6186f0000)
	libgeos-3.3.0.so => /usr/local/lib/libgeos-3.3.0.so (0x00007fb6181e9000)
	libicuuc.so.42 => /usr/lib/libicuuc.so.42 (0x00007fb617e8e000)
	libicudata.so.42 => /usr/lib/libicudata.so.42 (0x00007fb616d49000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fb61cf29000)
	libssl.so.0.9.8 => /lib/libssl.so.0.9.8 (0x00007fb616af6000)
	libcrypto.so.0.9.8 => /lib/libcrypto.so.0.9.8 (0x00007fb616766000)
	libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x00007fb6164a1000)
	libcom_err.so.2 => /lib/libcom_err.so.2 (0x00007fb61629d000)
	libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x00007fb616069000)
	libcrypt.so.1 => /lib/libcrypt.so.1 (0x00007fb615e2f000)
	libldap_r-2.4.so.2 => /usr/lib/libldap_r-2.4.so.2 (0x00007fb615be3000)
	libidn.so.11 => /usr/lib/libidn.so.11 (0x00007fb6159b0000)
	liblber-2.4.so.2 => /usr/lib/liblber-2.4.so.2 (0x00007fb6157a1000)
	libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x00007fb61557b000)
	libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0x00007fb615372000)
	libkeyutils.so.1 => /lib/libkeyutils.so.1 (0x00007fb61516f000)
	libresolv.so.2 => /lib/libresolv.so.2 (0x00007fb614f56000)
	libsasl2.so.2 => /usr/lib/libsasl2.so.2 (0x00007fb614d3b000)
	libgnutls.so.26 => /usr/lib/libgnutls.so.26 (0x00007fb614a99000)
	libtasn1.so.3 => /usr/lib/libtasn1.so.3 (0x00007fb614887000)
	libgcrypt.so.11 => /lib/libgcrypt.so.11 (0x00007fb61460f000)
	libgpg-error.so.0 => /lib/libgpg-error.so.0 (0x00007fb61440b000)
  • autotest run
Running tests from gdrivers/ecw.py
  TEST: ecw_1 ... Deregistering JPEG2000
success
  TEST: ecw_2 ... success
  TEST: ecw_3 ... success
  TEST: ecw_4 ... success
  TEST: ecw_5 ... success
  TEST: ecw_6 ... success
  TEST: ecw_7 ... Warning 6: NITF only supports WGS84 geographic and UTM projections.

ERROR 1: An error has occurred: Error 86 "File is invalid or corrupt"  file "" line 139981574111232
success
  TEST: ecw_8 ... success
  TEST: ecw_9 ... Segmentation fault
  • gdb backtrace
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff4a6c075 in CNCSJPCResolution::SD_2D_OUTPUT4 (this=0xbf03c0, nCtx=<value optimised out>, u0=<value optimised out>, u1=<value optimised out>, nV=<value optimised out>, eType=<value optimised out>)
    at ../C/NCSEcw/NCSJP2/NCSJPCResolution.cpp:1781
1781			INT32 nPrevVert01 = pSrc1Down[n2n] - NCSFloorDiv(pSrc0[n2n] + pSrc2Down[n2n], 2);
(gdb) bt
#0  0x00007ffff4a6c075 in CNCSJPCResolution::SD_2D_OUTPUT4 (this=0xbf03c0, nCtx=<value optimised out>, u0=<value optimised out>, u1=<value optimised out>, nV=<value optimised out>, 
    eType=<value optimised out>) at ../C/NCSEcw/NCSJP2/NCSJPCResolution.cpp:1781
#1  0x00007ffff4a6a4a1 in CNCSJPCResolution::SD_2D (this=0xbf03c0, nCtx=<value optimised out>, pSrc=0x7fffffffd610) at ../C/NCSEcw/NCSJP2/NCSJPCResolution.cpp:1873
#2  0x00007ffff4a6d258 in CNCSJPCResolution::WriteLine (this=0xbf03c0, nCtx=0xbe2400, pSrc=0x7fffffffd610, iComponent=<value optimised out>) at ../C/NCSEcw/NCSJP2/NCSJPCResolution.cpp:376
#3  0x00007ffff4a0f504 in CNCSJP2File::WriteLine (this=0xbeeb10, nCtx=0xbe2400, pSrc=0x7fffffffd610, iComponent=<value optimised out>) at ../C/NCSEcw/NCSJP2/NCSJP2File.cpp:1731
#4  0x00007ffff4a1d92e in CNCSJP2FileView::WriteLineBIL (this=0xbe2400, eType=<value optimised out>, nBands=<value optimised out>, ppOutputLine=<value optimised out>, pLineSteps=<value optimised out>)
    at ../C/NCSEcw/NCSJP2/NCSJP2FileView.cpp:1690
#5  0x00007ffff5ee561c in ECWWriteDataset::FlushLine (this=0xbe2300) at ecwcreatecopy.cpp:1430
#6  0x00007ffff5ee57e0 in ECWWriteRasterBand::IWriteBlock (this=0xb46e80, nBlockX=<value optimised out>, nBlockY=3, pBuffer=0xbd52f0) at ecwcreatecopy.cpp:1511
#7  0x00007ffff60a6b5d in GDALRasterBand::FlushBlock (this=<value optimised out>, nXBlockOff=<value optimised out>, nYBlockOff=<value optimised out>, bWriteDirtyBlock=-4) at gdalrasterband.cpp:1079
#8  0x00007ffff608e19a in GDALDataset::BlockBasedFlushCache (this=0xbe2300) at gdaldataset.cpp:424
#9  0x00007ffff5ee5b60 in ~ECWWriteDataset (this=0x3fffffff8, __in_chrg=<value optimised out>) at ecwcreatecopy.cpp:1293
#10 0x00007ffff608d0c4 in GDALClose (hDS=0xbe2300) at gdaldataset.cpp:2380
#11 0x00007ffff6706310 in delete_GDALDatasetShadow (args=<value optimised out>) at extensions/gdal_wrap.cpp:3801
#12 _wrap_delete_Dataset (args=<value optimised out>) at extensions/gdal_wrap.cpp:10424
#13 0x00000000004239d0 in PyObject_CallFunctionObjArgs ()
#14 0x00007ffff66fb4f5 in SwigPyObject_dealloc (v=0xa31960) at extensions/gdal_wrap.cpp:1580
#15 0x000000000044fc53 in ?? ()
#16 0x000000000046d327 in ?? ()
#17 0x00000000004a3631 in PyEval_EvalFrameEx ()
#18 0x00000000004a8550 in PyEval_EvalFrameEx ()
#19 0x00000000004a8550 in PyEval_EvalFrameEx ()
#20 0x00000000004a8550 in PyEval_EvalFrameEx ()
#21 0x00000000004a9671 in PyEval_EvalCodeEx ()
#22 0x00000000004a9742 in PyEval_EvalCode ()
#23 0x00000000004c9a0e in PyRun_FileExFlags ()
#24 0x00000000004c9c24 in PyRun_SimpleFileExFlags ()
#25 0x000000000041a7ff in Py_Main ()
#26 0x00007ffff69d8c4d in __libc_start_main (main=<value optimised out>, argc=<value optimised out>, ubp_av=<value optimised out>, init=<value optimised out>, fini=<value optimised out>, 
    rtld_fini=<value optimised out>, stack_end=0x7fffffffe2d8) at libc-start.c:226
#27 0x00000000004199f9 in _start ()
(gdb)

Change History (3)

comment:1 by warmerdam, 13 years ago

Component: defaultGDAL_Raster

Yes, I also often encounter this problem and have given up on trying to track it down. As far as I know it is a deep problem in the ecw sdk itself.

comment:2 by Even Rouault, 13 years ago

Resolution: duplicate
Status: newclosed

Mateusz, you rediscovered #2593 ;-) and the good news is that it has a patch for libecwj in the last comment to fix this. It is mentionned in http://trac.osgeo.org/gdal/wiki/ECW

comment:3 by Mateusz Łoskot, 13 years ago

I overlooked this report and patch. Thank you both for help.

Note: See TracTickets for help on using tickets.