Skip to content

Remove generated testbed/new.icc from the tree - #588

Closed
sallustfire wants to merge 1 commit into
mm2:masterfrom
sallustfire:remove-stray-testbed-new-icc
Closed

Remove generated testbed/new.icc from the tree#588
sallustfire wants to merge 1 commit into
mm2:masterfrom
sallustfire:remove-stray-testbed-new-icc

Conversation

@sallustfire

Copy link
Copy Markdown

I was hermetically building this and stumbled across testbed/new.icc, which is output of the test suite, not test data. The "Check MetaTag" test writes it fresh before ever reading it, and it's the only scratch profile the harness never cleans up with remove(). Being left behind after every run, it got committed by accident (a few times since 2022), and from there into the meson icc copy list, where it now breaks read-only checkouts:

$ chmod -R a-w Little-CMS
$ meson setup build Little-CMS && meson compile -C build && meson test -C build
...
Checking Check MetaTag ...
1/1 testcms FAIL   killed by signal 11 SIGSEGV

configure_file copies the corpus into the build dir preserving file modes, so the copied new.icc is read-only; fopen("new.icc", "wb") returns NULL and the unchecked fwrite crashes. A VPATH make check does the same, since cp also preserves the mode. As far as I can tell, writable checkouts never see any of this. There the test just silently rewrites the tracked file, which is why CI stays green and the only visible symptom has been the perpetually dirty tree.

This deletes the file, drops it from the meson list (configure_file errors on a missing input), and gitignores it. Verified: test output is byte-identical with the file absent, and the read-only meson run above passes after the change. The file isn't in EXTRA_DIST, so make dist tarballs never shipped it.

The leftover could also be eliminated at the source by having CheckMeta remove("new.icc") like every other test does with its scratch file. Then, nothing would ever leave the file behind, gitignored or not. Happy to add that here if you'd prefer; I left it out to keep this a pure deletion.

Running the test suite from an out-of-tree build of a read-only source
tree segfaults at "Checking Check MetaTag": both out-of-tree flows copy
the .icc corpus into the writable build directory preserving file modes
(configure_file copy in meson, cp in the autotools VPATH check rule), and
new.icc is the only "corpus" file a test opens for writing. fopen() of
the read-only copy returns NULL and the following fwrite() dereferences
it.

It is the only file that can fail this way because it is not corpus at
all: the Check MetaTag test reserializes ibm-t61.icc to memory, writes
the blob to new.icc and reopens it to re-read the meta dictionary. It is
written fresh on every run before it is ever read, so the tracked copy
is never used as input, and unlike every other scratch profile the
harness creates it is never removed afterwards. It is also absent from
EXTRA_DIST, and being dirty after every run it has been swept into
unrelated commits by accident several times (2022-06-05, 2023-01-03,
2024-03-11) - including into the meson iccs copy list when testbed runs
moved to the build directory, where the stray file was indistinguishable
from real test data.

Delete the file, drop it from the meson icc copy list (configure_file
fails on a missing input), and gitignore it so it is not re-committed.
The testbed produces byte-identical output with the file absent, and the
read-only out-of-tree run passes.
@mm2

mm2 commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Thanks for reporting. I am not adding this file to .gitignore since the issue comes from testcms2.c, so let's fix the root cause instead of ignoring the file. Fixed in d260167 and 1b1ec85

@sallustfire

Copy link
Copy Markdown
Author

Thanks for the quick fix. Agreed that removing it rather than ignoring it a better approach.

@sallustfire sallustfire closed this Aug 4, 2026
@sallustfire
sallustfire deleted the remove-stray-testbed-new-icc branch August 4, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants