Commit Graph
501 Commits
Author SHA1 Message Date
Magne Sjaastad d339a34910 #14149 Fix crash when reading corrupt or truncated Eclipse INIT keyword
ecl_kw_fread_alloc() returns NULL if a keyword cannot be read, e.g. when
the backing file is truncated or corrupt. ecl_file_kw_load_kw() then
called ecl_file_kw_assert_kw() unconditionally, which dereferenced the
NULL keyword and caused a SIGSEGV.

Guard the assert and inv-map registration so they only run when the read
succeeded. The NULL keyword is propagated to the calling scope, which
already handles a missing keyword gracefully.
2026-06-10 17:46:13 +02:00
Magne Sjaastad 668b844051 #14144 Guard against buffer overflow when reading corrupt well data records
A truncated or corrupt restart file could provide a Fortran record-length header larger than the destination buffer, causing fortio_fread_record to fread past the heap allocation and crash. Bound each record read to the remaining buffer capacity and treat an oversized record as a read failure, which propagates up as a normal failed read instead of a segfault.
2026-06-08 15:54:52 +02:00
Magne Sjaastad 022d77bef8 macOS: Initial Apple Silicon and x86_64 build support
* Refactor: add MACOSX_BUNDLE option to qt_add_executable in multiple CMakeLists.txt files
* #14045 macOS: Guard std::stacktrace usage and skip ucontext on Apple platforms
* #14045 macOS: Guard std::ispanstream with std::istringstream fallback
* #14045 macOS: Add vcpkg overlay triplets for osx and exclude grpc on osx
* #14045 macOS: CMake macOS build support and openzgy OpenMP-disable patch
* #14045 CI: Add macOS build workflow
* #14045 macOS: Use feature-test macros to detect <stacktrace> and <spanstream>
* #14045 macOS: Make MAX_STIMPLAN_LAYERS constexpr to fix arm64 link error
* #14045 CI: Ship README-macOS.txt with artifact to document Gatekeeper workaround
* #14045 CI: Pin macOS runner to macos-14 and set deployment target to 14.0
* #14045 CI: Move macOS runner to macos-15 and fix README step on configure failure
2026-06-01 12:38:55 +02:00
Magne Sjaastad 4e65583425 #14004 resdata: Backport robustness fixes from equinor/resdata#1166
Guard zero-length keywords in ecl_kw_max_min, increase grdecl buffer to 256 and bound sscanf widths, and validate dimensions and keyword sizes (COORD, ZCORN, MAPAXES, CORSNUM, ACTNUM) when loading GRDECL grids.
2026-05-19 07:58:37 +02:00
Magne Sjaastad 3efdbafa0c #14004 surfio: Update to 0.0.20 and link fast_float from vcpkg 2026-05-19 07:58:37 +02:00
Magne Sjaastad e6cc90a7b5 Update vcpkg to fix CMake 4 issues on Linux
Update the vcpkg submodule to resolve compatibility issues encountered when using CMake 4 on Linux.
2026-04-14 12:44:36 +02:00
Magne Sjaastad 60f2ede781 Fix crash in ecl_file_scan when UNRST file is locked or being written
Add NULL stream guards in fortio_ftell and fortio_fseek__ to prevent SIGSEGV when fortio->stream is NULL during ecl_file_scan. This mirrors
the defensive fix applied to ESmry::loadData for UNSMRY files.
2026-03-17 14:03:11 +01:00
Magne Sjaastad ec7470d1e6 Fix ESmry::loadData crash when UNSMRY file is locked or being written
Update custom-opm-common submodule with guards against crashes in ESmry::loadData(vectList) when ensemble summary files are incomplete or inaccessible during project load.
2026-03-17 14:03:11 +01:00
Magne Sjaastad 46b56a800c #12560 Surface: Add export to GRI format with UI dialog and context menu integration
CMake: Change mdspan link from PRIVATE to PUBLIC for surfio_lib
2026-03-16 14:00:07 +01:00
Kristian Bendiksen d9e331f560 Update regression-analysis (fixes missing assert.h include) 2026-03-13 12:45:13 +01:00
Jon Jenssen f7154a8146 Fix crash issue with empty blocks when removing block keywords from file deck 2026-03-13 11:41:20 +01:00
David Landa Marban 188a52cd1e Removing unused boost::system 2026-03-13 10:38:57 +01:00
Magne Sjaastad 56fc450543 opm-flowdiagnostics-applications: Improvements to relative perm curves
Integrate PR https://github.com/OPM/opm-flowdiagnostics-applications/pull/116 for testing
2026-03-09 14:43:21 +01:00
Magne Sjaastad ab1cd9bb22 #13603 Replace bool/errorText with std::expected in ExpressionParser
evaluate() and expandIfStatementsAndEvaluate() now return std::expected<void, QString>: the error message is always part of the return value rather than an optional out-parameter, making it impossible for callers to silently discard errors.

