clang-analyzer gives misleading output

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • WT12.0.0
    • Affects Version/s: None
    • Component/s: Tools
    • None
    • Storage Engines, Storage Engines - Foundations
    • SE Foundations - 2025-07-04, SE Foundations - 2025-07-18
    • 1

      Initially this ticket was created as a report that `clang-analyzer` fails with unrelated warnings on feature branches:

      Example: https://spruce.mongodb.com/task/wiredtiger_ubuntu2004_clang_analyzer_patch_ae3c2892786[...]6862ff3672afa700072ccaba_25_06_30_21_18_49/logs?execution=0

      [2025/07/01 07:32:22.387] /data/mci/6275df44704c209cda887e05c11b9f9d/wiredtiger/src/session/session_api.c:1570:16: warning: Called function pointer is null (null dereference) [core.CallAndMessage]
      [2025/07/01 07:32:22.387]  1570 |         WT_ERR(start->compare(start, stop, &cmp));
      [2025/07/01 07:32:22.387]       |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      [2025/07/01 07:32:22.387] /data/mci/6275df44704c209cda887e05c11b9f9d/wiredtiger/src/include/error.h:47:21: note: expanded from macro 'WT_ERR'
      [2025/07/01 07:32:22.387]    47 |         if ((ret = (a)) != 0) \
      [2025/07/01 07:32:22.387]       |                     ^
      [2025/07/01 07:32:22.387] 1 warning generated.
      

      The exclusion list file s_clang_scan.diff has this line:

      wiredtiger/src/session/session_api.c Called function pointer is null (null dereference) [core.CallAndMessage]
      

      But later it turned out that it actually fails on related errors only, but prints the full log that contains all the issues (even unrelated and suppressed one) in the very end of execution, so that caused misleading.

            Assignee:
            Ivan Kochin
            Reporter:
            Yury Ershov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: