Open ignatz opened 2 weeks ago
Still haven't gotten around to spend much more time on this but at least I wanted to share a minimal reproduction with you: https://github.com/ignatz/libsql_ext
Hi @ignatz! Thanks for the reproduction example - this really helps and simplify process of debugging the issue!
I guess I found an issue in libsql
code but fix is rather simple (although this is pretty nasty bug, I guess): https://github.com/tursodatabase/libsql/pull/1477
BTW, it seems to me that libsql
is already build with SQLITE_ENABLE_LOAD_EXTENSION=1
(see https://github.com/tursodatabase/libsql/blob/main/libsql-ffi/build.rs#L115). So I guess you should be able to load your extensions even when bug in load_extension_enable
/load_extension_disable
is here.
:clap:
Is there any particular reason why you folks rely on sqlite3_db_config, it seems you're bindgening also the type-safe bindings: https://github.com/tursodatabase/libsql/blob/fbce426619c3fe95db858859453614835704d017/libsql-ffi/bundled/bindings/bindgen.rs#L2096 ?
sqlite3_enable_load_extension
works bit differently as it enables both C API and SQL function load_extension
while sqlite3_db_config
allow libsql to have more fine grained control over enabled features.
But actually I don't have any context here, so maybe @MarinPostma can comment on this is more details.
Hi folks,
I was enjoying the recent addition of extension loading. Everything worked smoothly with the simple "sqlite/ext/misc/uuid.c".
However, when building in release mode, I suddenly get a segmentation fault. I played with the different build profiles to further narrow it down. Even when building with debug presets and just bumping opt-level from zero to one, does it for me.
Throwing it in the debugger leads to
or the entire function in question
I haven't looked more into it yet, since it's getting late but maybe there's something that sticks out to you folks.