SQLite Forum

Segmentation fault with embedded python framework
Login

Segmentation fault with embedded python framework

(1) By SylvainPer on 2020-10-09 15:52:39 [link] [source]

Hello, I'm using a C program (domoticz) with embedded python plugins. This program uses SQLite-Amalgamation for its own purposes, a database with the devices, options... In a python plugin, we need to use SQLite to allow the plugin to have its own database. The plugin causes a segmentation fault on some request. The creation is going well but it seems that some PRAGMA request are not managed correctly.

By using a debugger, we saw that the following code order is causing the problem: domoticz (CPlugin) > Python (libpython3.7) > pysqlite > libsqlite3.so > sqlite3.c (from sqlite-amalgamation):

Screenshot

It seems that there is a mix between the 2 SQLite libraries and have different version. Do you know what can cause this problem and what can we do ?

Thanks.

(2) By Gunter Hick (gunter_hick) on 2020-10-12 06:18:17 in reply to 1 [source]

Use only 1 Version of SQLite in your application.

https://sqlite.org/howtocorrupt.html#multiple_copies_of_sqlite_linked_into_the_same_application