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

The WiredTigerRecoveryUnit Destructor can access null fields of a WT Session

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0, 8.0.0-rc2
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution
    • Fully Compatible
    • ALL
    • v8.0
    • Execution Team 2024-04-15
    • 117

      When we call the destructor code for a WiredTigerRecoveryUnit, we check if we set the _prefetching field to true and reconfigure the session that we owned to disable _prefetching if this is the case. We do something similar for cache_max_wait_ms. We do this so that we do not release any sessions that have non-default configurations into the session_cache here. However, it is possible that we have shut down the storage engine before we call the RecoveryUnit destructor, which results in us accessing fields in the session that have been zeroed out, resulting in invalid memory access. 

      We became aware of this following SERVER-86912 but that ticket seems to only have made this situation more common (because prefetch is set every time we perform validation).

      One approach to resolving this could be to shift the reconfiguration to the release session code. Every time we set the session configuration to be something non-default, we could store the config string that undoes that change (for example, if we set "prefetch=(enabled=true)", we store "prefetch=(enabled=false)"). We could then make sure that we reset the confuguration.

       

            Assignee:
            damian.wasilewicz@mongodb.com Damian Wasilewicz
            Reporter:
            damian.wasilewicz@mongodb.com Damian Wasilewicz
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: