Bug report #348

Crash on OSX when loading GeoTIFF

Added by anonymous - over 17 years ago. Updated over 14 years ago.

Status:Closed
Priority:Low
Assignee:Tom Elwertowski
Category:Rasters
Affected QGIS version: Regression?:No
Operating System:OS X Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:10407

Description

Maybe it's just out of memory, but I get a "Bus Error" when trying to load a large GeoTIFF. [I guess that's Mac for SegFault]

Same with 5 different machines with the same setup.

PPC MiniMac with 512mb RAM. (but out of memory shouldn't cause a bus error?) I'll see if I can try a smaller GeoTIFF.

It also crashed sometimes when loading a large shapefile.
(but then worked on restart)

the same file loaded fine in 0.7.4 on Windows.

file size is 120361625 (115M)

$ gdalinfo
Driver: GTiff/GeoTIFF
Size is 10720, 12320
Coordinate System is:
PROJCS["New Zealand Map Grid",
GEOGCS["international",
DATUM["New_Zealand_Geodetic_Datum_1949",
SPHEROID["International 1924",6378388,297.000000000005,
AUTHORITYEPSG""7022,
AUTHORITYEPSG""6272,
PRIMEMGreenwich,
UNITdegree,
PROJECTIONNew_Zealand_Map_Grid,
PARAMETERlatitude_of_origin,
PARAMETERcentral_meridian,
PARAMETERfalse_easting,
PARAMETERfalse_northing,
UNIT["metre",1,
AUTHORITYEPSG""9001
Origin = (2309200.000000,5502100.000000)
Pixel Size = (2.50000000,-2.50000000)
Metadata:
AREA_OR_POINT=Area
Corner Coordinates:
Upper Left ( 2309200.000, 5502100.000) (170d25'28.64"E, 45d39'43.78"S)
Lower Left ( 2309200.000, 5471300.000) (170d24'44.63"E, 45d56'20.82"S)
Upper Right ( 2336000.000, 5502100.000) (170d46'6.08"E, 45d40'8.69"S)
Lower Right ( 2336000.000, 5471300.000) (170d45'28.13"E, 45d56'45.79"S)
Center ( 2322600.000, 5486700.000) (170d35'26.88"E, 45d48'15.25"S)
Band 1 Block=10720x1 Type=Int16, ColorInterp=Gray
NoData Value=0
Metadata:
COLOR_TABLE_RULES_COUNT=1
COLOR_TABLE_RULE_RGB_0=0.000000e+00 2.550000e+02 0 0 0 255 255 255

nz25_NZMG_gdal_IntPix_Pacbit_crop.tif - GeoTiff which causes Bus Error on OSX (82.2 KB) hamish_nospam-yahoo-com -, 2006-12-11 12:00 AM

qgis_crash_osx.txt Magnifier - core dump (OSX report text file) (23.1 KB) hamish_nospam-yahoo-com -, 2006-12-11 12:04 AM

qgis_crash_osx_31Jan2007.txt Magnifier - core dump (OSX report text file) from 0.8.0 release (26.6 KB) hamish_nospam-yahoo-com -, 2007-01-31 10:56 PM

qgis_crash_osx_11Feb2008.txt Magnifier - core dump (OSX report text file) from 0.9.1 release (27.7 KB) hamish -, 2008-02-10 11:52 PM

History

#1 Updated by anonymous - over 17 years ago

(exported from GRASS)

#2 Updated by Gavin Macaulay - over 17 years ago

This may have been the same problem as ticket #248, which was recently fixed (60b96fc9 (SVN r6073)). Can you try it again with the latest version of qgis?

#3 Updated by Gary Sherman over 17 years ago

Without further input or sample data we can't fix this.

#4 Updated by hamish_nospam-yahoo-com - over 17 years ago

Hi, sorry for the delay getting back to you, I hadn't seen the reply.

I am thinking now it has more to do with the export compression options than filesize. I will export using various methods and try and pin down what's failing. I can only test with the available OSX binaries.

thanks,
Hamish

#5 Updated by hamish_nospam-yahoo-com - over 17 years ago

Hi, had a chance to do some more testing.

It fails on a Mac with a GeoTIFF created with gdal_translate.
(DebianGIS gdal package version: 1.3.1-0.dgis.stable.2)

tested with:
PC: 0.8pre3-cvs binary posted by Tim December 10th.
Mac: 0.8pre2 binary download linked from .8p2 news item

I tried a number of different export options.

Worked (PC+Mac): GRASS's r.out.tiff C module.
compress=none,defalte*,lzw,packbit

  • deflate failed cleanly on the Mac with "deflate support not configured" error printed to stderr (ran from Terminal). I assume this has to do with the GDAL configure options in the supplied binary. No error window poped up though, just left with a blank screen. Another wierdness on the Mac: the wristwatch hourglass mouse cursor stayed on, always.

Failed (Mac only): export using GRASS 6.2's r.out.gdal, which is just a frontend bash script for gdal_translate with the GDAL/GRASS plugin. compress=none,defalte,lzw,packbit; INTERLEAVE=PIXEL. also tried compress=packbit,INTERLEAVE=BAND with no luck. Worked fine on the PC (0.7.4 and 0.8pre3_Tim_10Dec)

I'll try and upload a crop of the GeoTIFF here.

Hamish

#6 Updated by anonymous - over 17 years ago

link to test data (84kb): (I couldn't figure out how to upload a file to the tracker)
http://bambi.otago.ac.nz/hamish/grass/qgis/nz25_NZMG_gdal_IntPix_Pacbit_crop.tif

create command in GRASS 6.2:

r.out.gdal in=nz25 type=Byte createopt="INTERLEAVE=PIXEL,TFW=YES,COMPRESS=PACKBITS" out=nz25_NZMG_gdal_IntPix_Pacbits_crop.tif -r

#7 Updated by anonymous - over 17 years ago

The crash report suggests that the problem is with gdal, not qgis. Your comments also suggest that you're using gdal 1.3.1? There is a later version available that may fix this problem (v1.3.2). Please try that if possible.

#8 Updated by Gary Sherman over 17 years ago

  • Status changed from Open to Closed
  • Resolution set to fixed

The test file works fine for me with latest OS X build, using GDAL 1.31 on a G4 powerbook with 512Mb ram.

I'm closing this ticket but it can be reopened if the problem persists for you in the upcoming preview 3 release.

#9 Updated by anonymous - over 17 years ago

Ok, I will retry when OSX binaries for pre3 show up.

Hamish

#10 Updated by anonymous - over 17 years ago

The crash report suggests that the problem is with gdal, not qgis.
Your comments also suggest that you're using gdal 1.3.1? There is
a later version available that may fix this problem (v1.3.2).
Please try that if possible.

That is I used GDAL 1.3.1 on Debian/Stable to make the GeoTIFF.
[I have been waiting for the DebianGIS project to release a GDAL 1.3.2 package for Sarge, but I don't think this is going to happen, so I wait for the next full Debian release (soonish).]

I have just now tried re-exporting the GeoTIFF using GDAL 1.3.2 by loading the GeoTIFF into GRASS 6.2.1 on the same Mac (no problems), then re-exporting using r.out.gdal (r.out.gdal is just a script front-end to gdal_translate)). Same Bus Error with the new copy.

The Mac where this fails has GDAL 1.3.2 existing both in the GRASS Frameworks[*] and QGIS 0.8pre2's libgdal1.dynlib 1.3.2.0.

[*] version 17-Dec-2006

Hamish

#11 Updated by hamish_nospam-yahoo-com - about 17 years ago

  • Status changed from Closed to Feedback
  • Resolution deleted (fixed)

Hi,

it still crashes with the 0.8.0 release, uploading latest crash info as bug attachment and reopening the bug.

(using Tom Elwertowski's binaries; William's GRASS binaries + frameworks installed on the same machine)

thanks,
Hamish

#12 Updated by Frank Warmerdam - over 16 years ago

I have reviewed the traceback and this section:

1   libjasper-1.701.1.dylib     0x02507634 GTIFGetGCSInfo + 116
2   libgdal.1.dylib             0x01bcd550 GTIFGetOGISDefn + 352

suggests that the build uses the jasper library which has (apparently) a copy of libgeotiff embedded but (presumably) a somewhat different version than is embeded or expected to be used by GDAL. This results in a crash when something is where it is expected. Basically it is very bad karma to have two versions of something like libgeotiff in an application and can result in suprising calls between the two binary incompatible instances.

The solution (IMHO) is that libjasper should be linked against a system libgeotiff instead of using an embedded copy. I don't see this as a QGIS bug - it is a particular issue with the way the packages QGIS depends on have been built. My suggestion is that this bug report be closed, possibly after referring to whoever is behind the build (William?)

#13 Updated by Tim Sutton about 16 years ago

  • Status changed from Feedback to Closed
  • Resolution set to wontfix

As suggested, I have sent William an email asking him to take note of this ticket, and am closing this ticket.

#14 Updated by William Kyngesburye about 16 years ago

Hmm, works on my recent 0.9.1 and 0.9.2 binaries. They use GDAL 1.5, libtiff 4 SVN, geotiff 1.2.4. The 0.8.x referred to are probably Tom's all-in-one, since my Qgis binaries use my frameworks. I don't have an extra Mac handy to test my old 0.8 binaries on this, which use GDAL 1.4.

libjasper doesn't link to geotiff or libtiff, as far as I know.

I do remember (kinda hazy, though I reported it) some libtiff crashes when saving with some compressions, but not opening. That was around the GDAL 1.3.1 time - libtiff 3.7-3.8. It was slowly fixed and is fine in 3.9/4.0.

... just a few thoughts. All I can suggest is upgrade to Qgis 0.9.x with latest libraries/frameworks.

#15 Updated by hamish - about 16 years ago

William:

Hmm, works on my recent 0.9.1 and 0.9.2 binaries.

...

All I can suggest is upgrade to Qgis 0.9.x with latest libraries/frameworks.

Ok, I will try that and report back.

thanks,
Hamish

#16 Updated by hamish - about 16 years ago

Hi,

I have just installed 0.9.1 from
http://download.osgeo.org/qgis/mac/qgis-0.9.1.dmg.gz
and it still crashes. :-(

I am not sure if this package is William derived or not, or if that package is all-in-one and includes new frameworks or is somehow depending on what it has already found on the machine.

Also on the same machine is an older copy of GRASS 6.2.1 & William's "all frameworks" from whenever that was installed. I see:
Library/Frameworks/GDAL.framework/Versions/1.3

New crash log attached. The libjasper part is the same as quoted by Frank.

thanks,
Hamish

#17 Updated by William Kyngesburye about 16 years ago

Replying to [comment:21 hamish]:

I have just installed 0.9.1 from
http://download.osgeo.org/qgis/mac/qgis-0.9.1.dmg.gz
and it still crashes. :-(

I am not sure if this package is William derived or not, or if that package is all-in-one and includes new frameworks or is somehow depending on what it has already found on the machine.

This is Tom's (Elertowski) all-in-one. GDAL is bundled inside the app as a Unix library, and any installed GDAL framework or lbrary will be ignored. I don't know which version of GDAL he used.

#18 Updated by Tom Elwertowski about 16 years ago

  • Status changed from Closed to Feedback
  • Resolution deleted (wontfix)

Frank appears to have identified the problem. I had not realized until now that a copy of geotiff is embedded in the jasper lib used by all recent QGIS/Mac all-in-one builds.

In July 2006, I was informed that I was using an obsolete version of jasper and should use one from http://www.dimin.net/software/geojasper/. As a result of Frank's comment, I now see it contains embedded geotiff code with no option to configure as internal or external.

I am switching to the jasper distribution provided by Frank on the GDAL site. I suspect this will work. I am able to open the supplied tif file using William's UnixImageIO framework. The jasper distribution version William uses matches Frank's distribution s I suspect that when I switch and rebuild (which I won't get to for a day or two), the problem will be fixed.

#19 Updated by Tom Elwertowski about 16 years ago

  • Status changed from Feedback to Open

#20 Updated by hamish - about 16 years ago

Just to report:

William's 0.9.1 Tiger binaries + latest frameworks fixes this for me.

I await Tom's new binaries, I'll test them when they arrive and then we can put this puppy to sleep.

Hamish

#21 Updated by hamish - about 16 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

I have now tested Tom's brand new qgis-0.9.2rc1.dmg.gz.

Success!

good stuff guys, thanks. Closing the bug.

Hamish

#22 Updated by Anonymous over 14 years ago

Milestone Version 0.9.2 deleted

Also available in: Atom PDF