BUG: apply ITK PR #6150 - use check_symbol_exists for TIFFFieldReadCount detection#116
Merged
blowekamp merged 1 commit intoApr 27, 2026
Conversation
Contributor
|
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( I do have some suggestions for making it better though... For recipe/meta.yaml:
This message was generated by GitHub Actions workflow run https://github.com/conda-forge/conda-forge-webservices/actions/runs/25007234114. Examine the logs at this URL for more detail. |
When building with ITK_USE_SYSTEM_TIFF=ON, check_type_size() was used to detect TIFFFieldReadCount (a function, not a type). Passing a function to sizeof() is non-standard and silently fails on MSVC, leaving ITK_TIFF_HAS_TIFFFieldReadCount undefined and causing itkTIFFImageIO to fall through to a stale libtiff 4.0.0-4.0.2 workaround that accesses an obsolete internal _TIFFField struct, causing NULL pointer crashes. Fixes: InsightSoftwareConsortium/ITK#6148 Upstream PR: InsightSoftwareConsortium/ITK#6150
ccec3e9 to
5b616ad
Compare
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
Applies the fix from upstream ITK PR InsightSoftwareConsortium/ITK#6150 as a recipe patch.
Bug
When building with
ITK_USE_SYSTEM_TIFF=ON(always the case in this feedstock), the CMake detection ofTIFFFieldReadCountusedcheck_type_size(), which internally callssizeof()on the argument. Passing a function name tosizeof()is non-standard — GCC and Clang accept it as an extension, but MSVC rejects it — soITK_TIFF_HAS_TIFFFieldReadCountwas never defined on Windows builds.Without that define,
itkTIFFImageIOfalls through to a libtiff 4.0.0–4.0.2 workaround that directly accesses the internal_TIFFFieldstruct. That struct layout is no longer correct for modern libtiff versions, causing reads of garbage data and NULL pointer crashes when encountering tags with unsupported data types (e.g. an ICC profile tag).Fixes: InsightSoftwareConsortium/ITK#6148
Fix
Replace
check_type_size(TIFFFieldReadCount ...)withcheck_symbol_exists(TIFFFieldReadCount "tiffio.h" ...)inModules/ThirdParty/TIFF/CMakeLists.txt, which correctly detects the function symbol on all compilers.Changes
recipe/0001-BUG-use-check_symbol_exists-for-TIFFFieldReadCount.patch— new patch applying the upstream fixrecipe/meta.yaml— addpatches:list, bump build number 2 → 3