Opened 16 years ago

Closed 16 years ago

#2175 closed defect (invalid)

gdaladdo assertion failed - corrupt file

Reported by: coutujf Owned by: warmerdam
Priority: normal Milestone:
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords: gdaladdo, GeoTiff, corrupt
Cc:

Description

Tested with GDAL 1.6.0dev, FWTools 2.0.5, released 2008/01/16 The test file below will be provided soon.

Out of more than a 100 files only 5 or 6 caused the problem. gdaladdo seems to corrupt geotiff file see ouput below:


gdaladdo -r average 1965_04_07_Prince_Rupert_PK00893_PK05204.TIF 2 4 8 16 0...10...20...30...40...50...60...70...80...90...100 - done. Assertion failed: tif->tif_flags&TIFF_BIGTIFF, file tif_dirwrite.c, line 2027

This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.


Here is gdalinfo output before and after:


Driver: GTiff/GeoTIFF Files: 1965_04_07_Prince_Rupert_PK00893_PK05204.TIF

1965_04_07_Prince_Rupert_PK00893_PK05204.aux

Size is 7800, 12100 Coordinate System is: PROJCS["unnamed",

GEOGCS["NAD83",

DATUM["North_American_Datum_1983",

SPHEROID["GRS 1980",6378137,298.2572221010002,

AUTHORITY["EPSG","7019"]],

AUTHORITY["EPSG","6269"]],

PRIMEM["Greenwich",0], UNIT["degree",0.0174532925199433], AUTHORITY["EPSG","4269"]],

PROJECTIONTransverse_Mercator, PARAMETER["latitude_of_origin",0], PARAMETER["central_meridian",-129], PARAMETER["scale_factor",0.9996], PARAMETER["false_easting",500000], PARAMETER["false_northing",0], UNIT["metre",1,

AUTHORITY["EPSG","9001"]],

AUTHORITY["EPSG","26909"]]

Origin = (416530.000000000000000,6021255.000000000000000) Pixel Size = (0.100000000000000,-0.100000000000000) Metadata:

AREA_OR_POINT=Area TIFFTAG_IMAGEDESCRIPTION=ORTHO: LL XY: 416530.000 6020045.000 PIXELS: 0.10 0.10 ROT: 0.00 TIFFTAG_SOFTWARE=Adobe Photoshop CS Windows TIFFTAG_DATETIME=2007:08:28 22:22:19 TIFFTAG_XRESOLUTION=72 TIFFTAG_YRESOLUTION=72 TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)

Image Structure Metadata:

INTERLEAVE=BAND

Corner Coordinates: Upper Left ( 416530.000, 6021255.000) (130d17'1.20"W, 54d19'56.30"N) Lower Left ( 416530.000, 6020045.000) (130d16'59.98"W, 54d19'17.17"N) Upper Right ( 417310.000, 6021255.000) (130d16'18.03"W, 54d19'56.76"N) Lower Right ( 417310.000, 6020045.000) (130d16'16.82"W, 54d19'17.62"N) Center ( 416920.000, 6020650.000) (130d16'39.01"W, 54d19'36.96"N) Band 1 Block=7800x1 Type=Byte, ColorInterp=Gray

Metadata:

LAYER_TYPE=athematic

<GDALRasterAttributeTable/>


After:


ERROR 1: 1965_04_07_Prince_Rupert_PK00893_PK05204.TIF:No space to read TIFF dire ctory ERROR 1: TIFFReadDirectory:Failed to read directory at offset 127257924 gdalinfo failed - unable to open '1965_04_07_Prince_Rupert_PK00893_PK05204.TIF'.


Attachments (1)

Prince_Rupert.aux (5.9 KB ) - added by coutujf 16 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 by warmerdam, 16 years ago

Status: newassigned

I have downloaded Price_Rupert.TIF provided by JF and tried the given gdaladdo command with my working build on 64bit linux, FWTools 2.0.5 for linux and FWTools 2.0.5 for win32 and they all work fine. The fwtools builds might actually be slightly newer than the proper release, so I'll try again with the downloaded FWTools build at some point.

JF, can you confirm that you got the error with FWTools 2.0.5 on windows? I'm quite surprised that you see an assertion since I had assumed those were compiled out in the FWTools builds.

by coutujf, 16 years ago

Attachment: Prince_Rupert.aux added

comment:2 by coutujf, 16 years ago

Yeah,

I do have the error with FWTools 2.0.5 on Windows. I've dug a little deeper and found out why you were not able to reproduce the bug. I realized that I only get the error when there is also a .aux companion file in the same directory as the .tif.

I've attached the .aux file for the file you've downloaded to this bug so you can rerun tests with it. I also found out about the gdaladdo --config USE_RRD YES command but it did not help because at the end of the process I got an error pop up window...

"The instruction ... at memory address .... Memory could not be written. Ok to terminate, Cancel to debug"

After clicking OK, I can see that the size and date of change of the .aux file has changed but there is no overviews available.

Hope this helps!

JF

comment:3 by Even Rouault, 16 years ago

The crash with "gdaladdo --config USE_RRD YES " is #2145, that has been fixed now. Maybe that this fix also fixes your problem ?

comment:4 by warmerdam, 16 years ago

Resolution: invalid
Status: assignedclosed

I believe that the problem is due to:

http://bugzilla.maptools.org/show_bug.cgi?id=1917

which affects any attempt to write (or rewrite in this case) a directory with an EXIF IFD in it using libtiff4.

I'm closing this ticket with the anticipation that my theory is correct. Watch the bugzilla libtiff ticket to track the issue further.

Note: See TracTickets for help on using tickets.