Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-11297

Running a query with CursorTailable flag against non-existent collection crashes mongod.

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.5.4
    • Affects Version/s: 2.5.4
    • Component/s: None
    • None
    • ALL
    • Hide
      1. Start mongod on fresh data directory
        $ ./mongod
        
      2. Run the following from the shell, assuming test.foo is a non-existent collection:
        db.foo.find({}).addOption(2)
        

      Expected behavior:
      Shell should get back a cursor with no documents, or some kind of error message.

      Actual behavior:
      Stack trace and seg fault from mongod. See description.

      Show
      Start mongod on fresh data directory $ ./mongod Run the following from the shell, assuming test.foo is a non-existent collection: db.foo.find({}).addOption(2) Expected behavior: Shell should get back a cursor with no documents, or some kind of error message. Actual behavior: Stack trace and seg fault from mongod. See description.
    • None
    • 0
    • None
    • None
    • None
    • None
    • None
    • None

      Running under mongod, we see that somehow "this" is NULL at collection.cpp:180.

      $ addr2line -i -e mongod 0xe21c33 0x79479f 0x794bc5 0x7f23b05e4cb0 0xca1ed0 0xbaad76 0xb026bc 0xa548d3 0x79ec12 0xde54bd 0x7f23b05dce9a 0x7f23af4bdccd 
      /data/rbuild/mongo/src/mongo/util/stacktrace.cpp:304
      /usr/include/c++/4.6/sstream:458
      /data/rbuild/mongo/src/mongo/db/db.cpp:1011
      /usr/include/c++/4.6/sstream:439
      /data/rbuild/mongo/src/mongo/db/db.cpp:1028
      ??:0
      /data/rbuild/mongo/src/mongo/db/structure/collection.cpp:180
      /data/rbuild/mongo/src/mongo/db/query/new_find.cpp:717
      /data/rbuild/mongo/src/mongo/db/ops/query.cpp:1105
      /data/rbuild/mongo/src/mongo/db/instance.cpp:280
      /data/rbuild/mongo/src/mongo/db/instance.cpp:443
      /data/rbuild/mongo/src/mongo/util/net/hostandport.h:31
      /data/rbuild/mongo/src/mongo/db/db.cpp:199
      /data/rbuild/mongo/src/mongo/util/net/message_server_port.cpp:251
      ??:0
      ??:0
      

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            schwerin@mongodb.com Andy Schwerin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: