In tea/configure.ac why isn't --with-system-sqlite default on linux?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

In tea/configure.ac why isn't --with-system-sqlite default on linux?

Peter da Silva
So I was doing some work with another Tcl extension (Pgtcl) that was linking to libsqlite3. It worked fine on FreeBSD but on Linux (Ubuntu 4.13.0-27 generic) it crashed. We traced that down to it having two copies of libsqlite linked in, the one in the sqlite3 extension (libsqlite3.24.0.so) and the system sqlite that pgtcl found in /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6...

Forcing it to make libsqlite3.24.0.so just the Tcl glue to libsqlite3.so.0.8.6 with ./configure --with-system-sqlite did the trick, but I’m just wondering why that wouldn’t be the normal way to do things.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: In tea/configure.ac why isn't --with-system-sqlite default on linux?

Warren Young
On Jul 30, 2018, at 2:26 PM, Peter Da Silva <[hidden email]> wrote:
>
> It worked fine on FreeBSD but on Linux (Ubuntu 4.13.0-27 generic) it crashed. We traced that down to it having two copies of libsqlite linked in

There can be a bunch of reasons for that crash, basically due to differing ways they’re built, so that the two implementations end up conflicting.  I’ve had such trouble in the past over two separately-sourced SQLites fighting over locking, and I could see it happening in other areas like shared memory.

> Forcing it to make libsqlite3.24.0.so just the Tcl glue to libsqlite3.so.0.8.6 with ./configure --with-system-sqlite did the trick, but I’m just wondering why that wouldn’t be the normal way to do things.

You may be building on a system where they’ve still got SQLite 3.7.mumble installed, which is still a large number of systems, due to the long lifetime of the 3.7 line.

You may have noticed the continual pressure on this mailing list to be using recent versions of SQLite.  One way to ensure that is to always statically link.

Living by that sword can see you cut on that same sword, of course, since then you may end up having to rebuild half of your world when you want to upgrade SQLite.  Ask the Go people how statically linking everything works out in practice. :)

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: In tea/configure.ac why isn't --with-system-sqlite default on linux?

Peter da Silva
In reply to this post by Peter da Silva
> You may be building on a system where they’ve still got SQLite 3.7.mumble installed

In this case there are not two implementations present. Both libsqlite3.24.0.so and libsqlite3.so.0.8.6 were built from sqlite-autoconf-3240000. This is the only copy of libsqlite3 anywhere on the system.

> You may have noticed the continual pressure on this mailing list to be using recent versions of SQLite.  One way to ensure that is to always statically link.

That’s not an option, Tcl extensions are inherently dynamically loaded. If you use two Tcl extensions that call sqlite you need to ensure that both dynamically link to the same copy of the library. Not just the same version, the same copy, because they need to be operating on the same memory allocation arena and other globals.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: In tea/configure.ac why isn't --with-system-sqlite default on linux?

Peter da Silva
This is also a problem on FreeBSD, I just haven’t noticed it because the ports guys are on top of keeping their sqlite3 build up to date, and they do the smart thing and build --with-system-sqlite.

If you’re building sqlite-autoconf-3xxxxxx/tea, then why would the “system sqlite” ever be anything but current? Why would you install the Tcl extension but not the library itself?
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users