Skip to content

Bug: --generate-reproducer prevents compiler error postprocessing #4780

@gamesh411

Description

@gamesh411

Bug: --generate-reproducer prevents compiler error postprocessing

Description

When --generate-reproducer flag is used, failed analyses are not postprocessed, causing compiler errors to not appear in analysis statistics or reports.

Current Behavior

Without --generate-reproducer:

$ CodeChecker analyze compile_commands.json -o reports --analyzers clang-tidy
# Compiler errors are postprocessed into reports
$ CodeChecker parse reports
Number of processed analyzer result files | 2

With --generate-reproducer:

$ CodeChecker analyze compile_commands.json -o reports --analyzers clang-tidy --generate-reproducer
# Compiler errors are NOT postprocessed
$ CodeChecker parse reports
Number of processed analyzer result files | 0

Expected Behavior

Compiler errors should be postprocessed into reports regardless of --generate-reproducer flag, unless explicitly disabled via --disable clang-diagnostic-error.

Root Cause

In analysis_manager.py, the handle_analysis_result() function only calls handle_failure() when generate_reproducer is False:

elif not generate_reproducer:
    handle_failure(...)  # This does postprocessing

This means postprocessing is skipped when --generate-reproducer is enabled.

Impact

  • Analysis statistics are incomplete
  • Compiler errors don't appear in reports
  • Users must choose between reproducers and error reports

Proposed Fix

Move postprocessing logic from handle_failure() into handle_analysis_result() to ensure it runs before reproducer generation, regardless of the flag.

Environment

  • CodeChecker version: 6.27.1
  • Analyzer: clang-tidy (affects clang-diagnostic-error checker)

Metadata

Metadata

Assignees

No one assigned

    Labels

    analyzer 📈Related to the analyze commands (analysis driver)bug 🐛clang-tidy 🐉clang-tidy is a clang-based C++ “linter” tool.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions