sqlite-fts-python
sqlite-fts-python copied to clipboard
segv if a python interpreter doesn't have separate _sqlite3
python interpreters fetched from python-build-standalone (by rye) crash 100%. it occurs for all versions I tested locally 3.9, 3.10, 3.11, 3.12 on an Arch Linux VM x86-64.
it also happens on Debian aarch64.
always this line. FTS3 works fine.
File "/home/hideaki/sqlite-fts-python/sqlitefts/fts5.py", line 156 in fts5_api_from_db
windows version interpreters don't seem to be affected. also Arch Linux's python package (3.11.7-1) is okay too.
this is due to statically linked _sqlite3.so in libpython3.*.so, thus __file__
attribute doesn't exist for _sqlite3
.
it fallbacks to libsqlite3.so then hits the SEGV. so it's a similar issue to #19 and #30.
sqlite3 is also linked into libpython, so dlopen won't work, because APIs used by this package are local symbol; unable to resolve those symbols.
$ nm ~/.rye/py/cpython\@3.12.1/install/lib/libpython3.12.so.1.0 | grep sqlite3_prepare_v2
0000000000b06f80 t sqlite3_prepare_v2