Update RimGridCalculation and RimSummaryCalculation to use evaluateResult.error() instead of a separate errorText variable.
2026-02-23 19:19:09 +01:00
copilot-swe-agent[bot] 8bbd0d2551 Improve support for aggregating functions
When aggregating functions (min, max, sum, avg) are applied to a single vector variable, they compute a scalar result over the whole vector. These must be pre-computed before the element-wise for loop, otherwise the variable gets replaced with its indexed version (e.g. min(b) -> min(b[i])) which changes the semantics: min(b[i]) returns b[i], not min of all b.

Add check for pattern: c := agg_func(if(condition, true_expr, false_expr)).  Computes a scalar aggregate of the element-wise if-result and assigns it as a constant to all elements of c.
2026-02-23 19:19:09 +01:00
Magne Sjaastad cb8a069ccd Add support for custom validation callbacks on fields
* Add support for custom validation callbacks on fields

Introduce setCustomValidationCallback to PdmFieldHandle, allowing custom validation logic via user-provided lambdas or functions. The validate() method now invokes this callback if set, in addition to built-in checks. Includes comprehensive unit tests for custom and combined validation scenarios. Backward compatible: default behavior unchanged if no callback is set.
2026-02-09 16:48:42 +01:00
Magne Sjaastad adc450ead8 Update opm-common submodule to latest commit 2026-02-03 17:14:45 +01:00
Kristian Bendiksen 116c3b83a5 #13530 Fix RMS well path import with spaces in well names
The RMS well parser now correctly handles well names containing spaces.
Previously, ReadNext<std::string>() stopped at the first whitespace,
causing parsing failures. The fix reads line 3 as a whole and parses
coordinates from the end, treating remaining tokens as the well name.
2026-02-02 14:26:19 +01:00
Magne Sjaastad f06bd7f129 Fix missing display of legends in Qt 6.9
Updates the Qwt subproject to the latest commit to incorporate necessary fixes and improvements for legend-related issues in Qt6.
2026-01-13 17:15:33 +01:00
Kristian BendiksenandMagne Sjaastad d80ada607f #11807 Upgrade to Clipper2
Replaces the deprecated Clipper library with the actively maintained Clipper2 library.

Removes the local copy of the Clipper library and uses vcpkg to manage the dependency.

Fixes #11807

Co-authored-by: Magne Sjaastad <magne.sjaastad@ceetronsolutions.com>
2026-01-07 16:07:09 +01:00
JJ 6eea1f023a Update to latest Qt Advanced Docking (#13344)
* Update to latest Qt Advanced Docking
2025-12-15 20:41:08 +01:00
Kristian Bendiksen 8f9b416563 #12876 Include RKB distance when importing RMSwell.
Fixes #12876.
2025-12-15 13:56:41 +01:00
jonjenssen e7ac0675db Handle IF keyword in any upper/lowercase variation 2025-12-13 08:53:47 +01:00
Kristian Bendiksen a6298b1b30 Allow 'm' as mapunits for opm-common 2025-12-05 14:18:45 +01:00
jonjenssen bcb930f36a Handle empty blocks in FileDeck iterator++ 2025-12-03 14:19:26 +01:00
JJ 39c2282904 Handle active cells in files with thermal data (rockv) (#13159)
* Handle active cells in files with thermal data from intersect
2025-11-12 07:13:24 +01:00
Magne Sjaastad 6df569850d Remove unintended install files
* Exclude mdspan from INSTALL target
* Exclude zfp from INSTALL target
* Avoid install of googletest
2025-11-11 13:51:28 +01:00
Magne Sjaastad 5fd210e4c5 Update opm-flowdiagnostics to support imbibition curves 2025-11-07 16:00:35 +01:00
Jon Jenssen 7afa639928 Use updated opm-common EGrid reader with improved dual porosity handling. 2025-11-05 14:33:48 +01:00
JJ 453562082d Summary case refresh update. (#13123)
Use improved opm-common reader with less throws.
Add reload selected cases button
Add timer for auto-reload of cases
Add include in auto update option for cases and ensembles
Do not enable auto reload option for cases in an ensemble
2025-11-03 18:41:55 +01:00
Magne Sjaastad 95c7ad133c Update opm-common submodule 2025-11-03 09:56:19 +01:00
Magne Sjaastad 9923f0ed1b Update submodule to fix end point scaling issues 2025-10-28 13:15:54 +01:00
jonjenssen e0893cfa6f Add extra checks for result indexes and update opm-common with dual poro fixes 2025-10-28 06:37:21 +01:00
Magne Sjaastad 91192a671c Use opm-flowdiagnostics-applications as submodule
* Deletes the copy of the code in ThirdPary folder
* Replace code with opm-flowdiagnostics-applications as submodule
* Refactors ECL data handling for flow diagnostics
Updates flow diagnostics to utilize ECL init data consistently.
This change streamlines the passing and usage of initialization
data within the flow diagnostics routines, enhancing code
clarity and maintainability. Removes redundant passing of grid
data, simplifying function signatures.
2025-10-27 14:09:57 +01:00
Magne Sjaastad 688ab51ee8 Support reading unrst files without seqnum data. 2025-10-24 19:50:05 +02:00
Magne Sjaastad 6bc251896c Update surfio
Fixes a compile issue for Debug builds on Visual Studio 2022
2025-09-12 08:07:17 +02:00
Magne Sjaastad 7a483bdb4e Adds update procedure for opm-common keywords
Documents the procedure for updating the generated C++ code for Eclipse keywords from JSON definition files in the opm-common library.

This procedure is necessary when updating to a newer version of opm-common, when new keywords are added, or when existing keyword definitions change.
2025-09-10 12:50:20 +02:00
Magne Sjaastad a0a0919681 Update opm-common
Update opm-common based on latest main branch
Use branch https://github.com/CeetronSolutions/opm-common/tree/development-01
Update generated opm-common files
2025-09-10 12:50:20 +02:00
Kristian Bendiksen 8b457f2156 Fix: Memory leak in well_state_add_MSW2
The function `well_state_add_MSW2` in `well_state.cpp` would allocate
an `ecl_rsthead_type` object but would not free it in the case where
the `RSEG_KW` keyword was not found in the restart file view.

This would lead to a memory leak.

This commit fixes the issue by freeing the allocated object before
returning from the function in the error case.
2025-09-04 09:04:30 +02:00
Magne Sjaastad 72d6b303b1 Prepare dev after release 2025-09-01 15:57:40 +02:00
Kristian Bendiksen 545d827774 #12654 Las import: fix crash for files with CR/LF on linux
The file in question had a "empty" line with CR/LF line ending at
the end of the file.

When reading this on linux (using getline) you get a non-empty string
containing the CR token. For these cases GetRecord returns true
with a empty record vector, and this expected in the calling code.

Crash happens when accessing the first (non-existing) element of the
empty vector when trying to provide error message.

Fixed by having GetRecord return false when vector is empty.

Fixes #12654.
2025-07-30 13:44:18 +02:00
Magne Sjaastad bc5d9f2b4f Use upstream repo for surfio 2025-07-25 11:26:46 +02:00
Magne Sjaastad 13a793f16c #12461 Add support for import of .irap and .gri
* Add surfio as submodule and create importer with tests
* Update compile fix when mio.h is included in multiple compile units
* Move file tools into RifFileTools
2025-05-28 09:50:45 +02:00
Magne Sjaastad 5e37c58d18 Hide some CMake warnings 2025-05-15 15:59:07 +02:00
Magne Sjaastad a958912378 Update opm-common
* Update opm-common
Include fix for tNavigator summary import
* Build opm-common from source
* Remove binary caching of opm-common
The caching is no longer required as a clean build takes minutes. In a previous version the build time was up to an hour on some systems.
2025-05-14 06:57:25 +02:00
Magne 57017a166c Add minimum requirements for CMake, gcc and clang
On Linux, link with stdc++exp
Define requirements in README
2025-05-09 15:54:28 +02:00
Magne Sjaastad a09a189214 Update to clang-tidy 18
* remove unused variable
* Use clang-18 for ResInsight build
* Update to clang-tidy-18
* Add NOLINTNEXTLINE
2025-04-14 20:31:11 +02:00
jonjenssen 9a9bb17a1b Bugfix: avoid keeping init file open. 2025-03-26 21:52:06 +01:00
Magne Sjaastad 5f7823b8d3 Use point size when defining font size
Avoid pixel size for easier config across multiple environments
Set default font size for plots to 10 points
Use Small instead of XSmall for default font in plot
Remove pt postfix to indicate point size
2025-03-10 16:56:16 +01:00
jonjenssen ea9a1b7d85 Update to latest open-zgy (#12161) 2025-02-13 15:07:41 +01:00