Repository navigation
BUG: Return child preflight errors from ReadH5Ebsd without a crash - #1968
Closed
imikejackson wants to merge 1 commit into
Closed
imikejackson wants to merge 1 commit into
imikejackson wants to merge 1 commit into
Conversation
ReadH5Ebsd forwarded the preflight errors of RotateEulerRefFrame and RotateSampleRefFrame by calling errors() on a default (valid) Result<>. That is undefined behavior: a Debug build asserts, and a Release build writes through stack memory and crashes. A stored sample transform that is not a lossless grid rotation, such as 45 degrees about Z, triggered it. ReadH5Ebsd now returns the child errors as an error Result. Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
|
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
…lueQuartzSoftware#1968) Originally simplnx BlueQuartzSoftware#1968 (branch fix/read_h5ebsd_preflight_errors), 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
Read H5EBSD File crashed when the file stores a sample or Euler transformation that the rotation filter it calls rejects.
ReadH5Ebsd::operator()forwarded the preflight errors of Rotate Euler Reference Frame and Rotate Sample Reference Frame by callingerrors()on a defaultResult<>. A defaultResult<>holds a success, soerrors()on it is undefined behavior: a Debug build asserts inexpected::error(), and a Release build writes through stack memory and the process stops with a bus error (SIGBUS) or a stack-protector abort. Both places now return the child errors as an errorResult, as the same function already does for child execute errors. 2 files changed, +49 / −12 lines.The crash occurs only when the child preflight fails. Example: a stored
SampleTransformationAngleof 45 degrees, which Rotate Sample Reference Frame rejects because it is not a lossless grid rotation. A 90-degree rotation passes the child preflight and is not affected. Rotate Sample Reference Frame itself returns the correct error; only the forwarding in Read H5EBSD File was wrong.Change
src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ReadH5Ebsd.cpp— both child-preflight failure branches return{nonstd::make_unexpected(preflightResult.outputActions.errors())}.src/Plugins/OrientationAnalysis/test/ReadH5EbsdTest.cpp— new testOrientationAnalysis::ReadH5Ebsd: Child preflight errors. It copies the6_5_h5ebsd_exemplartest file to the test output directory and changes its stored transform: 45 degrees about (0, 0, 1) for the sample transform, and a zero Euler-transform axis. Execute must return exactly one error, -6850 from Rotate Sample Reference Frame or -96200 from Rotate Euler Reference Frame.Test plan
OrientationAnalysis::ReadH5Ebsdtests pass (6/6).SIMPLNX_TEST_ALGORITHM_PATH=1): the same tests pass (6/6).nxrunnerwith a 45-degree sample transform stopped at theexpected::error()assertion inReadH5Ebsd.cppbefore the fix.Related Issue