fix: silence Coverity UNUSED_VALUE in __create_descriptor_1d - #365
Merged
Merged
Conversation
The value returned by DftiFreeDescriptor on the reallocate path is consumed only by a debug-only assert(status == 0). Under NDEBUG the assert is stripped, so the store is dead before the unconditional status = 0 reset, which Coverity flags as UNUSED_VALUE (one CID per .c.src template instantiation). Mark the value as intentionally unused with (void)status to make the intent explicit and clear the finding.
antonwolfy
force-pushed
the
fix/coverity-unused-value-dfti-free
branch
from
August 10, 2026 11:42
b8efc24 to
59f1178
Compare
antonwolfy
marked this pull request as ready for review
August 11, 2026 11:45
antonwolfy
requested review from
jharlow-intel,
ndgrigorian,
vlad-perevezentsev and
xaleryb
as code owners
August 11, 2026 11:45
ndgrigorian
approved these changes
Aug 11, 2026
antonwolfy
added a commit
that referenced
this pull request
Sep 3, 2026
Backport of IntelPython/mkl_umath#266, adapted to mkl_fft. - Pin cython==3.3.0 in the Coverity workflow (only there, not in pyproject.toml) so the generated _pydfti.c stays byte-stable between scans and Coverity CIDs plus their triage survive. Works because the scan build uses --no-build-isolation. - Add coverity/README.md: where findings come from across mkl_fft's two translation units (template-generated mklfft.c, which is our DFTI logic and stays in scope, and Cython-generated _pydfti.c), the Cython-pin rationale, an opt-in Project Component, a review checklist, and the verified false-positive families for the mkl_fft project. The known false positives are grouped by checker + mechanism from the current scan: Cython-generated boilerplate (tp_traverse DEADCODE, version/ABI-guarded helper DEADCODE, a reference-cleanup UNUSED_VALUE, a CHECKED_RETURN) and two dead-by-construction families in our own .pyx (redundant is-NULL guards Cython already proves, and an intentional in-place placeholder stub) - all triaged Intentional / Ignore. The genuine __create_descriptor_1d UNUSED_VALUE defects were fixed in #365, not suppressed, so mklfft.c stays in scope. mkl_umath's own documented false positives were not ported blind; the table was rebuilt from mkl_fft's own scan and generated code.
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.
The PR resolves the Coverity UNUSED_VALUE (CWE-563) findings in
__create_descriptor_1d_*.On the
reallocate:path in mkl_fft/src/mklfft.c.src, the value returned byDftiFreeDescriptoris stored intostatusbut consumed only by the debug-onlyassert(status == 0). UnderNDEBUGthe assert is compiled out, so the store is dead before the unconditionalstatus = 0;reset — which Coverity flags.The behavior is correct as written (the old handle's free status is irrelevant since a fresh descriptor is built next). This marks the value as intentionally unused with
(void)status;to make the intent explicit and clear the finding.