Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-4689

Invalid memory access in __wt_txn_commit() when committing prepared txn

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • WT3.2.1
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • 3
    • Storage Engines 2019-05-20, Storage Engines 2019-06-03

      From analysing the BF:

      (gdb) bt
      #0  __wt_txn_resolve_prepared_op (commit=true, op=0x7f7bb6657340, session=0x7f7baaf9c8e0) at src/third_party/wiredtiger/src/include/txn.i:214
      #1  __wt_txn_commit (session=session@entry=0x7f7baaf9c8e0, cfg=cfg@entry=0x7f7b6e276640) at src/third_party/wiredtiger/src/txn/txn.c:960
      #2  0x00007f7ba65016f5 in __session_commit_transaction (wt_session=0x7f7baaf9c8e0, config=<optimized out>) at src/third_party/wiredtiger/src/session/session_api.c:1664
      #3  0x00007f7ba6497725 in mongo::WiredTigerRecoveryUnit::_txnClose (this=0x7f7bb1e32780, commit=<optimized out>) at /opt/mongodbtoolchain/stow/gcc-v3.zB7/include/c++/8.2.0/bits/basic_string.h:2281
      #4  0x00007f7ba6497e4d in mongo::WiredTigerRecoveryUnit::_commit (this=0x7f7bb1e32780) at src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp:206
      #5  0x00007f7ba6497e8a in mongo::WiredTigerRecoveryUnit::commitUnitOfWork (this=<optimized out>) at src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp:285
      #6  0x00007f7ba7ce5e14 in mongo::WriteUnitOfWork::commit (this=0x7f7bb228a5d0) at /opt/mongodbtoolchain/stow/gcc-v3.zB7/include/c++/8.2.0/bits/unique_ptr.h:342
      #7  0x00007f7ba72db3b6 in mongo::TransactionParticipant::Participant::_commitStorageTransaction (this=0x7f7b6e276b98, opCtx=0x7f7bb6262640) at /opt/mongodbtoolchain/stow/gcc-v3.zB7/include/c++/8.2.0/bits/unique_ptr.h:342
      #8  0x00007f7ba72dfac6 in mongo::TransactionParticipant::Participant::commitPreparedTransaction (this=this@entry=0x7f7b6e276b98, opCtx=opCtx@entry=0x7f7bb6262640, commitTimestamp=commitTimestamp@entry=..., commitOplogEntryOpTime=...) at src/mongo/db/transaction_participant.cpp:1231
      
      (gdb) p	upd
      $1 = (WT_UPDATE *) 0x15
      (gdb) p	upd->txnid
      Cannot access memory at address 0x15
      
      (gdb) l
      209	#endif
      210	
      211		WT_STAT_CONN_INCR(session, txn_prepared_updates_resolved);
      212	
      213		for (; upd != NULL; upd = upd->next) {
      214			 if (upd->txnid != txn->id)
      215				continue;
      216	
      217			if (op->u.op_upd == NULL)
      218				op->u.op_upd = upd;
      (gdb)
      

      It appears like a prepared update went away while we were processing the update list for commit.

            Assignee:
            luke.pearson@mongodb.com Luke Pearson
            Reporter:
            sulabh.mahajan@mongodb.com Sulabh Mahajan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: