[postgis-users] If PostGIS (with GDAL) installed, writing TIFF through GraphicsMagick crashes on Ubuntu

Tom Kazimiers tom at voodoo-arts.net
Wed Nov 4 08:33:00 PST 2015


Hi all,

I hope this is the right place to ask, please let me know if it isn't.
PostGIS is involved in this problem, but I am unsure whether it is
actually the source of it. I hope you can help me figuring out what is
going on with a crash I encounter in a Python program running on Ubuntu
12.04.5 when PostGIS is installed (installed version
2.1.8+dfsg-5~97.git43a09cc.pgdg12.4+1 from Postgres repo). This program
writes a TIFF file (containing JPEG data) through GraphicsMagic (using
pgmagick). This worked fine in the past, but since we started to use
PostGIS, which depends on GDAL, TIFF  writing fails and it is unclear
to me why. This is the relevant part of the backtrace:

*** glibc detected *** python: realloc(): invalid pointer:
0x00007f136fd4a208 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7e846)[0x7f137be35846]
/lib/x86_64-linux-gnu/libc.so.6(realloc+0x28e)[0x7f137be3a59e]
/usr/lib/libgdal.so.1(_TIFFCheckRealloc+0x4f)[0x7f1375b56bcf]
/usr/lib/libgdal.so.1(_TIFFMergeFields+0x106)[0x7f1375b5d216]
/usr/lib/libgdal.so.1(TIFFInitJPEG+0x21)[0x7f1375b7af51]
/usr/lib/x86_64-linux-gnu/libtiff.so.4(+0xa2d9)[0x7f136faf32d9]
/usr/lib/x86_64-linux-gnu/libtiff.so.4(TIFFSetField+0x87)[0x7f136faf4b57]
/usr/lib/libGraphicsMagick.so.3(+0x21d623)[0x7f136a077623]
/usr/lib/libGraphicsMagick.so.3(WriteImage+0x153)[0x7f1369f20533]
/usr/lib/libGraphicsMagick.so.3(WriteImages+0x12a)[0x7f1369f20b8a]

As you can see, a call to GDAL's TIFFInitJPEG through LibTIFF and
GraphicsMagick. Why would this happen in the first place? Does the
GDAL version coming with PostGIS somehow interfer with the TIFF
library? As far as I can tell, the installed LibTiff is the regular
libtiff4 package (version 3.9.5-2ubuntu1.8) and looking at it with
ldd doesn't show any link to GDAL:

$ ldd /usr/lib/x86_64-linux-gnu/libtiff.so.4
linux-vdso.so.1 =>  (0x00007fff25190000)
libjpeg.so.8 => /usr/lib/x86_64-linux-gnu/libjpeg.so.8
(0x00007fcc0955d000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fcc09346000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fcc09049000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fcc08c8a000)

I also only installed a regular gdal1 package (version
1.9.0-3.1~pgdg12.4+1) from the PostGIS repos.

Did you maybe ever see something similar or have a suggestion on
what  might trigger this or I could continue debugging? I'd be
grateful any any ideas or comments.

Thanks,
Tom


More information about the postgis-users mailing list