Repository navigation
BUG: Check the Phase of Interest and its crystal structure in Write GBCD GMT - #1970
Closed
imikejackson wants to merge 1 commit into
Closed
imikejackson wants to merge 1 commit into
imikejackson wants to merge 1 commit into
Conversation
…BCD GMT - WriteGBCDGMTFile indexed GetAllOrientationOps() with the Crystal Structures value of the Phase of Interest without a check. Phase 0, whose value is 999 (Unknown), or any phase with an unknown crystal structure read past the end of the vector and crashed. - The Phase of Interest was also used to index Crystal Structures without a check against its tuple count. - New ValidatePhaseOfInterest(), called by preflight and the algorithm, rejects a phase below 1 (-96715), a phase missing from the GBCD array (-96712, unchanged) and a phase missing from Crystal Structures (-96716). - The algorithm returns -96717 when the crystal structure of the phase has no Laue operations, before it indexes them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
This was referenced Nov 13, 2026
Contributor
Author
|
Closed in favor of #1973, which merges this branch (with its history) together with the other EBSD fixes that need the next EbsdLib release (BlueQuartzSoftware/EbsdLib#86). The branch is kept. 🤖 Generated with Claude Code |
This was referenced Nov 13, 2026
imikejackson
added a commit
to imikejackson/simplnx
that referenced
this pull request
Nov 14, 2026
…BCD GMT (BlueQuartzSoftware#1970) Originally simplnx BlueQuartzSoftware#1970 (branch fix/writegbcdgmt-crystal-structure-check), combined into this branch for the EbsdLib 3.1.4 update. Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
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
Write GBCD Pole Figure (GMT 5) indexed
ebsdlib::LaueOps::GetAllOrientationOps()withCrystalStructures[PhaseOfInterest]without a check (WriteGBCDGMTFile.cpp,operator()()). Phase 0 always holds 999 (UnknownCrystalStructure), so Phase of Interest = 0, or any phase with an unknown crystal structure, read past the end of the vector and dereferenced garbage. Ondevelopthe new test crashes with a segmentation fault. The phase was also used to index the cached Crystal Structures without a check against that array's tuple count.Changes:
WriteGBCDGMTFile::ValidatePhaseOfInterest(), whichpreflightImpl()and the algorithm'soperator()()both call. Preflight can see the parameter and the tuple counts, but not the array values, so it rejects phase 0 (the Unknown phase) and phases that either array does not hold.GetAllOrientationOps().size()before it indexes the operations. Preflight cannot read array values, so this check runs in execute.The -96715 and -96716 checks also fix the phase-range part of #1873
WriteGBCDGMTFileFilter#4(negative phase, and a phase past the shorter ensemble array), because the crash and those checks are on the same line.Other unchecked
GetAllOrientationOps()indexes in OrientationAnalysisI audited every OrientationAnalysis algorithm that indexes the orientation-ops vector. Each one checks its index before use except these sites. All of them are in the EBSD readers' preflight phase summary and are a different defect (a file value, not a Crystal Structures array value), so they are not in this PR:
utilities/EbsdReaderUtilities.hppGeneratePreflightPhaseInformation:laueOps[phaseInfo->determineOrientationOpsIndex()]in three branches (ANG / H5OIM, CTF / H5OINA / CPR, H5Esprit). BUG: Validate EBSD reader headers, scans and slice ranges #1967 adds the check.GetOrientationOpsFromSpaceGroupNumber()dereferenced with no null check. BUG: Validate EBSD reader headers, scans and slice ranges #1967 adds the check. BUG: Use one EbsdLib space-group mapping in Read GrainMapper3D #1962 edits the same line and still has no null check.Overlap with open pull requests
WriteGBCDGMTFile.cpp/.hpp,WriteGBCDGMTFileFilter.cpp, the filter doc andWriteGBCDGMTFileTest.cppin other hunks. Both add a test case at the end of the test file and a declaration beforeoperator()()in the header, so whichever merges second rebases (small conflict).WriteGBCDGMTFileFilter::executeImpl(); this PR changespreflightImpl()only.Existing branches
I checked every branch on
originandforkfor commits not indevelopthat touch the changed files. None fixes this item. The only other branch that touches them isfix/orientation-axis-direction-validation(#1969, misorientation axis validation, different hunks).Test Plan
OrientationAnalysis::WriteGBCDGMTFileFilter: Phase and Laue Index Boundsfails ondevelop(0cd2009): preflight accepts phase 0 and a phase missing from Crystal Structures, and the Unknown crystal structure case ends withSegFault. It passes with this change.ctest -R "OrientationAnalysis::WriteGBCDGMTFileFilter".bluequartz-skills:cpp-best-practices,bluequartz-skills:simplnx-best-practices,filter-implementation,implement-filter-tests,error-messages,dual-build-protocol,clang-format,github-workflow.docs/Coding_Knowledge_Base.mdwas followed instead.Related Issue
Related to #1879 (item
WriteGBCDGMTFileFilter#5) and #1873 (itemWriteGBCDGMTFileFilter#4, phase range).🤖 Generated with Claude Code