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

Backup cursor API can fail to restore WT_SESSION name information

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: WT10.0.0, 4.3.3, 4.2.3
    • Component/s: None
    • Labels:
      None
    • Story Points:
      3
    • Sprint:
      Storage Engines 2019-12-30

      Description

      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);
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: