Skip to content

Perf CI: compare executable bases modulo the largest segment alignment - #131889

Merged
Algunenano merged 1 commit into
masterfrom
perf-executable-base-alignment
Nov 16, 2026
Merged

Algunenano merged 1 commit into
masterfrom
perf-executable-base-alignment

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

check_executable_base.py (added in 1c046eb) fails the Performance Comparison job when the reference and the candidate server have different executable bases, to notice a launcher that forgot to disable ASLR. But with ASLR disabled the kernel rounds the fixed base down to the largest p_align of the binary's PT_LOAD segments, so a change that raises that alignment in only one binary makes the bases differ even when both servers are started correctly. Such a PR can never pass the check, and its Mergeable Check stays red.

This happens in #131685: the llvm-project bump puts the XRay handler pointers on their own 64 KiB pages, so the last writable segment is aligned to 0x10000 (master: 0x1000), and the bases are 0x555555550000 vs 0x555555554000.

The check now compares the bases after rounding them down to the largest segment alignment of all the binaries, read from the program headers of /proc/<pid>/exe. A random (ASLR) base still differs from the fixed one above any segment alignment, so a launcher without setarch -R is still detected. Verified locally with two PIE binaries linked with -z max-page-size=4096, one with a 64 KiB aligned global: the old check fails on the setarch -R pair, the new one passes; both fail when either process runs with ASLR enabled. The parsed alignment of a real clickhouse binary matches readelf -l.

Related: #131685

Changelog category (leave one):

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

🤖 Generated with Claude Code


Workflow [PR]
Sync PR [sync-upstream/pr/131889]

Version info

  • Merged into: 26.11.1.2435-master (included in 26.11 and later)

With ASLR disabled, the kernel loads a PIE executable at a fixed address
rounded down to the largest `p_align` of its `PT_LOAD` segments. When a
change raises that alignment in only one of the two binaries, the reference
and the candidate get different bases even though both servers were started
correctly with `setarch -R`, and `check_executable_base.py` fails the whole
`Performance Comparison` job. This happens in
#131685: the `llvm-project`
bump puts the XRay handler pointers on their own 64 KiB pages, so its
binary has a writable segment aligned to `0x10000` where master's has
`0x1000`, and the bases are `0x555555550000` and `0x555555554000`. Such a
pull request could never pass the check, so `Mergeable Check` stayed red.

The check exists to notice a launcher that does not disable ASLR. Compare the
bases after rounding them down to the largest segment alignment of all the
binaries (read from the program headers of `/proc/<pid>/exe`): a random base
still differs from the fixed one in the bits above any segment alignment, so
a server started with ASLR enabled is still detected.

Checked locally with two PIE binaries linked with `-z max-page-size=4096`,
one of them with a 64 KiB aligned global: the old check fails on the pair
started with `setarch -R`, the new one passes, and both fail when either
process is started with ASLR enabled.

Related: #131685

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [9e68024]

Summary: ✅


AI Review

Summary

The PR normalizes executable bases using the largest ELF PT_LOAD alignment to prevent false failures in performance CI. No actionable findings at commit 9e680240fb7031b1403617e6a7974dfc9e4ec1d0. The new (base, alignment) result is consumed within the script; callers in compare.sh and performance_tests.py consume its exit status. Focused aarch64 checks reproduced the previous failure, accepted the 4 KiB/64 KiB pair with ASLR disabled, and rejected pairs with either or both processes using ASLR.

Final Verdict

✅ Approve

@clickhouse-gh clickhouse-gh Bot added pr-ci comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). labels Nov 16, 2026
@Algunenano Algunenano self-assigned this Nov 16, 2026
@Algunenano
Algunenano added this pull request to the merge queue Nov 16, 2026
Merged via the queue into master with commit 2ab6ad4 Nov 16, 2026
196 checks passed
@Algunenano
Algunenano deleted the perf-executable-base-alignment branch November 16, 2026 12:18
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). 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.

3 participants