Opened 12 years ago

Closed 12 years ago

#4686 closed defect (fixed)

JPEG2000/jasper segfault when writing multi-band raster

Reported by: fschindler Owned by: warmerdam
Priority: normal Milestone: 1.10.0
Component: GDAL_Raster Version: 1.8.0
Severity: normal Keywords: jpeg2000 jasper segfault
Cc:

Description

When using JPEG2000 to write multi-band raster files a segfault occurs. e.g with 'gdal_translate':

gdal_translate -of JPEG2000 data/meris/MER_FRS_1P_reduced/ENVISAT-MER_FRS_1PNPDE20060816_090929_000001972050_00222_23322_0058_uint16_reduced_compressed.tif x.jp2

gdalinfo of the input image:

Driver: GTiff/GeoTIFF
Files: data/meris/MER_FRS_1P_reduced/ENVISAT-MER_FRS_1PNPDE20060816_090929_000001972050_00222_23322_0058_uint16_reduced_compressed.tif
Size is 539, 448
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]]
Origin = (11.361065864562988,46.252025604248047)
Pixel Size = (0.031396623105174,-0.031362900240700)
Metadata:
  TIFFTAG_IMAGEDESCRIPTION=ENVISAT-MER_FRS_1PNPDE20060816_090929_000001972050_00222_23322_0058_uint16
  TIFFTAG_XRESOLUTION=1
  TIFFTAG_YRESOLUTION=1
  TIFFTAG_RESOLUTIONUNIT=1 (unitless)
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (  11.3610659,  46.2520256) ( 11d21'39.84"E, 46d15' 7.29"N)
Lower Left  (  11.3610659,  32.2014463) ( 11d21'39.84"E, 32d12' 5.21"N)
Upper Right (  28.2838457,  46.2520256) ( 28d17' 1.84"E, 46d15' 7.29"N)
Lower Right (  28.2838457,  32.2014463) ( 28d17' 1.84"E, 32d12' 5.21"N)
Center      (  19.8224558,  39.2267360) ( 19d49'20.84"E, 39d13'36.25"N)
Band 1 Block=539x1 Type=UInt16, ColorInterp=Gray
Band 2 Block=539x1 Type=UInt16, ColorInterp=Undefined
Band 3 Block=539x1 Type=UInt16, ColorInterp=Undefined
Band 4 Block=539x1 Type=UInt16, ColorInterp=Undefined
Band 5 Block=539x1 Type=UInt16, ColorInterp=Undefined
Band 6 Block=539x1 Type=UInt16, ColorInterp=Undefined
Band 7 Block=539x1 Type=UInt16, ColorInterp=Undefined
Band 8 Block=539x1 Type=UInt16, ColorInterp=Undefined
Band 9 Block=539x1 Type=UInt16, ColorInterp=Undefined
Band 10 Block=539x1 Type=UInt16, ColorInterp=Undefined
Band 11 Block=539x1 Type=UInt16, ColorInterp=Undefined
Band 12 Block=539x1 Type=UInt16, ColorInterp=Undefined
Band 13 Block=539x1 Type=UInt16, ColorInterp=Undefined
Band 14 Block=539x1 Type=UInt16, ColorInterp=Undefined
Band 15 Block=539x1 Type=UInt16, ColorInterp=Undefined

This results in a segfault and the following stacktrace (gdb, not much info unfortunately):

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5250640 in jas_iccprof_createfromcmprof () from /usr/lib/libjasper.so.1
(gdb) bt
#0  0x00007ffff5250640 in jas_iccprof_createfromcmprof () from /usr/lib/libjasper.so.1
#1  0x00007ffff525ffa4 in jp2_write_header () from /usr/lib/libjasper.so.1
#2  0x00007ffff52603d9 in jp2_encode_uuid () from /usr/lib/libjasper.so.1
#3  0x00007ffff758f266 in ?? () from /usr/lib/libgdal1.8.0.so.1
#4  0x00007ffff76b8013 in GDALDriver::CreateCopy(char const*, GDALDataset*, int, char**, int (*)(double, char const*, void*), void*) ()
   from /usr/lib/libgdal1.8.0.so.1
#5  0x0000000000404abf in ?? ()
#6  0x00007ffff658bd8e in __libc_start_main (main=<value optimized out>, argc=<value optimized out>, ubp_av=<value optimized out>, 
    init=<value optimized out>, fini=<value optimized out>, rtld_fini=<value optimized out>, stack_end=0x7fffffffe1c8) at libc-start.c:226
#7  0x0000000000401fe9 in ?? ()
#8  0x00007fffffffe1c8 in ?? ()
#9  0x000000000000001c in ?? ()
#10 0x0000000000000005 in ?? ()
#11 0x00007fffffffe4b7 in ?? ()
#12 0x00007fffffffe4cf in ?? ()
#13 0x00007fffffffe4d3 in ?? ()
#14 0x00007fffffffe4dc in ?? ()
#15 0x00007fffffffe55c in ?? ()
#16 0x0000000000000000 in ?? ()

Change History (1)

comment:1 by Even Rouault, 12 years ago

Milestone: 2.0.0
Resolution: fixed
Status: newclosed

r24513 /trunk/ (2 files in 2 dirs): JPEG2000: workaround crash in CreateCopy() when copying more than 4 bands (#4686)

Note: See TracTickets for help on using tickets.