Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-1220

Runtime Error: Assertion Failed

    • Type: Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.3.5
    • Component/s: libmongoc
    • Environment:
      ArchLinux, NGINX, FastCGI, g++
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I switched from C driver to C++ driver and that resolved my issues. However, I do not see why the C driver shouldn't have worked. Since I'm using more than one DBMS I wanted to keep the libraries managing them under the same language binding and not all of them have competent C++ bindings.

      The runtime error is simply complaining about an assertion failing on

      command = BCON_NEW ("ping", BCON_INT32 (1));

      call from the tutorial at

      http://api.mongodb.org/c/1.3.5/tutorial.html#connecting

      I had to change passing in "ping" to char ping[] = "ping"; and pass in the variable instead of the string literal to get it to compile. This tutorial was inserted in a bare fastcgi program.

      I compiled my program with the folllowing command:

      g++ main.cpp -lfcgi -lfcgi++ -lmongoc-1.0 -lbson-1.0 --std=c++14

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            DavidPatt David P [X]
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: