Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in summary files from Eclipse 2023, double free or corruption #945

Closed
berland opened this issue Jan 12, 2024 · 3 comments · Fixed by #948
Closed

Crash in summary files from Eclipse 2023, double free or corruption #945

berland opened this issue Jan 12, 2024 · 3 comments · Fixed by #948
Assignees
Labels

Comments

@berland
Copy link
Contributor

berland commented Jan 12, 2024

In summary files with restarts involved and written by Eclipse version 2023.1, EclSum("CASE.DATA") gives a crash probably in the lines:

void rd_sum_set_case(rd_sum_type *rd_sum, const char *input_arg) {
free(rd_sum->rd_case);
free(rd_sum->path);
free(rd_sum->abs_path);
free(rd_sum->base);
free(rd_sum->ext);

When the same DATA file is run with Eclipse 2021.3, the summary file is read without any crash.

*** Error in `/prog/res/komodo/2023.12.05-py38-rhel7/root/bin/python': double free or corruption (out): 0x0000000002b2f050 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x81329)[0x7fed5193c329]
/prog/res/komodo/2023.12.05-py38-rhel7/root/lib64/python3.8/site-packages/resdata/.libs/libresdata.so(rd_sum_set_case+0x2f)[0x7fed4590189f]
/prog/res/komodo/2023.12.05-py38-rhel7/root/lib64/python3.8/site-packages/resdata/.libs/libresdata.so(rd_sum_fread_alloc_case2__+0x5e)[0x7fed4590240e]
/prog/res/komodo/2023.12.05-py38-rhel7/root/lib64/python3.8/site-packages/resdata/.libs/libresdata.so(rd_sum_fread_alloc_case2__+0x102)[0x7fed459024b2]
/lib64/libffi.so.6(ffi_call_unix64+0x4c)[0x7fed47559dec]
/lib64/libffi.so.6(ffi_call+0x1f5)[0x7fed47559715]
/opt/rh/rh-python38/root/usr/lib64/python3.8/lib-dynload/_ctypes.cpython-38-x86_64-linux-gnu.so(_ctypes_callproc+0x96e)[0x7fed47b080de]
/opt/rh/rh-python38/root/usr/lib64/python3.8/lib-dynload/_ctypes.cpython-38-x86_64-linux-gnu.so(+0x1446b)[0x7fed47b0846b]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(PyObject_Call+0x33e)[0x7fed5291b45e]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyEval_EvalFrameDefault+0x241b)[0x7fed529d233b]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyEval_EvalCodeWithName+0x3d4)[0x7fed529b8284]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyFunction_Vectorcall+0x39b)[0x7fed529b95cb]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyObject_FastCallDict+0x54)[0x7fed5292dad4]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyObject_Call_Prepend+0xcc)[0x7fed52932c2c]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(+0x227419)[0x7fed52a0c419]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyObject_MakeTpCall+0x442)[0x7fed5291f7a2]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyEval_EvalFrameDefault+0x57c8)[0x7fed529d56e8]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyEval_EvalCodeWithName+0x3d4)[0x7fed529b8284]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(+0x1d5bb9)[0x7fed529babb9]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyObject_MakeTpCall+0x2d2)[0x7fed5291f632]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyEval_EvalFrameDefault+0x51ec)[0x7fed529d510c]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyEval_EvalCodeWithName+0x3d4)[0x7fed529b8284]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(PyEval_EvalCode+0x23)[0x7fed52a45f03]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(+0x2692fc)[0x7fed52a4e2fc]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(+0x1730bf)[0x7fed529580bf]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyEval_EvalFrameDefault+0x40b)[0x7fed529d032b]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(+0x16fdfa)[0x7fed52954dfa]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyEval_EvalFrameDefault+0x579a)[0x7fed529d56ba]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(+0x16fdfa)[0x7fed52954dfa]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyEval_EvalFrameDefault+0x579a)[0x7fed529d56ba]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(+0x16fdfa)[0x7fed52954dfa]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(+0x174018)[0x7fed52959018]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyEval_EvalFrameDefault+0x8a1)[0x7fed529d07c1]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyFunction_Vectorcall+0x1bd)[0x7fed529b93ed]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyEval_EvalFrameDefault+0x40b)[0x7fed529d032b]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyFunction_Vectorcall+0x1bd)[0x7fed529b93ed]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyEval_EvalFrameDefault+0x8a1)[0x7fed529d07c1]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyEval_EvalCodeWithName+0x3d4)[0x7fed529b8284]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(+0x1d4bc2)[0x7fed529b9bc2]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyEval_EvalFrameDefault+0x13a9)[0x7fed529d12c9]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyFunction_Vectorcall+0x1bd)[0x7fed529b93ed]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyEval_EvalFrameDefault+0x8a1)[0x7fed529d07c1]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyFunction_Vectorcall+0x1bd)[0x7fed529b93ed]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyEval_EvalFrameDefault+0x8a1)[0x7fed529d07c1]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyFunction_Vectorcall+0x1bd)[0x7fed529b93ed]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyEval_EvalFrameDefault+0x8a1)[0x7fed529d07c1]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyEval_EvalCodeWithName+0x3d4)[0x7fed529b8284]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyFunction_Vectorcall+0x39b)[0x7fed529b95cb]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(+0x1d4f92)[0x7fed529b9f92]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(PyObject_Call+0x1ca)[0x7fed5291b2ea]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyEval_EvalFrameDefault+0x241b)[0x7fed529d233b]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyEval_EvalCodeWithName+0x3d4)[0x7fed529b8284]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyFunction_Vectorcall+0x39b)[0x7fed529b95cb]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyEval_EvalFrameDefault+0x40b)[0x7fed529d032b]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(_PyEval_EvalCodeWithName+0x3d4)[0x7fed529b8284]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(PyEval_EvalCode+0x23)[0x7fed52a45f03]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(+0x260f58)[0x7fed52a45f58]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(+0x269153)[0x7fed52a4e153]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(+0x1051d0)[0x7fed528ea1d0]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(PyRun_SimpleFileExFlags+0x36c)[0x7fed528f779f]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(+0x1132ea)[0x7fed528f82ea]
/opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0(Py_BytesMain+0x39)[0x7fed52a55e49]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7fed518dd555]
======= Memory map: ========
00400000-00401000 r--p 00000000 00:3d 3496947552                         /prog/res/komodo/2023.12.05-py38-rhel7/root/bin/python
00401000-00402000 r-xp 00001000 00:3d 3496947552                         /prog/res/komodo/2023.12.05-py38-rhel7/root/bin/python
00402000-00403000 r--p 00002000 00:3d 3496947552                         /prog/res/komodo/2023.12.05-py38-rhel7/root/bin/python
00403000-00404000 r--p 00002000 00:3d 3496947552                         /prog/res/komodo/2023.12.05-py38-rhel7/root/bin/python
00404000-00405000 rw-p 00003000 00:3d 3496947552                         /prog/res/komodo/2023.12.05-py38-rhel7/root/bin/python
01956000-04049000 rw-p 00000000 00:00 0                                  [heap]
7fed04000000-7fed04021000 rw-p 00000000 00:00 0
7fed04021000-7fed08000000 ---p 00000000 00:00 0
7fed08000000-7fed08021000 rw-p 00000000 00:00 0
7fed08021000-7fed0c000000 ---p 00000000 00:00 0
7fed0c000000-7fed0c021000 rw-p 00000000 00:00 0
7fed0c021000-7fed10000000 ---p 00000000 00:00 0
7fed114a3000-7fed114a4000 ---p 00000000 00:00 0
7fed114a4000-7fed11ce4000 rw-p 00000000 00:00 0
7fed11d24000-7fed11d64000 rw-p 00000000 00:00 0
7fed11e64000-7fed12224000 rw-p 00000000 00:00 0
7fed12224000-7fed12225000 ---p 00000000 00:00 0
7fed12225000-7fed12e65000 rw-p 00000000 00:00 0
7fed12e65000-7fed12e72000 r--p 00000000 00:3d 3478898727                 /prog/res/komodo/2023.12.05-py38-rhel7/root/lib64/python3.8/site-packages/charset_normalizer/md__mypyc.cpython-38-x86_64-linux-gnu.so
7fed12e72000-7fed12e8d000 r-xp 0000d000 00:3d 3478898727                 /prog/res/komodo/2023.12.05-py38-rhel7/root/lib64/python3.8/site-packages/charset_normalizer/md__mypyc.cpython-38-x86_64-linux-gnu.so
7fed12e8d000-7fed12e96000 r--p 00028000 00:3d 3478898727                 /prog/res/komodo/2023.12.05-py38-rhel7/root/lib64/python3.8/site-packages/charset_normalizer/md__mypyc.cpython-38-x86_64-linux-gnu.so
[....SNIPPED...]
7fed52db8000-7fed52db9000 r--p 0000f000 fd:00 1587957                    /opt/rh/rh-python38/root/usr/lib64/python3.8/lib-dynload/_json.cpython-38-x86_64-linux-gnu.so
7fed52db9000-7fed52dba000 rw-p 00010000 fd:00 1587957                    /opt/rh/rh-python38/root/usr/lib64/python3.8/lib-dynload/_json.cpython-38-x86_64-linux-gnu.so
7fed52dba000-7fed52dbb000 r--p 00000000 fd:00 1575220                    /opt/rh/rh-python38/root/usr/lib64/python3.8/lib-dynload/_opcode.cpython-38-x86_64-linux-gnu.so
7fed52dbb000-7fed52dbc000 r-xp 00001000 fd:00 1575220                    /opt/rh/rh-python38/root/usr/lib64/python3.8/lib-dynload/_opcode.cpython-38-x86_64-linux-gnu.so
7fed52dbc000-7fed52dbd000 r--p 00002000 fd:00 1575220                    /opt/rh/rh-python38/root/usr/lib64/python3.8/lib-dynload/_opcode.cpython-38-x86_64-linux-gnu.so
7fed52dbd000-7fed52dbe000 r--p 00002000 fd:00 1575220                    /opt/rh/rh-python38/root/usr/lib64/python3.8/lib-dynload/_opcode.cpython-38-x86_64-linux-gnu.so
7fed52dbe000-7fed52dbf000 rw-p 00003000 fd:00 1575220                    /opt/rh/rh-python38/root/usr/lib64/python3.8/lib-dynload/_opcode.cpython-38-x86_64-linux-gnu.so
7fed52dbf000-7fed52dc0000 rw-p 00000000 00:00 0
7fed52dc0000-7fed52dc1000 r--p 00021000 fd:00 657826                     /usr/lib64/ld-2.17.so
7fed52dc1000-7fed52dc2000 rw-p 00022000 fd:00 657826                     /usr/lib64/ld-2.17.so
7fed52dc2000-7fed52dc3000 rw-p 00000000 00:00 0
7ffd0e7f8000-7ffd0e81a000 rw-p 00000000 00:00 0                          [stack]
7ffd0e926000-7ffd0e928000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
Aborted (core dumped)
@berland
Copy link
Contributor Author

berland commented Jan 12, 2024

ResInsight will not fail on the same smry file.

@berland
Copy link
Contributor Author

berland commented Jan 12, 2024

The related bug in ERT was triggered with MPI runs, while this crash is independent whether the UNSMRY file was produced using Eclipse in MPI mode or not.

@eivindjahren
Copy link
Collaborator

Actual issue happens here:

==17222== Invalid read of size 4
==17222==    at 0xE505DB0: rd::smspec_node::get_params_index() const (in /prog/res/komodo/bleeding-py38-rhel7/root/lib64/python3.8/site-packages/resdata/.libs/libresdata.so)
==17222==    by 0xE5150A4: rd_smspec_fread_alloc (in /prog/res/komodo/bleeding-py38-rhel7/root/lib64/python3.8/site-packages/resdata/.libs/libresdata.so)
==17222==    by 0xE5296FF: rd_sum_fread_alloc_case2__ (in /prog/res/komodo/bleeding-py38-rhel7/root/lib64/python3.8/site-packages/resdata/.libs/libresdata.so)
==17222==    by 0xE5297B1: rd_sum_fread_alloc_case2__ (in /prog/res/komodo/bleeding-py38-rhel7/root/lib64/python3.8/site-packages/resdata/.libs/libresdata.so)
==17222==    by 0xDD26DEB: ffi_call_unix64 (in /usr/lib64/libffi.so.6.0.1)
==17222==    by 0xDD26714: ffi_call (in /usr/lib64/libffi.so.6.0.1)
==17222==    by 0x40470DD: _ctypes_callproc (in /opt/rh/rh-python38/root/usr/lib64/python3.8/lib-dynload/_ctypes.cpython-38-x86_64-linux-gnu.so)
==17222==    by 0x404746A: ??? (in /opt/rh/rh-python38/root/usr/lib64/python3.8/lib-dynload/_ctypes.cpython-38-x86_64-linux-gnu.so)
==17222==    by 0x4F6D45D: PyObject_Call (in /opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0)
==17222==    by 0x502433A: _PyEval_EvalFrameDefault (in /opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0)
==17222==    by 0x500A283: _PyEval_EvalCodeWithName (in /opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0)
==17222==    by 0x500B5CA: _PyFunction_Vectorcall (in /opt/rh/rh-python38/root/usr/lib64/libpython3.8.so.rh-python38-1.0)

It seems to be related to hitting this block:

if (day_node != NULL) {
rd_smspec->day_index = smspec_node_get_params_index(day_node);
rd_smspec->month_index = smspec_node_get_params_index(
&rd_smspec->misc_var_index["MONTH"]);
rd_smspec->year_index = smspec_node_get_params_index(
&rd_smspec->misc_var_index["YEAR"]);
}

which resinsight has improved in OPM/ResInsight@285433c

The issue is that DAYS, MONTHS and YEARS all exist in the file, but seems to not end up in misc_var_index

@berland berland linked a pull request Jan 25, 2024 that will close this issue
@github-project-automation github-project-automation bot moved this from In Progress to Done in SCOUT Jan 25, 2024
@eivindjahren eivindjahren moved this from Done to Done-Done in SCOUT Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants