On Fri, 15 May 2015 04:48:16 -0700 (PDT),
linux...@gmail.com wrote:
> After libspatialite & spatialite-tools 4.1.1 were rebuild for the
> libproj 4.9.1 transition in Debian spatialite_init() gets a segfault:
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x00007ffff787fff4 in spatialite_init (verbose=1) at
> spatialite_init.c:114
> 114 sqlite3_auto_extension ((void (*)(void))
> init_spatialite_extension);
>
Hi Bas,
that's not too much surprising: spatialite_init() is now
deprecated because this method was intrinsically not
reentrant and thus not thread safe.
> I'm a bit at a loss of what change(s) in 4.2.1 fix the issue. The big
> difference I found is the use of spatialite_init_ex() in 4.2.1, GDAL
> uses that too for spatialite >= 4.1.2.
>
spatialite_init_ex() is a full replacement for spatialite_init();
the main difference is in that the new method is thread safe and
effectively supports the more recent thread-safe APIs available
on both GEOS and PROJ.4
> I need to fix the issue in spatialite 4.1.1 to prevent all reverse
> dependencies of libspatialite (gdal, qgis, etc) from being removed
> from Debian testing.
>
> Any suggestions where to look for the problematic code, and possible
> solutions?
>
Please see the attached patch; it's simply intended to support
spatialite_init_ex() on the old 4.1.1 shell.c
I've tested it on Jessie 686-PAE using proj-4.9.1 and it seems
to resolve any issue; Valgrind confirms an absolutely clean run.
bye Sandro