DEBUG: cluster: Client initialized in direct mode. Segmentation fault (core dumped)

208 views
Skip to first unread message

Ranjeet Kuruvilla

unread,
Dec 28, 2014, 1:53:25 PM12/28/14
to mongod...@googlegroups.com
Hello
I switched from mongodb c++ driver (which worked fine) to mongodb c driver. This is the problem
DEBUG:      cluster: Client initialized in direct mode.
Segmentation fault (core dumped)


I have written the following code to read an entry

Enter code here...

> db.persona.find()
{ "_id" : 123456, "key" : "value" }

The code is attached.

a. I am not sure I connected the driver at all. How can I check that and how can I make that happen? Where is a tool in which I can see realtime what is happening inside and around my mongodb database?
b. Is there something wrong with those code snippets? Essentially any operation that tries to read/write crashes.

Regards
DbWrapper.cc

Tyler Brock

unread,
Dec 28, 2014, 8:32:33 PM12/28/14
to mongod...@googlegroups.com
Sorry you are having trouble. Taking a shot in the dark here: Did you call mongoc_init()?

http://api.mongodb.org/c/current/mongoc_init.html

If that doesn't fix it can we see the code you are running? These things are hard to diagnose without seeing the code.

-Tyler
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/03a01655-6cfe-40da-964f-4655722d216d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ranjeet Kuruvilla

unread,
Feb 8, 2015, 9:55:37 AM2/8/15
to mongod...@googlegroups.com
Hello
Sorry for my late reply. Yes I did. Please see the attached file.
void DbWrapper::connectDb(const char* IP)
{
    mongoc_init();
    DbWrapper::client = mongoc_client_new(IP); // Try to connect to host
Reply all
Reply to author
Forward
0 new messages