mongo.cr
mongo.cr copied to clipboard
Not working with libmongoc 1.3 or 1.5(latest release)
Invalid memory access (signal 11) at address 0xa0 [4496293] *CallStack::print_backtrace:Int32 +117 [4468520] __crystal_sigfault_handler +56 [4875304] sigfault_handler +40 [139785657689056] ??? [139785662203494] ??? [139785662203690] mongoc_client_new +58 [4756622] *Mongo::Client#initialize<String>:Nil +30 [4756561] *Mongo::Client::new<String>:Mongo::Client +81 [4450987] ???
Please post the source code to reproduce. Thanks.
require "./mongo.cr"
client = Mongo::Client.new "mongodb://localhost"
db = client["mydb"]
collection = db["places"]
collection.find({"name" => "Coffee"}) do |doc|
puts doc
en
Just used this code and it works for me. Not sure what the issue is.
@datanoise I had the same issue, I asked some guys from waterlink that has the sam Issue.
@dimparf It seems to be the version of mongoc isn't new enough in the source
For future people who have this problem, solve it by installing these packages (using ubuntu 18.04)
sudo apt install libmongoc-dev libmongoc-1.0-0 libmongoclient-dev
ive made quick 2 pull requests to mke the driver work under 1.15 it needs an init and cleanup call