This is not a question but a request to help diagnose and fix a problem.
Using the latest (1.0.2) version of rmongodb the following code crashes the session of R 2.15.2 on Mac OS X. The code works in R 2.15.1 on a different Mac OS X machine.
library(rmongodb)
mongo <- mongo.create('127.0.0.1', db='test')
print(mongo.is.connected(mongo))
mongo.find.one(mongo, 'unknown')
The output is:
> library(rmongodb)
rmongodb package (mongo-r-driver) loaded
Use 'help("mongo")' to get started.
> mongo <- mongo.create('127.0.0.1', db='test')
> print(mongo.is.connected(mongo))
[1] TRUE
> mongo.find.one(mongo, 'unknown')
R(60519) malloc: *** error for object 0x7fff5fbfce10: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6
The same type of crash happens if you pass a non-existent command to MongoDB. Again, this used to work under R 2.15.1.
> library(rmongodb)
> mongo <- mongo.create('127.0.0.1', db='test')
> mongo.command(mongo, 'test', list(isMaster=1))
ismaster : 8 true
maxBsonObjectSize : 16 16777216
ok : 1 1.000000
> mongo.command(mongo, 'test', list(fake=1))
R(66743) malloc: *** error for object 0x7fff5fbfde20: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6
I have created an issue in the rmongodb project and would appreciate any help scoping & validating the problem to enable the package developer to hone in on what needs fixing or, perhaps, prove that it is not an rmongodb issue but some strange interaction in my environment.
I will accept an answer from someone who runs the code either on 2.15.1 and 2.15.2 on Mac OS X or on 2.15.2 on Mac OS X and at least one other environment.
According to the package author this issue is fixed on GitHub but CRAN hasn’t been updated.