-
-
Notifications
You must be signed in to change notification settings - Fork 21
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 on debian aarch64 (raspberry pi) #89
Comments
So loading the binary works fine but trying to create Database object and using it results in segmentation fault? I don't have any Aarch64 Linux machine so this one would be hard to debug for me (VM is an option though). |
Could you try building sqlite 3.40.1 locally and try using that binary? |
I've managed to make SQLite3 ARM64 builds on CI but from my testing on QEMU locally, trying to load and call any SQLite lib function fails via Deno FFI regardless of its built in or custom built. This might be actually a problem with Deno (or its FFI) on ARM64. Anyhow, I'll try including Linux Arm64 binaries in next release, still worth trying out. |
The custom-built SQLite works perfectly fine in QEMU Aarch64. This must be a problem with Deno FFI on Aarch64 because even a simple |
I guess you can close this issue now, as since with newer version of sqlite3, at least More info in here: |
Oh that's great! I think we should update sqlite3 version in the repo now and publish new build for linux arm64. I'll try doing it over the weekend. |
Where did you get your deno and what version it is? I'm using this one:
Since it's not officially supported I humbly stole it from this great guy: |
Got Deno for Linux aarch64 from the same place. |
Hi there, would love to help out with this issue. I have a Hetzner CAX21 aarch64 machine so I'm happy to test anything, and I'm decent at research/debugging/writing code. Currently, I can confirm sqlite 3.44.0 from debian unstable is not working (same issue, segfault). This was on Deno 1.38.2. sid@arm-chan:~/shans-guestbook$ deno run -A --unstable src/main.ts
Segmentation fault
sid@arm-chan:~/shans-guestbook$ sqlite3 --version
3.44.0 2023-11-01 11:23:50 17129ba1ff7f0daf37100ee82d507aef7827cf38de1866e2633096ae6ad8alt1 (64-bit)
sid@arm-chan:~/shans-guestbook$ deno --version
deno 1.38.2 (release, aarch64-unknown-linux-gnu)
v8 12.0.267.1
typescript 5.2.2 |
Can also confirm minimal example from https://docs.deno.com/runtime/manual/runtime/ffi_api works. Will be trying sqlite3 next. |
@xyzshantaram did that work? You can try calling sqlite3_version function from both system sqlite and the sqlite aarch64 linux binary from GitHub releases in this repo, using Deno FFI. |
#include <stdio.h>
#include <sqlite3.h>
void select_version() {
sqlite3 *db;
char *err_msg = 0;
int rc = sqlite3_open(":memory:", &db);
if (rc != SQLITE_OK) {
fprintf(stderr, "Cannot open database: %s\n", sqlite3_errmsg(db));
sqlite3_close(db);
return;
}
rc = sqlite3_exec(db, "SELECT SQLITE_VERSION()", 0, 0, &err_msg);
if (rc != SQLITE_OK) {
fprintf(stderr, "Failed to execute query: %s\n", sqlite3_errmsg(db));
sqlite3_free(err_msg);
} else {
printf("err_msg: %s\n", err_msg);
sqlite3_free(err_msg);
}
sqlite3_close(db);
} While running this via FFI, |
Installed sqlite3
3.34.1
and ran:export DENO_SQLITE_PATH="/usr/lib/aarch64-linux-gnu/libsqlite3.so"
deno run -A --unstable app.ts
Result is a segfault when trying to use any sqlite3 functionality
The text was updated successfully, but these errors were encountered: