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

segfault in test_rs_seeds_connect

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • 1.2-beta1
    • Affects Version/s: 1.2-beta0
    • Component/s: libmongoc
    • None

      test_rs_seeds_connect/reconnect and test_mongos_seeds_connect/reconnect, single and pooled versions, all crash with a backtrace like:

      #1  mongoc_stream_failed (stream=0x100210082) at mongo-c-driver/src/mongoc/mongoc-stream.c:83
      #2  mongoc_topology_scanner_ismaster_handler (async_status=MONGOC_ASYNC_CMD_ERROR, ismaster_response=0x0, rtt_msec=1137, data=0x100703fb0, error=0x100800c38) at mongo-c-driver/src/mongoc/mongoc-topology-scanner.c:193
      #3  mongoc_async_cmd_run (acmd=0x100800c00) at mongo-c-driver/src/mongoc/mongoc-async-cmd.c:113
      #4  mongoc_async_run (async=0x100702740, timeout_msec=29999) at mongo-c-driver/src/mongoc/mongoc-async.c:142
      #5  mongoc_topology_scanner_work (ts=0x100703b90, timeout_msec=30000) at mongo-c-driver/src/mongoc/mongoc-topology-scanner.c:452
      #6  _mongoc_topology_run_scanner (topology=0x100702c20, work_msec=30000) at mongo-c-driver/src/mongoc/mongoc-topology.c:323
      #7  _mongoc_topology_do_blocking_scan (topology=0x100702c20) at mongo-c-driver/src/mongoc/mongoc-topology.c:349
      #8  mongoc_topology_select (topology=0x100702c20, optype=MONGOC_SS_READ, read_prefs=0x1007069d0, local_threshold_ms=15, error=0x102808230) at mongo-c-driver/src/mongoc/mongoc-topology.c:397
      #9  _mongoc_cluster_select_by_optype (cluster=0x1007047e8, optype=MONGOC_SS_READ, read_prefs=0x1007069d0, error=0x102808230) at mongo-c-driver/src/mongoc/mongoc-cluster.c:1454
      #10 mongoc_cluster_select (cluster=0x1007047e8, rpcs=0x7fff5fbfe540, rpcs_len=1, read_prefs=0x1007069d0, error=0x102808230) at mongo-c-driver/src/mongoc/mongoc-cluster.c:1623
      #11 mongoc_cluster_sendv (cluster=0x1007047e8, rpcs=0x7fff5fbfe540, rpcs_len=1, write_concern=0x1007056d0, read_prefs=0x1007069d0, error=0x102808230) at mongo-c-driver/src/mongoc/mongoc-cluster.c:2309
      #12 _mongoc_client_sendv (client=0x1007047d0, rpcs=0x7fff5fbfe540, rpcs_len=1, server_id=0, write_concern=0x0, read_prefs=0x1007069d0, error=0x102808230) at mongo-c-driver/src/mongoc/mongoc-client.c:448
      #13 _mongoc_cursor_query (cursor=0x102808000) at mongo-c-driver/src/mongoc/mongoc-cursor.c:500
      #14 _mongoc_cursor_next (cursor=0x102808000, bson=0x7fff5fbfe658) at mongo-c-driver/src/mongoc/mongoc-cursor.c:819
      #15 mongoc_cursor_next (cursor=0x102808000, bson=0x7fff5fbfe658) at mongo-c-driver/src/mongoc/mongoc-cursor.c:747
      #16 _mongoc_client_command_simple_with_hint (client=0x1007047d0, db_name=0x10009754f "test", command=0x100706950, read_prefs=0x100706850, reply=0x7fff5fbfeb00, hint=0, error=0x7fff5fbfe900) at mongo-c-driver/src/mongoc/mongoc-client.c:1257
      #17 mongoc_client_command_simple (client=0x1007047d0, db_name=0x10009754f "test", command=0x100706950, read_prefs=0x100706850, reply=0x7fff5fbfeb00, error=0x7fff5fbfe900) at mongo-c-driver/src/mongoc/mongoc-client.c:1231
      #18 test_seed_list (rs=true, connection_option=CONNECT, pooled=false) at mongo-c-driver/tests/test-mongoc-client.c:639
      #19 test_rs_seeds_connect_single () at mongo-c-driver/tests/test-mongoc-client.c:725
      #20 TestSuite_AddHelper (cb_=0x10001d070 <test_rs_seeds_connect_single>) at mongo-c-driver/tests/TestSuite.c:301
      #21 TestSuite_RunTest (suite=0x7fff5fbff530, test=0x1005065d0, mutex=0x7fff5fbff4a8, count=0x7fff5fbff404) at mongo-c-driver/tests/TestSuite.c:429
      #22 TestSuite_RunNamed (suite=0x7fff5fbff530, testname=0x100505770 "/Client/*") at mongo-c-driver/tests/TestSuite.c:741
      #23 TestSuite_Run (suite=0x7fff5fbff530) at mongo-c-driver/tests/TestSuite.c:769
      #24 main (argc=5, argv=0x7fff5fbff590) at mongo-c-driver/tests/test-libmongoc.c:931
      

      When the server hangs up on an ismaster call, it seems that mongoc_stream_failed is called with a stream that's uninitialized or already destroyed.

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: