Hi:

I'm on Centos 6.8 latest, x86-84.

$ uname -a
Linux  (stubbed out) 2.6.32-642.3.1.el6.x86_64 #1 SMP Tue Jul 12 18:30:56
UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ rpm -qa sqlite
sqlite-3.6.20-1.el6_7.2.i686
sqlite-3.6.20-1.el6_7.2.x86_64

I have a strange issue that I was hoping familiar with sqlite3 innards
could explain to me.

I have the following application that does this:

Thread 1 - sqlite3_exec("SELECT column FROM table1;")

Thread 2 - sqlite3_exec("BEGIN EXCLUSIVE;") -> sqlite3_exec("iNSERT INTO
table2 VALUES (number)" -> sqlite3_exec("COMMIT;")

My queries are very basic, take no callback, and are valid at the time of
execution (verified by gdb).
Also, both have separate handles to the database, i.e. both use
sqlite3_open() to establish a connection.

When these two threads execute at the same time however, it appears that
sqlite3 SIGSEGV's deep in the heart of prepare, step, etc.

However, if I open the database with SQLITE3_NOMUTEX|SQLITE3_PRIVATECACHE
using sqlite3_open_v2() on 3.6.20-1 everything works (this was suggested by
a colleague) OR if I download the latest version (3.15 etc.) and set my
LD_LIBRARY_PATH to use it, no crash.

Were their patches in this area by chance that did not get into 3.6.20-1
(which was built fairly recently by the CentOS folks) which may cause a
crash? Or am I using it sqlite3 open incorerctly (assuming that multiple
threads can all call sqlite3_open() freely and go to town).

Thanks!

-aps
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to