Skip to content

Well target mapping: Fix crashes from invalid bounds and missing result data - #14650

Merged
magnesj merged 2 commits into
devfrom
well-target-robustness
Aug 31, 2026
Merged

Well target mapping: Fix crashes from invalid bounds and missing result data#14650
magnesj merged 2 commits into
devfrom
well-target-robustness

Conversation

@magnesj

@magnesj magnesj commented Aug 31, 2026

Copy link
Copy Markdown
Member

Fixes two crash-prone spots in well target mapping:

Both add defensive checks and fall back to safe defaults instead of crashing.

Seen when using test dataset from https://github.com/CeetronSolutions/resinsight-tutorials/tree/main/model-data/grid_ensemble

…unds

std::clamp() invokes undefined behavior when the low bound is greater
than the high bound. In resetMinimumCellValuesToDefault(), the
minimum/maximum bounds for saturation, pressure, permeability and
transmissibility are derived from case data and can end up inverted
when no data is available, which crashed or produced garbage values.
…or incomplete result data

RigWellTargetMappingTools accessed cellScalarResults() and result vectors without verifying the requested time step or index was within bounds, and without checking for null case data pointers.  Add the missing guards.
@magnesj
magnesj requested a review from jonjenssen August 31, 2026 09:23
@magnesj
magnesj merged commit fd219da into dev Aug 31, 2026
19 checks passed
@magnesj
magnesj deleted the well-target-robustness branch August 31, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants