-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SEGFAULT in statically-linked extension #18
Comments
With inputs from @anacrolix and some additional help from If we look at the In case of static-linked extension, Again, looking at the |
Sorry if it wasn't clear, but I'd already worked out the cause for the segfault ( |
Ah! my bad 😓 I just wanted to add a detailed report about the SEGFAULT based on the comments that popped up in different threads. I've edited the previous comments to reflect that 🙌 |
Based on my previous comment in #2, some static-linking scenarios are supported right now, notably where you use
sqlite3_auto_extension()
to auto-load the extension for every new database connection. This approach works but is not suitable for all the use cases.One such use-case is when you want to register the extension manually in Golang, which is what I believe @anacrolix has tried in #16 and also outlined in this comment.
Based on inputs from @anacrolix (#2 (comment) and #16 (comment)) and also in my own analysis, I've seen the extension building fine (following the steps outlined below) but crashing at runtime with a
SEGFAULT
(illegal memory access).We can reproduce the error based on a simple extension (using
_examples/upper/upper.go
) and using a modified version ofcrawshaw.io/sqlite
that allow exposing the underlying connection object (somewhat similar tocrawshaw:sqlite:master...anacrolix:crawshaw-sqlite:master
)Using a helper function similar to following, we can register the extension:
On the application side, after opening a new connection (using
crawshaw.io/sqlite
), we can manually callRegisterWith()
to register the extension:To build this, run the following command:
It builds just fine, but when executed it fails with a
SEGFAULT
exception:The text was updated successfully, but these errors were encountered: