Repository navigation
BUG: Report an error for an empty or malformed EBSD phase table - #1971
Closed
imikejackson wants to merge 1 commit into
Closed
imikejackson wants to merge 1 commit into
imikejackson wants to merge 1 commit into
Conversation
- ReadChannel5Data::loadMaterialInfo() returned the reader's error code, 0, when the .cpr file listed no phases. The filter continued with an uninitialized ensemble row (Crystal Structures 0, Hexagonal_High, instead of 999) and then failed with an exception. Preflight and execute now return -66502. - ReadH5Ebsd read six lattice constants from each phase without checking the size of getLatticeConstants(), and wrote each phase at its phase index without checking it against the ensemble size. A phase with fewer than six lattice constants now returns -50028, and a phase index outside 1..N returns -50029, before any ensemble value is written. 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. |
4 of 7 tasks
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
…QuartzSoftware#1971) Originally simplnx BlueQuartzSoftware#1971 (branch fix/ebsd-reader-phase-table-checks), 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
Two EBSD readers accepted a phase table that they could not use.
ReadChannel5Data::loadMaterialInfo()returned the reader's error code when the.cprfile listed no phases. That code is 0, so the filter continued with an uninitialized ensemble row 0 (Crystal Structures 0, which is Hexagonal_High, instead of 999 Unknown) and an empty Material Name. Ondevelopthe new test then fails with an exception:DataStructure::getDataRef(): Input Path 'DataContainer' does not exist. Preflight also accepted the file.LoadInfo()inReadH5Ebsd.cpp) read six values fromgetLatticeConstants()without checking the vector size, so a phase with fewer than six lattice constants was read out of bounds. The loop also wrote each phase at its phase index without a bound check, so a phase table with indices 1 and 3 wrote past the ensemble arrays. Ondevelopthe new test returns success for the short lattice-constant case and ends withSegFaultfor the phase-index case.Changes:
.cpr[Phases]section lists no phasesGeneratePreflightPhaseInformation) is rewritten by BUG: Validate EBSD reader headers, scans and slice ranges #1967. After both merge, the check can move to preflight.Overlap with open pull requests
fix/ebsd-vv-filter-items) changesReadChannel5Data.cpp(operator()()),ReadChannel5DataFilter.cpp(preflightImpl(), other hunks),ReadChannel5DataTest.cppandReadH5EbsdTest.cpp. I checked its diff: it does not fix either item. Its lattice-constant check is only for H5OIM and H5Esprit (IEbsdOemReader.hpp), and it does not touchloadMaterialInfo()orReadH5Ebsd.cpp. This change is kept small; whichever of the two merges second rebases (the test files will conflict at the end).ReadH5Ebsd.cpp::operator()()(child preflight errors). No hunk overlaps.Existing branches
I checked every branch on
originandforkfor commits not indevelopthat touch the changed files. None fixes these items. Branches that touch the same files:fix/ebsd-vv-filter-items(#1967;ReadChannel5Data.cpp,ReadChannel5DataFilter.cppand both test files),fix/read_h5ebsd_preflight_errors(#1968;ReadH5Ebsd.cppoperator()()andReadH5EbsdTest.cpp), andtopic/correct_feature_am_updates(#1913; one argument added inReadH5Ebsd.cppoperator()()andReadH5EbsdTest.cpp). None of them changesloadMaterialInfo()or the phase loop inLoadInfo().Test Plan
develop(0cd2009) and pass with this change:OrientationAnalysis::ReadChannel5Data: Empty phase list(filter preflight and execute, and the algorithm without the filter)OrientationAnalysis::ReadH5Ebsd: Phase table validation(a phase with 3 lattice constants, and phase indices 1 and 3)ctest -R "OrientationAnalysis::(ReadChannel5Data|ReadH5Ebsd)"..cpr/.crcand.h5ebsdfiles with the existing fixture writers; no new data archives.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 #1868 (item
ReadChannel5DataFilter#3) and #1866 (itemReadH5EbsdFilter#4, both the lattice-constant and the phase-index parts).🤖 Generated with Claude Code