RejectedSoftware Forums

Sign up

Bson & MongoDB error

Hello, I have a problem with mongodb and bson in vibe.d. When I use findOne for a MongoCollection, the program hang with exit code -11. I do not know what is going wrong. The mongo server is up and running, the collection exist with at least 1 user.

auto users = client.getCollection("mulinex.users");
logInfo("collection found: " ~ users.name);  // print "collection found: users"

auto result = users.findOne(["email": email]);
logInfo("This line will not be printed!"); // never printed... program exit with error code -11

Also I have another question, I'm trying to use dvorm as ORM for my project, but adding "dvorm" as a dependency in dub.json result in a error when linking the executable. It is the same with "dvorm:vibeproviders". This problem exist since dvorm is in the registry so maybe it's just me doing something wrong.

the error is

/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o: dans la fonction « _start »:
(.text+0x20): référence indéfinie vers « main »
collect2: error: ld returned 1 exit status

and my dub.json is

{
    "name": "mulinex",
    "stringImportPaths": ["translations", "views"],
    "dependencies": {
        "vibe-d": ">=0.7.22",
        "dvorm": ">=0.4.3" // "dvorm:vibeproviders": ">=0.4.3"
     },
    "versions": ["VibeDefaultMain"]
}

Another problem is the dauth package. I got tons of linker error when I try to compile my program with --build=release. I don't know why. Some month ago with the same version everything was fine if I remember well, so it can be a dmd compiler bug?

If you need further information about the hang just tell me what to do. Thanks.
Romain

Re: Bson & MongoDB error

Okay, after more test I'm a bit lost.

Compiling from command line with --debug==release|debug give a segfault when it call findOne from a MongoCollection.

Compiling from monodevelop (using CTRL+F5, because the "play button" didn't do the job well...) in debug|release it run fine until some time then it hang again with a segfault when it call findOne from a MongoCollection.

I give up. To much wtf problems around the place, dub, package, dmd... Please forgive this thread.

Re: Bson & MongoDB error

On 2015-01-29 9:04 AM, Romain wrote:>

Compiling from monodevelop (using CTRL+F5, because the "play button" didn't do the job well...) in debug|release it run fine until some time then it hang again with a segfault when it call findOne from a MongoCollection.

I would consider anything high-level as being for advanced users right now. Once I'm done implementing natively all the low-level engines with deep-checking for stability, I plan on focusing on usage analysis and better static error handling for new-comers and their ruby-python-php-javascript-induced assumptions.

Vibe.d is natively compiled, segfaults are commonplace for everyone and debugging them is still part of systems-level language development at the moment.