Repository navigation
BUG: Fix cifti_tool's CIFTI extension search, which never advanced - #126
Draft
hjmjohnson wants to merge 3 commits into
Draft
hjmjohnson wants to merge 3 commits into
hjmjohnson wants to merge 3 commits into
Conversation
hjmjohnson
marked this pull request as ready for review
September 24, 2026 12:18
hjmjohnson
marked this pull request as draft
October 6, 2026 15:02
hjmjohnson
force-pushed
the
stack/pr-fix-analyzer-leaks
branch
from
November 2, 2026 15:32
a0f6bd3 to
eae24db
Compare
hjmjohnson
force-pushed
the
stack/fix-axml-skip-depth
branch
2 times, most recently
from
November 6, 2026 14:59
cd03008 to
fe446fe
Compare
hjmjohnson
force-pushed
the
stack/pr-fix-analyzer-leaks
branch
from
November 6, 2026 14:59
eae24db to
5748f94
Compare
gdevenyi
requested changes
Nov 12, 2026
gdevenyi
left a comment
Collaborator
There was a problem hiding this comment.
Review by Google Carbon
Verdict: Request Changes (Draft; unbundle hitchhiking #94 + defensive ext_list guard & test sanitizer regex)
Good catch in disp_cifti_extension (cifti/cifti_tool.c:214-219) — previously ext was initialized to nim->ext_list outside the loop and never incremented (ext->ecode checked ind times on element 0!), both misidentifying extension 0 as CIFTI whenever any later extension had NIFTI_ECODE_CIFTI and printing extension 0's payload instead!
Three items to address before merging:
- Unbundle PR
#94(.github/check_workflow_triggers.py): Currently hitchhikes in this branch; drop it when rebasing ontomaster. - Guard
nim->ext_list != NULLbefore indexingnim->ext_list[ind](cifti/cifti_tool.c:215-216): Compareaxio_read_cifti_ext(cifti/afni_xml_io.c), which validatesnim->num_ext > 0 && nim->ext_list != NULL. - Include ASan/LSan/UBSan in
FAIL_REGULAR_EXPRESSION(cifti/CMakeLists.txt:52).
hjmjohnson
force-pushed
the
stack/fix-axml-skip-depth
branch
from
November 17, 2026 22:50
fe446fe to
977b40c
Compare
hjmjohnson
force-pushed
the
stack/pr-fix-analyzer-leaks
branch
from
November 17, 2026 22:50
5748f94 to
0472f7c
Compare
Member
Author
A branch filter naming a branch that does not exist leaves the workflow configured but never run, which looks the same as one that runs and passes: no red check appears because no check appears at all. build.yml sat dead behind a filter naming main on a repository whose branch is master, and the only thing that found it was reading the file. The check judges a filter only when every entry is a literal name, so a release-* pattern or a branch that does not exist yet is left alone, and it reports a name that resolves to nothing rather than one that merely differs from the default. (cherry picked from commit db038e9)
disp_cifti_extension() searched for the CIFTI extension with
ext = nim->ext_list;
for( ind = 0; ind < nim->num_ext; ind++ )
if( ext->ecode == NIFTI_ECODE_CIFTI ) break;
ext is never advanced, so this tests the first extension num_ext times.
cifti_tool could only ever find a CIFTI extension that happened to be
first in the list; with any other extension ahead of it the tool
reported 'no CIFTI extension' for a file that has one. It now indexes
ext_list[ind] and leaves ext NULL when there is no match, which also
avoids the read past the end of the list that a bare ext++ would have
introduced.
The same function opened its output stream before the 'no CIFTI
extension' check and returned without closing it; the early return now
closes the stream like the normal path does.
(cherry picked from commit d93153c)
cext_second_extension.nii carries a comment extension ahead of the CIFTI one. The test requires the extension's payload in the output and forbids the 'no CIFTI extension' message, and the existing unterminated-cext test still pins the first-position case, so neither a search that always matches nor one that never does would pass. (cherry picked from commit 2405d09)
hjmjohnson
force-pushed
the
stack/fix-axml-skip-depth
branch
from
November 19, 2026 19:01
977b40c to
22bb490
Compare
hjmjohnson
force-pushed
the
stack/pr-fix-analyzer-leaks
branch
from
November 19, 2026 19:01
0472f7c to
0bc2c4f
Compare
Member
Author
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.
Re-submission of #56, reverted from
masteron 2026-09-24. Content isunchanged from the original.
Position 4 of 11 in the deep stack. Base:
stack/fix-axml-skip-depth.Based on the pull request above it in the stack, so the diff shown here is
this change alone. Merge the stack bottom-up.
Stack order
stack/test-regression-coveragemasterstack/pr-fix-alloc-null-checksstack/test-regression-coveragestack/fix-axml-skip-depthstack/pr-fix-alloc-null-checksstack/pr-fix-analyzer-leaks<- this PRstack/fix-axml-skip-depthstack/pr-fix-sign-conversionstack/pr-fix-analyzer-leaksstack/fix-fslio-64bit-arithmeticstack/pr-fix-sign-conversionstack/fix-cifti-null-streamstack/fix-fslio-64bit-arithmeticstack/pr-fix-calloc-transposed-argsstack/fix-cifti-null-streamstack/pr-fix-shorten-64-to-32stack/pr-fix-calloc-transposed-argsstack/fix-image-read-complex-checkstack/pr-fix-shorten-64-to-32stack/pr-fix-xml-read-errorsstack/fix-image-read-complex-checkThe order is the order these changes sat on
masterbefore the revert, soit builds and tests at every step.
Commits introduced by this PR
Ordering for all the re-submitted work is tracked in #84.