Closed Algunenano closed 4 years ago
I've reduced the range to:
So it seems that the issue was introduced by e873aa230b2f960b9d5076d3849870c00387f096 to fix https://github.com/OSGeo/gdal/issues/2691. It was backported to release/3.1 as dfe2a31053ca67dc93cc7be1ed2759a74d493944
I'm building master + revert of e873aa230b to confirm if that fixes it.
I can confirm that current HEAD + revert of e873aa230b fixes the crash.
In my local environment the backtrace is not exactly the same, but it looks pretty similar. Here is it in case it helps:
Actually PROJ would not be supposed to crash, as a NULL context should normally be interpreted as the default context, so there's an issue in it, but here it is good to see that it spots the NULL context, because using the NULL context is not thread-safe, so the issue on GDAL side must be better understood & adressed.
Can you reproduce this with gdalinfo on a GeoTIFF file ?
Aparently not. I've extracted the tiff from the test file, (attached as a compressed img.zip) and gdalinfo is ok with it:
Driver: GTiff/GeoTIFF
Files: img.tiff
Size is 10, 10
Coordinate System is:
GEOGCRS["NAD83",
DATUM["North American Datum 1983",
ELLIPSOID["GRS 1980",6378137,298.257222101004,
LENGTHUNIT["metre",1]]],
PRIMEM["Greenwich",0,
ANGLEUNIT["degree",0.0174532925199433]],
CS[ellipsoidal,2],
AXIS["geodetic latitude (Lat)",north,
ORDER[1],
ANGLEUNIT["degree",0.0174532925199433]],
AXIS["geodetic longitude (Lon)",east,
ORDER[2],
ANGLEUNIT["degree",0.0174532925199433]],
ID["EPSG",4269]]
Data axis to CRS axis mapping: 2,1
Origin = (-168.000000000000000,85.000000000000000)
Pixel Size = (0.083000000000000,-0.083000000000000)
Metadata:
AREA_OR_POINT=Area
TIFFTAG_DATETIME=2012:03:02 09:59:31
TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
TIFFTAG_SOFTWARE=Adobe Photoshop CS Windows
TIFFTAG_XRESOLUTION=96
TIFFTAG_YRESOLUTION=96
Image Structure Metadata:
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left (-168.0000000, 85.0000000) (168d 0' 0.00"W, 85d 0' 0.00"N)
Lower Left (-168.0000000, 84.1700000) (168d 0' 0.00"W, 84d10'12.00"N)
Upper Right (-167.1700000, 85.0000000) (167d10'12.00"W, 85d 0' 0.00"N)
Lower Right (-167.1700000, 84.1700000) (167d10'12.00"W, 84d10'12.00"N)
Center (-167.5850000, 84.5850000) (167d35' 6.00"W, 84d35' 6.00"N)
Band 1 Block=10x10 Type=Byte, ColorInterp=Red
Band 2 Block=10x10 Type=Byte, ColorInterp=Green
Band 3 Block=10x10 Type=Byte, ColorInterp=Blue
What is your compiler & operating system version ?
I've only tested 2 environments different environments, both Linux and both break:
and do you manage to reproduce with command line raster2pgsql ?
and do you manage to reproduce with command line raster2pgsql ?
That seems fine:
$ ./raster/loader/raster2pgsql ~/issues/raster_crash/img.tiff
Processing 1/1: /home/raul/issues/raster_crash/img.tiff
BEGIN;
CREATE TABLE "img" ("rid" serial PRIMARY KEY,"rast" raster);
INSERT INTO "img" ("rast") VALUES ('0100000300736891ED7C3FB53F736891ED7C3FB5BF00000000000065C0000000000040554000000000000000000000000000000000AD1000000A000A00040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'::raster);
END;
This is the standalone SQL query that reproduces the issue:
SELECT ST_FromGDALRaster(E'\\x49492a0008000000150000010300010000000a00000001010300010000000a00000002010300030000001a01000003010300010000000100000006010300010000000200000011010400010000001502000015010300010000000300000016010300010000000a00000017010400010000002c0100001a010500010000000a0100001b01050001000000120100001c0103000100000001000000280103000100000002000000310102001b0000003a0100003201020014000000260100005301030003000000200100000e830c00030000005601000082840c00060000006e010000af870300240000009e010000b0870c0005000000e6010000b1870200070000000e0200000000000060000000010000006000000001000000080008000800010001000100323031323a30333a30322030393a35393a33310041646f62652050686f746f73686f702043532057696e646f77730000736891ed7c3fb53f736891ed7c3fb53f000000000000000000000000000000000000000000000000000000000000000000000000000065c000000000004055400000000000000000010001000000080000040000010002000104000001000100000800000100ad100108b187060000000608000001008e230908b087010001000b08b087010000000e08b08703000200a8f9eb941da4724000000040a65458410000000000000000000000000000000000000000000000004e414438337c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'::bytea) AS rast;
Reproduced, understood and fix submitted in https://github.com/OSGeo/gdal/pull/2746
The CI is happy now. Thanks a lot!
Expected behavior and actual behavior.
While preparing newer Postgis test images I'm seeing a crash in its regress tests under in a call to GDALGetProjectionRef.
You can see some Travis logs under: https://travis-ci.org/github/Algunenano/postgis/builds/702420642
It crashes both with:
release/3.1
branch, PROJ7.1
branch. Example build with backtrace at the end.master
, PROJmaster
. Example build with backtrace at the end.Extract from the callstack:
Last known good
master
build (not super recent I know): GDAL: GDAL 3.2.0dev-60a090a-dirty, released 2020/05/08Current master build, which is crashing: GDAL: GDAL 3.2.0dev-69b0c4e-dirty, released 2020/06/25
I've managed to reproduce the issue locally so I'm trying to bisect the issue to pinpoint the specific commit, but it might take some time (there are ~500 commits between the 2 of them, and building gdal is not particularly fast :D). Any pointers as to what to build or test might save me tons of time.
Steps to reproduce the problem.
Under Postgis build tree already built
./raster/test/regress
run:Operating system
Linux. The travis build are using
debian:unstable-slim
and my local version is running under ArchLinux.GDAL version and provenance
Both 3.1 and master seem to be affected. Not seeing the issue with GDAL 3.0 + PROJ master (7.1.0.r13.g42b9c119a) or PROJ 6.3.1 (tag).