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

Backup cursor API can fail to restore WT_SESSION name information

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • WT10.0.0, 4.3.3, 4.2.3
    • Affects Version/s: None
    • Component/s: None
    • None
    • 3
    • Storage Engines 2019-12-30

      Summary:
      Fix a bug where a rare/unexpected API call could potentially cause a minor problem in error handling.
      =======================

      Coverity analysis defect 113991: Possible failure to restore non-local value

      Handles classes of flow where a function is either saving some external value, modifying the external value, and then possibly intending to restore it to its original state but not doing so along one of many paths; or else is checking whether an external has some expected value, modifying the external value, then possibly intending to restore it to the expected value but not doing so along a path. Such code is only incorrect if the intent really was to restore along all paths.

      Defect 113991 (STATIC_C)
      Checker MISSING_RESTORE (subcategory possible)
      File: /src/cursor/cur_backup.c
      Function __curbackup_reset
      /src/cursor/cur_backup.c, line: 60
      Saving non-local "session->dhandle" in local "__olddh".

              CURSOR_API_CALL_PREPARE_ALLOWED(cursor, session, reset, NULL);
      

      /src/cursor/cur_backup.c, line: 60
      Modifying non-local "session->dhandle".

              CURSOR_API_CALL_PREPARE_ALLOWED(cursor, session, reset, NULL);
      

      /src/cursor/cur_backup.c, line: 61
      Value of non-local "session->dhandle" that was saved in "__olddh" is not restored as it was along other paths.

              WT_CURSOR_BACKUP_CHECK_STOP(cb);
      

            Assignee:
            keith.bostic@mongodb.com Keith Bostic (Inactive)
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: