Skip to content

Importing OpenMC causes a seg fault #12

@abachma2

Description

@abachma2

Including import openmc in the archetype file causes a seg fault (sometimes SIGSEGV, sometimes SEGABRT) after the simulation runs and writes the results to the output database.

Line that causes the seg fault:
import openmc in `openmcyclus/DepleteReactor.py

The seg fault does not occur if this line is not present/commented out. But this line is needed to call the depletion solver in OpenMC.

A common message in the terminal with the segmentation fault is: double-linked list, and the traceback to different parts of python. After doing some mild debugging with gdb, I have concluded that python is trying to access memory that it is not supposed to.

A traceback using gdb:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff3cf6fd0 in _int_free () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install glibc-2.17-326.el7_9.x86_64
(gdb) where
#0  0x00007ffff3cf6fd0 in _int_free () from /lib64/libc.so.6
#1  0x00007fffa0a1f0ad in pybind11::cpp_function::initialize_generic(std::unique_ptr<pybind11::detail::function_record, pybind11::cpp_function::InitializingFunctionRecordDeleter>&&, char const*, std::type_info const* const*, unsigned long)::{lambda(void*)#1}::_FUN(void*)
    ()
   from /home/abachmann/anaconda3/envs/cyctest-4/lib/python3.10/site-packages/scipy/fft/_pocketfft/pypocketfft.cpython-310-x86_64-linux-gnu.so
#2  0x00007fffa0a2a4bb in _ZZN8pybind117capsuleC4EPKvPFvPvEENUlP7_objectE_4_FUNES7_ ()
   from /home/abachmann/anaconda3/envs/cyctest-4/lib/python3.10/site-packages/scipy/fft/_pocketfft/pypocketfft.cpython-310-x86_64-linux-gnu.so
#3  0x00007fffed6d6169 in capsule_dealloc ()
   from /home/abachmann/anaconda3/envs/cyctest-4/lib/libpython3.10.so.1.0
#4  0x00007fffed60c857 in meth_dealloc ()
   from /home/abachmann/anaconda3/envs/cyctest-4/lib/libpython3.10.so.1.0
#5  0x00007fffed5ff55a in tupledealloc ()
   from /home/abachmann/anaconda3/envs/cyctest-4/lib/libpython3.10.so.1.0
#6  0x00007fffed6e582d in partial_clear ()
   from /home/abachmann/anaconda3/envs/cyctest-4/lib/libpython3.10.so.1.0
#7  0x00007fffed5f6855 in gc_collect_main ()
   from /home/abachmann/anaconda3/envs/cyctest-4/lib/libpython3.10.so.1.0
#8  0x00007fffed6e0a0c in _PyGC_CollectNoFail.isra.0 ()
   from /home/abachmann/anaconda3/envs/cyctest-4/lib/libpython3.10.so.1.0
#9  0x00007fffed6df4e4 in Py_FinalizeEx.localalias ()
   from /home/abachmann/anaconda3/envs/cyctest-4/lib/libpython3.10.so.1.0
#10 0x00007ffff3cafce9 in __run_exit_handlers () from /lib64/libc.so.6
#11 0x00007ffff3cafd37 in exit () from /lib64/libc.so.6
#12 0x00007ffff3c9855c in __libc_start_main () from /lib64/libc.so.6
#13 0x00005555555636e9 in _start ()

Metadata

Metadata

Assignees

Labels

Comp:CoreThis issue has to do with the main bulk of the code or document. (methods, main content)Difficulty:3-ExpertThis issue is not only complicated, but also complex. It may require special advanced skills.Priority:2-NormalThis work is important and should be completed ASAP.Status:1-NewNo one has claimed this issue yet. It is in need of solving.Type:BugSomething is wrong or broken. This issue or PR is related to a bug in code.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions