Comments (10)
That does fix it.
from go-dqlite.
Try passing -tags libsqlite3
? I don't know if there's some magic in this Go application to use the share library, but if not, without that tag, you may end up using an incorrect libsqlite3.
from go-dqlite.
What @stgraber says.
Quoting https://github.com/canonical/go-dqlite/#demo :
"
or build the dqlite C library and its dependencies from source, as described here, and then run:
go install -tags libsqlite3 ./cmd/dqlite-demo
"
from go-dqlite.
That's interesting. I don't know how that works :)
$ go install -tags libsqlite3 ./cmd/dqlite-demo
$ dqlite-demo -a 127.0.0.1:5005 -db 127.0.0.1:5006
Error: failed to set bind address
^^ it got rid of the segfault, but now I believe I'm getting the same issue I have in my rust project, related to: canonical/dqlite#218
from go-dqlite.
Would it be possible for you to clone the C dqlite repository, build it from source and try the C code snippet I pasted in canonical/dqlite#218 ?
If that does work, then it might be something odd in the arch package. If that does not work I'll send you a patch to debug the issue.
from go-dqlite.
I was currently replying to the other issue :) The code you pasted in canonical/dqlite#218 works fine on my machine. Which is very puzzling.
I've compiled the library locally before to try it out (added the debug flag to try and figure out why this would be happening too), but it showed the same behavior. (I had completely uninstalled the arch package to make sure it wasn't being used)
I'll try again
from go-dqlite.
I just did again.
Now I get slightly different behaviour:
$ go run -tags libsqlite3 ./cmd/dqlite-demo/dqlite-demo.go -a 127.0.0.1:5005 -db 127.0.0.1:5006
# github.com/canonical/go-dqlite/internal/bindings
/usr/bin/ld: /usr/local/lib/libdqlite.so: undefined reference to `sqlite3_wal_replication_frames'
/usr/bin/ld: /usr/local/lib/libdqlite.so: undefined reference to `sqlite3_wal_replication_enabled'
/usr/bin/ld: /usr/local/lib/libdqlite.so: undefined reference to `sqlite3_wal_replication_leader'
/usr/bin/ld: /usr/local/lib/libdqlite.so: undefined reference to `sqlite3_wal_replication_undo'
/usr/bin/ld: /usr/local/lib/libdqlite.so: undefined reference to `sqlite3_wal_replication_unregister'
/usr/bin/ld: /usr/local/lib/libdqlite.so: undefined reference to `sqlite3_wal_replication_follower'
/usr/bin/ld: /usr/local/lib/libdqlite.so: undefined reference to `sqlite3_wal_replication_register'
collect2: error: ld returned 1 exit status
so I set some env vars:
$ LD_LIBRARY_PATH=/usr/lib/sqlite-replication/:/usr/local/lib/ CGO_LDFLAGS=-L/usr/lib/sqlite-replication/ go run -tags libsqlite3 ./cmd/dqlite-demo/dqlite-demo.go -a 127.0.0.1:5005 -db 127.0.0.1:5006
Error: failed to set bind address
(dqlite compiled from source and using make install
installed the lib in /usr/local/lib by default. The arch package I installed before put it in /usr/lib, so I have to specific that env var to get to the new package)
Edit: The code you provided in canonical/dqlite#218 still works!
from go-dqlite.
If that code works, it means there's something odd in the arch package. Maybe it's actually not v1.4.1?
Instead of go run
try to use go build
, then launch the compiled binary using the env variables you pasted. I'm not totally sure go run
passes those envs across.
If that still does not work, try to locate the libdqlite.so.0.0.1
file shipped in your arch package and replace it with the one you built by hand (you find it under the ./libs
directory of your git checkout).
from go-dqlite.
The code in canonical/dqlite#218 works with both the arch package and the lib compiled from source. So this doesn't look like my install is wrong.
Since there are no segfaults and no undefined symbols errors, I'm assuming it's using the correct libraries. If it's not using the right sqlite3 lib, I usually get things like /usr/bin/ld: /usr/local/lib/libdqlite.so: undefined reference to 'sqlite3_wal_replication_frames'
. If it can't find dqlite, I get dqlite-demo: error while loading shared libraries: libdqlite.so.0: cannot open shared object file: No such file or directory
As far as I can tell both the pre-compiled lib from the arch package and my own compiled-from-source lib have the same behavior: the code from canonical/dqlite#218 works perfectly, the go-dqlite demo "failed to set bind address" and my own rust implementation also fails to set the bind address.
The initial segfault I reported in this issue was fixed by adding -tags libsqlite3
to either go run
, go build
or go install
.
This is very mysterious.
from go-dqlite.
As far as I can tell both the pre-compiled lib from the arch package and my own compiled-from-source lib have the same behavior: the code from canonical/dqlite#218 works perfectly, the go-dqlite demo "failed to set bind address" and my own rust implementation also fails to set the bind address.
Please can you try with:
dqlite-demo -a 127.0.0.1:5005 --db 127.0.0.1:5006
note the --db (double dash) instead of -db (single dash). I can reproduce your problem with the single dash, so it might be an argument parsing issue.
from go-dqlite.
Related Issues (20)
- Log Start and End of requests
- Handover tests are flaky
- Segfault on s390x inside yaml.v3 HOT 2
- sql.DB instances hang forever when database is unreachable HOT 20
- TestParallelNewApp: inconsistent cluster.yaml and info.yaml
- Allow WithExternalConn use any net.Conn instance HOT 4
- Shell: Support for WITH clauses (or more complex queries) HOT 7
- Shell: Provide .help
- Expose WithTracing option in app options HOT 3
- Expose an operation to remove a node from the cluster HOT 2
- RowsAffected not returning correct value for UPDATE HOT 4
- Upgrade from yaml.v2 to yaml.v3
- Issues with sharing a connection between statements (?) HOT 4
- Client Error Handling needs improvement HOT 10
- Jepsen failure: EOF when calling Open HOT 1
- Return error in driver.BeginTx if options aren't used/required or incorrect.
- Role re-shuffling for failure domains
- Shortcomings of sortCandidates
- TestIntegration_LeadershipTransfer CI failures HOT 2
- restore dqlite state from snapshot HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-dqlite.