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

Fix uninitialized bool in txn_ckpt.c

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: WT10.0.1, 5.1.0, 4.4.8, 5.0.2
    • Component/s: None
    • Labels:
    • Story Points:
      2
    • Sprint:
      Storage - Ra 2021-06-28

      Description

      When implementing new build variants for UBSAN in WT-7552, a number of errors of the following signature were detected in src/txn/txn_ckpt.c:

      [2021/06/22 03:38:04.299] ../src/txn/txn_ckpt.c:1547:5: runtime error: load of value 127, which is not a valid value for type 'bool'

      The offending line is as follows:

      WT_UNUSED(seen_ckpt_add); 

      The reason for this error is that an uninitialized bool will have an indeterminate value, which is undefined behavior. The seen_ckpt_add variable is not initialized until late in the function and there are code paths that would skip this initialization completely. Moving the variable initialization to earlier in the function would prevent this sanitizer error.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jie.chen Jie Chen
              Reporter:
              tammy.bailey Tammy Bailey
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: