On Sat, 23 Oct 2021 02:23:18 -0700 (PDT), 'Ion Tichy' via SpatiaLite
Users wrote:
> # Problematic frame:
> # C [libsqlite3.dylib+0xc6882] checkMutexEnter+0x12
>
few months ago we had a ticket reporting a possibly related issue:
https://www.gaia-gis.it/fossil/libspatialite/tktview?name=3df8b6c54f
as you can see the problem was caused by the CLANG compiler when
activating a Mutex lock, an operation that libspatialite performs
just in a single point when establishing a new connection.
curiously enough the same problem never arose when using a copy
of libspatialite compiled by GCC; it could be just a coincidence,
but it's worth noting that standard compiler on Mac is just CLANG.
we resolved the bug (that was reported on Windows) by avoiding
to call Mutexes provided by libpthread and always using the
native platform implementation as a full replacement, but
this isn't obviously a viable solution on Mac.
> I tried to compile older versions of libspatialite from source, but
> the dilemma is that these installations do not produce
> `mod_spatialite.dylib` which seems to be essential for things to work
> on our end (only mod_spatialite.so is produced on mac).
>
.dylib is a strange thing that only Mac has.
my personal experience on Mac goes back many years, but if I remember
correctly simply renaming mod_spatialite.so as mod_spatialite.dylib
(or better yet, define a symlink) should probably solve this issue.
if you are loocking for a more elegant solution it seems that
the Mac compiler simply require to receive a -dynamiclib
directive in order to create a .dylib instead of a .so
please see:
https://stackoverflow.com/questions/2339679/what-are-the-differences-between-so-and-dylib-on-macos
bye Sandro