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

Optional assertion that no cursor is active when resetting a session

    • Type: Icon: Task Task
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: APIs
    • Storage Engines
    • 3
    • StorEng - Defined Pipeline

      __wt_session_reset_cursors is called from WT_SESSION->rollback_transaction when MongoDB abandons a WiredTiger transaction. However, because this function resets all positioned cursors, if MongoDB still holds a WT cursor, it can run into use-after-free bug if it tries to use the cursor's memory. This has led to BF-33263, which was difficult to debug because it was only triggered under certain conditions.

      To catch future mistakes, we would like to assert that no cursor is positioned when resetting a session. It's really hard to track all positioned cursors in the upper layer, whereas WT already has this information readily available. We can guard this assertion behind a special option that only mongo enables.

            Assignee:
            Unassigned Unassigned
            Reporter:
            wei.hu@mongodb.com Wei Hu
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: