Test: regression for signed atoi() -> unsigned wrap in IccTagXml ParseXml (#1346)#1350
Merged
Merged
Conversation
…eXml (#1346) Replays a PoC profile (a valid copy of Testing/HDR/BT2100PQFullScene.xml with cicpFields ColorPrimaries set to -1) through iccFromXml. Under the integer / implicit-conversion sanitizer the test FAILS if UBSan's implicit-integer-sign-change diagnostic at the cicp ParseXml site reappears, and SKIPS cleanly on a plain build (it gates on the build's CMakeCache). Covers the implicit "Class A" arm of the #1346 sweep; the explicit-cast "Class B" sites are invisible to any sanitizer by construction and are guarded by the shared icXmlAttrToUInt() helper / review instead. Verified: FAILS (exit 2, UB at IccTagXml.cpp:1172 CIccTagXmlCicp::ParseXml) against pre-fix master, PASSES against the #1349 fix, SKIPS without the sanitizer. Registered as iccdev.issue-1346-imageparse-atoi-unsigned-regression. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
@xsscx note on the red Expected red-by-design — the paired fix (#1349) is not merged yet, so master still has the signed Sequence to green:
Verified locally: FAILS on pre-fix master, PASSES with #1349, SKIPS on a non-sanitizer build. |
…e-atoi-unsigned-regression
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.
Summary
Deterministic regression for the #1346 sweep (fix: #1349). Replays a PoC profile with a negative
cicpFields ColorPrimariesattribute throughiccFromXml; under the integer / implicit-conversion sanitizer it fails if UBSan'simplicit-integer-sign-changediagnostic reappears, and skips cleanly on a plain build.Files
.github/ci/test-data/ub-cicp-colorprimaries-1346.xml— PoC: a valid copy ofTesting/HDR/BT2100PQFullScene.xmlwithColorPrimaries="-1". Because it is otherwise valid,iccFromXmlparses and saves it; the pass/fail signal is purely the sanitizer diagnostic, not the tool exit code..github/scripts/iccdev-issue-1346-imageparse-atoi-unsigned-regression.sh— gates on the build'sCMakeCache.txt(ENABLE_INTEGER_SANITIZER/ENABLE_UBSAN, or an explicit-fsanitize=*integer/undefined/implicit);[SKIP]s otherwise; signal = presence ofruntime error: implicit conversion. Exit 0 pass/skip, 2 on finding.Build/Cmake/Testing/CMakeLists.txt— registersiccdev.issue-1346-imageparse-atoi-unsigned-regression(labels includeubsan).Scope note
This exercises the implicit Class A arm of the sweep. The explicit-cast Class B sites carry an
(icUIntNN)cast that suppresses the UBSan check, so they are invisible to any sanitizer-based test by construction — they are guarded by the sharedicXmlAttrToUInt()helper and review in #1349, not here.Verification (clang-18,
-DENABLE_ASAN=ON -DENABLE_UBSAN=ON -DENABLE_INTEGER_SANITIZER=ON)[FAIL]exit 2 —IccTagXml.cpp:1172: runtime error: implicit conversion from type 'int' of value -1 ... changed the value to 255, stack inCIccTagXmlCicp::ParseXml.[PASS]exit 0.[SKIP].🤖 Generated with Claude Code