mongo.cr icon indicating copy to clipboard operation
mongo.cr copied to clipboard

Not working with libmongoc 1.3 or 1.5(latest release)

Open dimparf opened this issue 8 years ago • 7 comments

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] ???

dimparf avatar Dec 05 '16 07:12 dimparf

Please post the source code to reproduce. Thanks.

datanoise avatar Dec 05 '16 13:12 datanoise

require "./mongo.cr"

client = Mongo::Client.new "mongodb://localhost"                                                                                                                  
db = client["mydb"]

collection = db["places"]

collection.find({"name" => "Coffee"}) do |doc|
  puts doc 
en

dimparf avatar Dec 05 '16 23:12 dimparf

Just used this code and it works for me. Not sure what the issue is.

datanoise avatar Dec 06 '16 01:12 datanoise

@datanoise I had the same issue, I asked some guys from waterlink that has the sam Issue.

ghost avatar Feb 17 '17 19:02 ghost

@dimparf It seems to be the version of mongoc isn't new enough in the source

ghost avatar Feb 17 '17 19:02 ghost

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

kimvex avatar Apr 03 '19 17:04 kimvex

ive made quick 2 pull requests to mke the driver work under 1.15 it needs an init and cleanup call

washu avatar Aug 28 '19 16:08 washu