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

Importing OpenMC causes a seg fault #12

Open
abachma2 opened this issue Apr 25, 2023 · 3 comments
Open

Importing OpenMC causes a seg fault #12

abachma2 opened this issue Apr 25, 2023 · 3 comments
Assignees
Labels
Comp:Core This issue has to do with the main bulk of the code or document. (methods, main content) Difficulty:3-Expert This issue is not only complicated, but also complex. It may require special advanced skills. Priority:2-Normal This work is important and should be completed ASAP. Status:1-New No one has claimed this issue yet. It is in need of solving. Type:Bug Something is wrong or broken. This issue or PR is related to a bug in code.

Comments

@abachma2
Copy link
Collaborator

abachma2 commented Apr 25, 2023

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 ()
@abachma2 abachma2 self-assigned this Apr 25, 2023
@abachma2 abachma2 added Comp:Core This issue has to do with the main bulk of the code or document. (methods, main content) Difficulty:3-Expert This issue is not only complicated, but also complex. It may require special advanced skills. Priority:2-Normal This work is important and should be completed ASAP. Status:1-New No one has claimed this issue yet. It is in need of solving. Type:Bug Something is wrong or broken. This issue or PR is related to a bug in code. labels Apr 25, 2023
This was referenced Jun 19, 2023
@samgdotson
Copy link
Contributor

Have you seen this post? Maybe it will help, or at least offer a way for a better traceback.

@abachma2
Copy link
Collaborator Author

Thanks for the suggestion. I set the ulimit at the maximum for my desktop and that did not fix the problem.

@nsryan2
Copy link
Member

nsryan2 commented Jul 18, 2024

In #22 there were changes to the depletion step that would warrant updates to these tests. Per the discussion there, these updates should probably come with the PR that addresses this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Comp:Core This issue has to do with the main bulk of the code or document. (methods, main content) Difficulty:3-Expert This issue is not only complicated, but also complex. It may require special advanced skills. Priority:2-Normal This work is important and should be completed ASAP. Status:1-New No one has claimed this issue yet. It is in need of solving. Type:Bug Something is wrong or broken. This issue or PR is related to a bug in code.
Projects
None yet
Development

No branches or pull requests

3 participants