Repository navigation
Fix crashes from crash report triage - #14968
Merged
Merged
Conversation
A view without visible cells gives min > max, which underflowed the sector size and threw std::length_error when allocating the arrays. Call stack: [0] performCrashLogging at ResInsight/ApplicationExeCode/RiaMainTools.cpp:178 [1] manageSegFailureSA(int, siginfo_t*, void*) at ResInsight/ApplicationExeCode/RiaMainTools.cpp:310 [5] manageTerminate() at ResInsight/ApplicationExeCode/RiaMainTools.cpp:249 [12] RigResdataGridConverter::exportGrid(QString const&, RigEclipseCaseData*, bool, cvf::Array<unsigned char> const*, cvf::Vector3<unsigned long> const&, cvf::Vector3<unsigned long> const&, cvf::Vector3<unsigned long> const&) at ResInsight/ApplicationLibCode/ReservoirDataModel/RigResdataGridConverter.cpp:83 [13] RicExportEclipseSectorModelFeature::exportGrid(RimEclipseView*, RicExportEclipseSectorModelUi const&) at ResInsight/ApplicationLibCode/Commands/ExportCommands/RicExportEclipseSectorModelFeature.cpp:167 [14] RicExportEclipseSectorModelFeature::executeCommand(RimEclipseView*, RicExportEclipseSectorModelUi const&, QString const&) at ResInsight/ApplicationLibCode/Commands/ExportCommands/RicExportEclipseSectorModelFeature.cpp:141 [15] RicExportEclipseSectorModelFeature::openDialogAndExecuteCommand(RimEclipseView*) at ResInsight/ApplicationLibCode/Commands/ExportCommands/RicExportEclipseSectorModelFeature.cpp:118 [16] caf::CmdFeature::actionTriggered(bool) at ResInsight/Fwk/AppFwk/cafCommand/cafCmdFeature.cpp:176 [25] RiaGuiApplication::notify(QObject*, QEvent*) at ResInsight/ApplicationLibCode/Application/RiaGuiApplication.cpp:1879 [31] RiaGuiApplication::notify(QObject*, QEvent*) at ResInsight/ApplicationLibCode/Application/RiaGuiApplication.cpp:1879 [43] RiuViewerCommands::displayContextMenu(QMouseEvent*) at ResInsight/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp:702 [47] RiaGuiApplication::notify(QObject*, QEvent*) at ResInsight/ApplicationLibCode/Application/RiaGuiApplication.cpp:1879 [53] RiaGuiApplication::notify(QObject*, QEvent*) at ResInsight/ApplicationLibCode/Application/RiaGuiApplication.cpp:1879 [64] main at ResInsight/ApplicationExeCode/RiaMain.cpp:267 [65] __libc_start_main at :0
A 3D pick can report a grid index that is not valid for the view grid, which read past the end of the local grids in release builds. Call stack: [0] performCrashLogging at ResInsight/ApplicationExeCode/RiaMainTools.cpp:178 [1] manageSegFailureSA(int, siginfo_t*, void*) at ResInsight/ApplicationExeCode/RiaMainTools.cpp:310 [3] cvf::ref<RigLocalGrid>::p() at ResInsight/Fwk/VizFwk/LibCore/cvfObject.inl:307 [4] RiuCellAndNncPickEventHandler::handle3dPickEvent(Ric3dPickEvent const&) at ResInsight/ApplicationLibCode/UserInterface/RiuCellAndNncPickEventHandler.cpp:397 [5] RiuViewerCommands::handlePickAction(int, int, QFlags<Qt::KeyboardModifier>) at ResInsight/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp:756 [9] RiaGuiApplication::notify(QObject*, QEvent*) at ResInsight/ApplicationLibCode/Application/RiaGuiApplication.cpp:1879 [15] RiaGuiApplication::notify(QObject*, QEvent*) at ResInsight/ApplicationLibCode/Application/RiaGuiApplication.cpp:1879 [26] main at ResInsight/ApplicationExeCode/RiaMain.cpp:267 [27] __libc_start_main at :0
Repainting while the crash handler pumps the event loop can crash again, replacing the original report with one blaming the crash handler. Call stack: [0] performCrashLogging at ResInsight/ApplicationExeCode/RiaMainTools.cpp:178 [1] manageSegFailureSA(int, siginfo_t*, void*) at ResInsight/ApplicationExeCode/RiaMainTools.cpp:310 [21] RiaGuiApplication::notify(QObject*, QEvent*) at ResInsight/ApplicationLibCode/Application/RiaGuiApplication.cpp:1879 [30] RiaOpenTelemetryManager::reportCrash(int, std::basic_stacktrace<std::allocator<std::stacktrace_entry> > const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&) at ResInsight/ApplicationLibCode/Application/Tools/Telemetry/RiaOpenTelemetryManager.cpp:429 [31] performCrashLogging at ResInsight/ApplicationExeCode/RiaMainTools.cpp:211 [32] manageSegFailureSA(int, siginfo_t*, void*) at ResInsight/ApplicationExeCode/RiaMainTools.cpp:310 [52] RiaGuiApplication::notify(QObject*, QEvent*) at ResInsight/ApplicationLibCode/Application/RiaGuiApplication.cpp:1879 [62] main at ResInsight/ApplicationExeCode/RiaMain.cpp:267 [63] __libc_start_main at :0
kriben
approved these changes
Oct 19, 2026
magnesj
added a commit
to CeetronSolutions/resinsight-system-doc
that referenced
this pull request
Oct 19, 2026
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.
Three fixes from crash report triage, one commit each.
Problem
size_tsector size underflows, andRigResdataGridConverter::exportGridthrowsstd::length_errorfromvector::resize.RiuCellAndNncPickEventHandler::handle3dPickEventpasses the pickedgridIndexto the view grid'sgridByIndex. On intersections with a separate result definition the index belongs to another case, or is undefined. In release builds this reads past the end ofm_localGrids.QRhi::endFrame, 59 of 106 reports) or a pure virtual call (44) crashes again. The second crash is reported underRiaOpenTelemetryManager::reportCrashand hides the original.Fix
exportGridreturns false for an inverted box, and the caller logs the failure. Keyword and fault export just do nothing for an inverted range.gridByIndexreturns nullptr for an out-of-range index instead of asserting. The pick handler already checks for null.RiaGuiApplication::notifydrops events to widgets and windows. The network reply and the poll timer are not widgets, so the report still completes.Tests
RigResdataGridConverterTest.ExportGridWithInvertedBoxFailsandRigMainGridTest.GridByIndexOutOfRangeReturnsNullfail before the fixes and pass after them. Fix 3 is not reachable from a unit test and was verified by build only.Related
gridByIndexhas about 65 callers. Callers that do not check for null previously had undefined behaviour on an out-of-range index, and now get nullptr.Call stack