Skip to content

Test: regression for signed->unsigned SeamlessIndicator conversion (#1342, #1343)#1345

Merged
xsscx merged 4 commits into
masterfrom
test-1342-1343-imageparse-signed-unsigned-regression
Jun 14, 2026
Merged

Test: regression for signed->unsigned SeamlessIndicator conversion (#1342, #1343)#1345
xsscx merged 4 commits into
masterfrom
test-1342-1343-imageparse-signed-unsigned-regression

Conversation

@colourbill-ctrl

Copy link
Copy Markdown
Contributor

Summary

Deterministic CTest regression for #1342 and #1343 — the signed→unsigned SeamlessIndicator conversion in the Embedded Height/Normal image XML parsers. Pairs with fix PR #1344.

Replays the two fuzz PoCs (negative SeamlessIndicator) through iccFromXml and fails if the UBSan implicit-integer-sign-change finding reappears at CIccTagXmlEmbeddedHeightImage::ParseXml (#1342) or CIccTagXmlEmbeddedNormalImage::ParseXml (#1343).

What's added

  • .github/scripts/iccdev-issue-1342-1343-imageparse-signed-unsigned-regression.sh
  • .github/ci/test-data/ub-heightimage-parsexml-1342.xml and ub-normalimage-parsexml-1343.xml (the committed trigger PoCs)
  • CTest registration iccdev.issue-1342-1343-imageparse-signed-unsigned-regression (label ubsan)

How it signals

The check is only meaningful under a build instrumented with the integer / implicit-conversion sanitizer. ci-iccdev-tool-tests builds with ENABLE_UBSAN=ON ENABLE_INTEGER_SANITIZER=ON (which adds -fno-sanitize-recover=integer), so pre-fix the conversion aborts the parse. The script inspects the build's CMakeCache.txt and skips cleanly on a non-sanitizer build rather than report a misleading pass. The pass/fail signal is the absence of the runtime error: implicit conversion line — not the tool exit code (the trigger profiles are intentionally invalid, so iccFromXml exits non-zero either way).

Verification

  • FAILS pre-fix (both sites fire, exit 2) on the integer-sanitizer build
  • PASSES post-fix (ctest -R 1342-1343 → 1/1 passed)
  • SKIPS on a plain ASan-only build (CMakeCache gate)

Merge order

This test is red until #1344 (the fix) lands — same convention as prior fix/test splits. Merge #1344 first, then this.

🤖 Generated with Claude Code

…1342, #1343)

Adds a CTest script regression that replays the two fuzz PoCs (negative
SeamlessIndicator) through iccFromXml and fails if the signed->unsigned
implicit conversion in CIccTagXmlEmbeddedHeightImage::ParseXml (#1342)
or CIccTagXmlEmbeddedNormalImage::ParseXml (#1343) reappears.

The check is only meaningful under a build instrumented with the
integer / implicit-conversion sanitizer (ci-iccdev-tool-tests builds
with ENABLE_UBSAN=ON ENABLE_INTEGER_SANITIZER=ON, which adds
-fno-sanitize-recover=integer). The script inspects the build's
CMakeCache.txt and skips cleanly on a non-sanitizer build rather than
report a misleading pass. The pass/fail signal is the absence of the
UBSan "runtime error: implicit conversion" line, not the tool exit code
(the trigger profiles are intentionally invalid).

Verified: FAILS pre-fix (both sites, exit 2), PASSES post-fix, SKIPS on
a plain ASan-only build. Pairs with the fix PR for #1342/#1343; this
test stays red until that fix lands.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added Testing CTest, regression, or test coverage Scripts Shell, PowerShell, or repository automation scripts Configuration Repository, CMake, YAML, JSON, or tool configuration Build Build system, CMake, compiler, or packaging Unix Linux, macOS, Bash, or POSIX shell scope labels Jun 14, 2026
@github-actions github-actions Bot added the pending CI checks still running label Jun 14, 2026

@xsscx xsscx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

2026-06-14 19:01:43 UTC

@github-actions github-actions Bot added failed One or more CI checks failed and removed pending CI checks still running labels Jun 14, 2026
@xsscx xsscx self-requested a review June 14, 2026 19:09

@xsscx xsscx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

shellcheck

In .github/scripts/iccdev-issue-1342-1343-imageparse-signed-unsigned-regression.sh line 84:
  local log="$OUTDIR/$(basename "$xml").log"
        ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values.

For more information:
  https://www.shellcheck.net/wiki/SC2155 -- Declare and assign separately to ...
[FAIL] shellcheck

@xsscx xsscx added this to the v2.3.2.2 milestone Jun 14, 2026
@xsscx xsscx linked an issue Jun 14, 2026 that may be closed by this pull request
Declare `log` and assign it separately so the $(basename ...) subshell
exit status is not masked by `local` (shellcheck SC2155).  No behavior
change -- the variable holds the same per-PoC log path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@colourbill-ctrl

Copy link
Copy Markdown
Contributor Author

Fixed the shellcheck SC2155 in 147cc25log is now declared and assigned separately so the $(basename …) exit status isn't masked. Pre-flight should go green on the next run.

The remaining CTest ASAN+UBSAN failure here is expected: the regression deliberately fails while the fix (#1344) is unmerged — it keys on UBSan's implicit conversion diagnostic, which is still present on master. It flips green once #1344 lands (merge fix → test, per the fork-gate split).

@github-actions github-actions Bot added pending CI checks still running failed One or more CI checks failed and removed failed One or more CI checks failed pending CI checks still running labels Jun 14, 2026
@github-actions github-actions Bot added failed One or more CI checks failed and removed pending CI checks still running labels Jun 14, 2026
@xsscx xsscx self-requested a review June 14, 2026 20:00

@xsscx xsscx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

2026-06-14 20:00:40 UTC

Auto-Merge is On.

@colourbill-ctrl

Copy link
Copy Markdown
Contributor Author

@xsscx status on the one remaining red check (CTest ASAN+UBSAN):

This is expected red-by-design and is not yet stale — unlike #1340/#1341, the paired fix here (#1344) has not been merged yet. The regression deliberately fails while master still contains the signed→unsigned SeamlessIndicator UB, keying on UBSan's implicit conversion diagnostic.

Sequence to green:

  1. merge fix Fix: signed->unsigned SeamlessIndicator conversion in image ParseXml (#1342, #1343) #1344
  2. I refresh this branch with master (so its CI rebuilds with the fix)
  3. CTest goes green → merge this test PR

(The earlier shellcheck SC2155 failure is already fixed in 147cc25; pre-flight is green.)

@github-actions github-actions Bot added pending CI checks still running failed One or more CI checks failed and removed failed One or more CI checks failed pending CI checks still running labels Jun 14, 2026
@github-actions github-actions Bot added pending CI checks still running and removed failed One or more CI checks failed labels Jun 14, 2026
@xsscx xsscx enabled auto-merge (squash) June 14, 2026 22:16
@xsscx

xsscx commented Jun 14, 2026

Copy link
Copy Markdown
Member

Merge Conflict

<<<<<<< test-1342-1343-imageparse-signed-unsigned-regression
# Replays the #1342 / #1343 fuzz PoCs (negative SeamlessIndicator) through
# iccFromXml and fails if the signed->unsigned implicit conversion in the
# Embedded Height/Normal image ParseXml() handlers reappears.  Meaningful only
# under the integer/implicit-conversion sanitizer build (the script skips
# cleanly otherwise), so it carries the ubsan label.  No profile fixture needed
# -- the trigger XML files are committed test data.
iccdev_add_script_test(
  iccdev.issue-1342-1343-imageparse-signed-unsigned-regression
  120
  "iccdev;imageparse;signed-unsigned;regression;ubsan"
  "${ICCDEV_REPO_ROOT}"
  "${ICCDEV_REPO_ROOT}/.github/scripts/iccdev-issue-1342-1343-imageparse-signed-unsigned-regression.sh"
=======
# #1346: signed atoi() -> unsigned wrap in IccTagXml ParseXml handlers.
# Replays a PoC profile with a negative cicpFields ColorPrimaries attribute
# through iccFromXml; under the integer/implicit-conversion sanitizer the test
# FAILS if UBSan's implicit-integer-sign-change diagnostic reappears, and SKIPS
# cleanly on a plain (non-sanitizer) build.  Uses a committed PoC, so it needs
# no generated-profile fixture.
iccdev_add_script_test(
  iccdev.issue-1346-imageparse-atoi-unsigned-regression
  60
  "iccdev;xml;imageparse;issue-1346;regression;ubsan"
  "${ICCDEV_REPO_ROOT}"
  "${ICCDEV_REPO_ROOT}/.github/scripts/iccdev-issue-1346-imageparse-atoi-unsigned-regression.sh"
>>>>>>> master
)

@github-actions github-actions Bot added passed All CI checks passed and removed pending CI checks still running labels Jun 14, 2026
…eparse-signed-unsigned-regression

# Conflicts:
#	Build/Cmake/Testing/CMakeLists.txt
@colourbill-ctrl

Copy link
Copy Markdown
Contributor Author

Rebased onto current master and resolved the same additive CMakeLists conflict (the #1346 test merged via #1350 registers next to this #1342/#1343 test — kept both). Verified locally: both issue-1342-1343 and issue-1346 regressions Pass with their fixes in master.

@github-actions github-actions Bot added pending CI checks still running and removed passed All CI checks passed labels Jun 14, 2026
@xsscx xsscx merged commit 96f0af1 into master Jun 14, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build Build system, CMake, compiler, or packaging Configuration Repository, CMake, YAML, JSON, or tool configuration pending CI checks still running Scripts Shell, PowerShell, or repository automation scripts Testing CTest, regression, or test coverage Unix Linux, macOS, Bash, or POSIX shell scope

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bisect bab6678 CIccTagXmlEmbeddedNormalImage::ParseXml()

2 participants