Skip to content

Include full sanitizer report in CI failure reports#102151

Merged
alexey-milovidov merged 3 commits intomasterfrom
fix-sanitizer-report-parsing
Apr 10, 2026
Merged

Include full sanitizer report in CI failure reports#102151
alexey-milovidov merged 3 commits intomasterfrom
fix-sanitizer-report-parsing

Conversation

@alexey-milovidov
Copy link
Copy Markdown
Member

The get_sanitizer_stack_trace parser was only extracting #N stack frame lines, discarding the description (e.g., what kind of undefined behavior), origin chains (e.g., "Uninitialized value was created by a heap allocation"), and intermediate context (e.g., "freed by thread T0 here:").

Now it captures the full sanitizer report from the header line through the SUMMARY line, including all stack trace sections, descriptions, and origin chains. This makes the information available both in the CI HTML report and in test_context_raw in CIDB.

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

The `get_sanitizer_stack_trace` parser was only extracting `#N` stack frame
lines, discarding the description (e.g., what kind of undefined behavior),
origin chains (e.g., "Uninitialized value was created by a heap allocation"),
and intermediate context (e.g., "freed by thread T0 here:").

Now it captures the full sanitizer report from the header line through the
SUMMARY line, including all stack trace sections, descriptions, and origin
chains. This makes the information available both in the CI report and in
`test_context_raw` in CIDB.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@alexey-milovidov alexey-milovidov requested a review from maxknv April 9, 2026 00:08
@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh Bot commented Apr 9, 2026

Workflow [PR], commit [e0988fd]

Summary:


AI Review

Summary

This PR updates get_sanitizer_stack_trace in ci/jobs/scripts/log_parser.py to capture full sanitizer reports (not only #N frames) and adds a UBSan runtime-error stop condition when no SUMMARY line exists. I reviewed the full changed file and PR metadata and found no correctness, safety, or performance regressions in the current diff.

ClickHouse Rules
Item Status Notes
Deletion logging
Serialization versioning
Core-area scrutiny
No test removal
Experimental gate
No magic constants
Backward compatibility
SettingsChangesHistory.cpp
PR metadata quality
Safe rollout
Compilation time
No large/binary files
Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Apr 9, 2026
@alexey-milovidov alexey-milovidov requested a review from azat April 9, 2026 00:11
# Pattern to remove ANSI escape codes (colors from tools like ripgrep)
ansi_escape = re.compile(r"\x1b\[[0-9;]*m")
sanitizer_start = re.compile(
r"(==\d+==\s*)?(ERROR|WARNING): \w+Sanitizer:|: runtime error: "
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sanitizer_start also matches UBSan : runtime error: lines, but the loop has no reliable stop condition for this path when no SUMMARY: ...Sanitizer: line is present.

For UBSan runtime errors, stderr can continue with regular log lines without blank separators, so this will keep appending unrelated lines to stack_trace. That can pollute STID grouping and the failure context in CI reports.

Please add a second termination condition for runtime-error mode (for example: stop when the next line matches a regular ClickHouse log prefix, or when another sanitizer report header starts), while still keeping full capture for report-style sanitizers.

@alexey-milovidov
Copy link
Copy Markdown
Member Author

Needs #102149

alexey-milovidov and others added 2 commits April 10, 2026 00:19
UBSan `: runtime error:` reports may not emit a `SUMMARY:` line,
and ClickHouse log lines on stderr can follow immediately without
blank-line separators. This caused the parser to over-capture
unrelated log lines into `stack_trace`, degrading `STID` grouping.

In runtime-error mode, now also stop capturing when encountering
a ClickHouse log line (timestamp pattern) or a new sanitizer report.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@alexey-milovidov alexey-milovidov added this pull request to the merge queue Apr 10, 2026
Merged via the queue into master with commit 10b5669 Apr 10, 2026
163 checks passed
@alexey-milovidov alexey-milovidov deleted the fix-sanitizer-report-parsing branch April 10, 2026 03:23
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants