Repository navigation
[C++] Initialize oversized PageArena allocation metadata - #1033
Open
zhangxinyao88 wants to merge 2 commits into
Open
zhangxinyao88 wants to merge 2 commits into
zhangxinyao88 wants to merge 2 commits into
Conversation
Represent a dedicated oversized block as a fully consumed page. Its null cursor previously broke used-byte accounting and triggered UBSan when a later small allocation tried to reuse the block. Cover used-byte totals, successive oversized blocks, retained data and reset. Preserve the existing payload address and alignment.
Install clang-format 17.0.6 in a runner-local virtual environment rather than assuming /usr/bin/clang-format-17 exists. Keep the Python 3.9 Linux job on Ubuntu 22.04, where setup-python provides its binary, while retaining all nine Python matrix combinations. Generated-by: OpenAI Codex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allocations larger than the arena page size construct a page with null cursor/end pointers.
get_total_used_bytes()then subtracts from null and returns a negative total. A subsequent small allocation reachesPage::alloc()on that block; the existingAlignmentWithBuildinTypestest reportsapplying non-zero offset 8 to null pointerunder UBSan.Initialize the oversized block with its payload size and mark it fully consumed. This makes accounting accurate and prevents reuse while retaining the existing payload address/alignment. Check allocation failure before placement construction and remove the unused null-state constructor.
Add two regressions for exact used-byte totals, consecutive oversized blocks, preserved payload bytes and reset. Both fail on current develop with negative totals; all seven affected PageArena cases pass with the fix under ASan/UBSan and halt-on-error, including the existing alignment case.
Validation on macOS arm64, Java 17 and clang-format 17.0.6:
./mvnw -B -ntp -P with-cpp -Denable.lzma2=ON verify: 1,165 passed, 3 skipped, 10 disabled, 0 failed; Spotless, Checkstyle and RAT pass. All configured codecs, ANTLR and SIMD are enabled.The sanitizer build explicitly supplies sanitizer flags through
CXXFLAGSbecause the existing CMake configuration drops its own instrumentation flags; that build-system repair is checkpointed separately. Full sanitizer, local Windows, Java and Python runtime suites were not run for this allocator patch.Discovered while investigating sanitizer instrumentation after #1030. The prior alignment fix #527 is retained; this fixes oversized-page metadata. Build configuration, Python sanitizer coverage (#1027), and other PR scopes remain separate.
Existing-PR CI setup repair — 2026-10-25
Commit
233e63e1ed895ad229b41c77901e1439eb723729applies shared002d798: install pinned clang-format 17.0.6 in a runner-local venv, explicitly set up Python 3.11 for C++ Linux, and move only the Python 3.9 Linux cell to supported Ubuntu 22.04. All 8 C++ / 9 Python jobs, build/test commands, triggers and permissions are retained. No additional production changes.Both workflows pass actionlint, YAML/bash syntax and matrix checks. The original dependency blocks reproduce the missing-formatter failure with mocked system package operations; repaired blocks actually install/run 17.0.6 and resolve the next-step PATH on macOS. The current official setup-python manifest confirms Python 3.9.25 x64 Linux support on 22.04 and absence on 26.04. Linux container and full application tests were not rerun for this YAML-only change.
At this exact new head: 0 check-runs and 10 workflows awaiting maintainer approval. Prior-head runtime results above are historical. No new-head runtime pass, CI approval or rerun is claimed.