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

WiredTiger crashes due to NULL btree handle

    • Fully Compatible
    • ALL

      I encountered the following crash while running jstests/parallel/basicPlus.js in a loop:

      #3  0x0000000001e52a59 in __conn_dhandle_open_lock (session=0x38e7300, dhandle=0x89d24e00, flags=8) at src/third_party/wiredtiger/src/conn/conn_dhandle.c:68
      68			if (F_ISSET(btree, WT_BTREE_SPECIAL_FLAGS))
      (gdb) p btree
      $31 = (WT_BTREE *) 0x0
      
      (gdb) f 5
      #5  0x0000000001eb62f8 in __wt_session_get_btree (session=0x38e7300, uri=0x3365900b "file:index-85929--6005745882332473269.wt", checkpoint=0x0, cfg=0x7fffefed6df0, flags=8) at src/third_party/wiredtiger/src/session/session_dhandle.c:423
      423		WT_WITH_SCHEMA_LOCK(session,
      (gdb) l
      418		 *
      419		 * We need the schema lock for this call so that if we lock a handle in
      420		 * order to open it, that doesn't race with a schema-changing operation
      421		 * such as drop.
      422		 */
      423		WT_WITH_SCHEMA_LOCK(session,
      424		    WT_WITH_DHANDLE_LOCK(session, ret =
      425			__wt_conn_btree_get(session, uri, checkpoint, cfg, flags)));
      426		WT_RET(ret);
      427	
      (gdb) p ret
      $32 = -31802
      
      #3  0x0000000001e52a59 in __conn_dhandle_open_lock (session=0x38e7300, dhandle=0x89d24e00, flags=8) at src/third_party/wiredtiger/src/conn/conn_dhandle.c:68
      #4  0x0000000001e53597 in __wt_conn_btree_get (session=0x38e7300, name=0x3365900b "file:index-85929--6005745882332473269.wt", ckpt=0x0, cfg=0x7fffefed6df0, flags=8) at src/third_party/wiredtiger/src/conn/conn_dhandle.c:439
      #5  0x0000000001eb62f8 in __wt_session_get_btree (session=0x38e7300, uri=0x3365900b "file:index-85929--6005745882332473269.wt", checkpoint=0x0, cfg=0x7fffefed6df0, flags=8) at src/third_party/wiredtiger/src/session/session_dhandle.c:423
      #6  0x0000000001eb5c57 in __wt_session_get_btree_ckpt (session=0x38e7300, uri=0x3365900b "file:index-85929--6005745882332473269.wt", cfg=0x7fffefed6df0, flags=0) at src/third_party/wiredtiger/src/session/session_dhandle.c:264
      #7  0x0000000001e70080 in __curstat_file_init (session=0x38e7300, uri=0x3365900b "file:index-85929--6005745882332473269.wt", cfg=0x7fffefed6df0, cst=0x674af200) at src/third_party/wiredtiger/src/cursor/cur_stat.c:378
      #8  0x0000000001e703d3 in __wt_curstat_init (session=0x38e7300, uri=0x33659000 "statistics:file:index-85929--6005745882332473269.wt", cfg=0x7fffefed6df0, cst=0x674af200) at src/third_party/wiredtiger/src/cursor/cur_stat.c:458
      #9  0x0000000001eaeb35 in __wt_curstat_colgroup_init (session=0x38e7300, uri=0x786ea00b "colgroup:index-85929--6005745882332473269", cfg=0x7fffefed6df0, cst=0x674af200) at src/third_party/wiredtiger/src/schema/schema_stat.c:26
      #10 0x0000000001e70385 in __wt_curstat_init (session=0x38e7300, uri=0x786ea000 "statistics:colgroup:index-85929--6005745882332473269", cfg=0x7fffefed6df0, cst=0x674af200) at src/third_party/wiredtiger/src/cursor/cur_stat.c:454
      #11 0x0000000001e708a3 in __wt_curstat_open (session=0x38e7300, uri=0x786ea000 "statistics:colgroup:index-85929--6005745882332473269", cfg=0x7fffefed6df0, cursorp=0x7fffefed6bf0) at src/third_party/wiredtiger/src/cursor/cur_stat.c:558
      #12 0x0000000001eaed2d in __wt_curstat_table_init (session=0x38e7300, uri=0x507e94c3 "table:index-85929--6005745882332473269", cfg=0x7fffefed6df0, cst=0x74248000) at src/third_party/wiredtiger/src/schema/schema_stat.c:86
      #13 0x0000000001e704b9 in __wt_curstat_init (session=0x38e7300, uri=0x507e94b8 "statistics:table:index-85929--6005745882332473269", cfg=0x7fffefed6df0, cst=0x74248000) at src/third_party/wiredtiger/src/cursor/cur_stat.c:467
      #14 0x0000000001e708a3 in __wt_curstat_open (session=0x38e7300, uri=0x507e94b8 "statistics:table:index-85929--6005745882332473269", cfg=0x7fffefed6df0, cursorp=0x7fffefed6dd0) at src/third_party/wiredtiger/src/cursor/cur_stat.c:558
      #15 0x0000000001eb1641 in __wt_open_cursor (session=0x38e7300, uri=0x507e94b8 "statistics:table:index-85929--6005745882332473269", owner=0x0, cfg=0x7fffefed6df0, cursorp=0x7fffefed6dd0) at src/third_party/wiredtiger/src/session/session_api.c:290
      #16 0x0000000001eb1ae2 in __session_open_cursor (wt_session=0x38e7300, uri=0x507e94b8 "statistics:table:index-85929--6005745882332473269", to_dup=0x0, config=0x38750f8 "statistics=(fast)", cursorp=0x7fffefed6e78) at src/third_party/wiredtiger/src/session/session_api.c:351
      #17 0x000000000170b4ee in mongo::WiredTigerUtil::exportTableToBSON (session=0x38e7300, uri=..., config=..., bob=0x7fffefed6ff0) at src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp:82
      #18 0x000000000170b185 in mongo::WiredTigerUtil::getIdentSize (s=0x38e7300, uri=...) at src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp:54
      #19 0x00000000016f8e67 in mongo::WiredTigerKVEngine::getIdentSize (this=0x377c380, opCtx=0xa43ace0, ident=...) at src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp:204
      #20 0x000000000167e0a7 in mongo::KVDatabaseCatalogEntry::sizeOnDisk (this=0x30adf70, opCtx=0xa43ace0) at src/mongo/db/storage/kv/kv_database_catalog_entry.cpp:147
      #21 0x000000000129ad42 in mongo::CmdListDatabases::run (this=0x27fc680 <mongo::cmdListDatabases>, txn=0xa43ace0, dbname=..., jsobj=..., errmsg=..., result=...) at src/mongo/db/commands/list_databases.cpp:100
      #22 0x0000000001305c1d in mongo::_execCommand (txn=0xa43ace0, c=0x27fc680 <mongo::cmdListDatabases>, dbname=..., cmdObj=..., queryOptions=0, errmsg=..., result=..., fromRepl=false) at src/mongo/db/dbcommands.cpp:1216
      #23 0x0000000001306bcd in mongo::Command::execCommand (txn=0xa43ace0, c=0x27fc680 <mongo::cmdListDatabases>, queryOptions=0, cmdns=0x4b545414 "admin.$cmd", cmdObj=..., result=..., fromRepl=false) at src/mongo/db/dbcommands.cpp:1430
      #24 0x00000000013074fb in mongo::_runCommands (txn=0xa43ace0, ns=0x4b545414 "admin.$cmd", _cmdobj=..., b=..., anObjBuilder=..., fromRepl=false, queryOptions=0) at src/mongo/db/dbcommands.cpp:1505
      #25 0x00000000015271f1 in mongo::runCommands (txn=0xa43ace0, ns=0x4b545414 "admin.$cmd", jsobj=..., curop=..., b=..., anObjBuilder=..., fromRepl=false, queryOptions=0) at src/mongo/db/query/new_find.cpp:131
      #26 0x0000000001528e42 in mongo::newRunQuery (txn=0xa43ace0, m=..., q=..., curop=..., result=..., fromDBDirectClient=false) at src/mongo/db/query/new_find.cpp:549
      #27 0x000000000141435d in mongo::receivedQuery (txn=0xa43ace0, c=..., dbresponse=..., m=..., fromDBDirectClient=false) at src/mongo/db/instance.cpp:220
      #28 0x000000000141546f in mongo::assembleResponse (txn=0xa43ace0, m=..., dbresponse=..., remote=..., fromDBDirectClient=false) at src/mongo/db/instance.cpp:390
      #29 0x00000000011178ca in mongo::MyMessageHandler::process (this=0x3040208, m=..., port=0xb1c0fa0, le=0x799b22d0) at src/mongo/db/db.cpp:194
      #30 0x0000000001897105 in mongo::PortMessageServer::handleIncomingMsg (arg=0x853e3760) at src/mongo/util/net/message_server_port.cpp:234
      #31 0x00007ffff7bc4182 in start_thread (arg=0x7fffefed9700) at pthread_create.c:312
      #32 0x00007ffff6cc4fbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      
      

      A full backtrace is attached.


      Versions: c8171e7f9695 (includes WT 225aa81 from mongodb-2.8)

            Assignee:
            geert.bosch@mongodb.com Geert Bosch
            Reporter:
            kamran.khan Kamran K.
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: