Skip to content

Test: regression for iccApplyToLink -PCC profile ownership (#1336)#1340

Merged
xsscx merged 2 commits into
masterfrom
test-1336-applytolink-pcc-regression
Jun 14, 2026
Merged

Test: regression for iccApplyToLink -PCC profile ownership (#1336)#1340
xsscx merged 2 commits into
masterfrom
test-1336-applytolink-pcc-regression

Conversation

@colourbill-ctrl

Copy link
Copy Markdown
Contributor

Summary

Adds a deterministic CTest regression for the iccApplyToLink -PCC leak fixed in #1339 (issue #1336). On an upstream branch because it touches maintainer-owned automation paths (.github/scripts/, Build/Cmake/) that a fork PR cannot modify.

What it guards

iccApplyToLink must release every -PCC profile it opened on its error-exit paths (the leak in #1336 was an AddXform-failure early return that skipped the pccList cleanup). The script drives that path with committed test-data profiles:

iccApplyToLink <out> 0 17 1 Issue1336 0.0 1.0 0 1 \
  .github/ci/test-data/fuzz-mntr-ef352586.icc 1 \
  -PCC Testing/ApplyDataFiles/test-profiles/sRGB_D65_MAT.icc \
  .github/ci/test-data/fuzz-abst-a044ff69.icc 1

The abstract profile doesn't connect → AddXform returns icCmmStatBadSpaceLink → the early return. Pre-fix the -PCC profile is stranded (608 B via CIccProfile::ReadBasic); the run executes under LeakSanitizer and the test fails on any leak report. The tool is expected to exit non-zero (it's reporting the chain error), so the pass/fail signal is the absence of a leak, not the tool exit code.

Verification

Maintainer note — pairs with #1339 (the iccApplyToLink fix). Merge #1339 first, then this PR. This test is red until then by design: branched off master (which lacks the fix), it reproduces the leak it guards against. Hosted upstream (not the fork) because the fork-PR automation gate forbids fork PRs from touching .github/Build/Cmake.

🤖 Generated with Claude Code

Adds a script CTest that drives iccApplyToLink's AddXform error path with
committed test-data profiles (a monitor input profile with a -PCC attached,
followed by an abstract profile that fails icCmmStatBadSpaceLink) under
LeakSanitizer. Pre-fix the early return strands the -PCC profile (608 B via
CIccProfile::ReadBasic); the test fails on any LeakSanitizer report.

The tool is expected to exit non-zero (it is reporting the chain error), so the
pass/fail signal is the absence of a leak, not the tool exit code. Uses only
tracked profiles (no generated-profile fixture). Verified failing pre-fix and
passing with the #1339 fix applied.

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
@colourbill-ctrl

Copy link
Copy Markdown
Contributor Author

Maintainer note — pairs with #1339 (the iccApplyToLink -PCC fix). Merge #1339 first, then this PR. Expected red until then: branched off master (no fix), the issue-1336 CTest reproduces the 608-byte leak and fails. Turns green once #1339 lands and this branch is updated.

@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 03:26:28 UTC

@xsscx

xsscx commented Jun 14, 2026

Copy link
Copy Markdown
Member

Note: Auto-Merge is On. Merge on your Schedule.

@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 added this to the v2.3.2.2 milestone Jun 14, 2026
@xsscx xsscx self-requested a review June 14, 2026 19:11

@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.

Job Fail on CTest

2026-06-14 03:35:54 UTC

[FAIL] iccApplyToLink leaked a -PCC profile on the AddXform error path (#1336)
    #7 0x7f480ed191b2 in CIccProfile::ReadBasic(CIccIO*) /__w/iccDEV/iccDEV/IccProfLib/IccProfile.cpp:1363:12
    #10 0x55cd821da860 in main /__w/iccDEV/iccDEV/Tools/CmdLine/IccApplyToLink/iccApplyToLink.cpp:782:23
    #2 0x55cd821da860 in main /__w/iccDEV/iccDEV/Tools/CmdLine/IccApplyToLink/iccApplyToLink.cpp:782:23
    #2 0x55cd821da860 in main /__w/iccDEV/iccDEV/Tools/CmdLine/IccApplyToLink/iccApplyToLink.cpp:782:23
SUMMARY: AddressSanitizer: 608 byte(s) leaked in 11 allocation(s).

@colourbill-ctrl

Copy link
Copy Markdown
Contributor Author

The single failing check (CTest ASAN+UBSAN) is the regression behaving as designed: it reports the 608 byte(s) leaked from the iccApplyToLink.cpp:782 AddXform error path because the fix isn't on master yet. All other checks pass.

It goes green as soon as the paired fix #1339 is merged. Suggested order: merge #1339 (fix) → re-run this PR → merge #1340 (test). This split exists only because the fork-PR automation gate blocks fork PRs that touch test/CI paths, so the fix ships from the fork and the test ships here.

@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 labels Jun 14, 2026
@github-actions github-actions Bot removed the pending CI checks still running label Jun 14, 2026
@xsscx

xsscx commented Jun 14, 2026

Copy link
Copy Markdown
Member

@colourbill-ctrl #1339 Merged but this Job indicates Fail

@xsscx xsscx self-requested a review June 14, 2026 19:59

@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:59:31 UTC

Auto-Merge is On. Merge on your schedule.

@github-actions github-actions Bot added pending CI checks still running and removed failed One or more CI checks failed labels Jun 14, 2026
@colourbill-ctrl

Copy link
Copy Markdown
Contributor Author

Thanks @xsscx. The failure was stale, not a real leak: this PR's branch predated the #1339 merge, so the last CI run built iccApplyToLink without the fix and the regression correctly caught the (still-present-on-that-branch) leak.

I've merged current master (which now contains #1339 9b65b40) into this branch and pushed — CI will rebuild with the fix in place.

Verified locally (clang-18, ASAN+UBSAN), fix now in tree:

Test #21: iccdev.issue-1336-applytolink-pcc-regression ... Passed  0.07 sec
100% tests passed, 0 tests failed out of 1

Should go green on the re-run.

@github-actions github-actions Bot added passed All CI checks passed Merge Ready Approved, mergeable, and all CI checks passed and removed pending CI checks still running labels Jun 14, 2026
@xsscx xsscx merged commit d1d0467 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 Merge Ready Approved, mergeable, and all CI checks passed passed All CI checks passed 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.

CI c0d0fc2: Indirect Leak in CIccProfile::ReadBasic() at IccProfile.cpp:1363

2 participants