Hi openmc expert,
I got this error while I attempt to run fixed source mode for the first time and sometimes I also got a segmentation fault error.
so I want to turn on debugging by following this instruction in 2.3.3.1 CMakelist option from openmc document and I try to run my problem again, but no error description appears. Could you tell me how to turn on debugging in detail? I’m so confused about it.
In this case, what you’ll want to do is:
- Go to a terminal and run
gdb openmc
in the directory where your XML files live
- Enter
run
to start the executable
- When it reaches a segfault, enter
backtrace
to get a full backtrace showing where the segfault happened.
As an example, here’s what I got when I tried a simulation with the source file you shared:
===============> FIXED SOURCE TRANSPORT SIMULATION <===============
Simulating batch 1
Thread 1 "openmc" received signal SIGSEGV, Segmentation fault.
openmc::SourceDistribution::sample (this=0x5555555a9950, seed=0x7fffffffb238) at /home/romano/openmc/src/source.cpp:187
187 site.r = space_->sample(seed);
(gdb) backtrace
#0 openmc::SourceDistribution::sample (this=0x5555555a9950, seed=0x7fffffffb238) at /home/romano/openmc/src/source.cpp:187
#1 0x00001555551b13b8 in openmc::sample_external_source (seed=0x7fffffffb238) at /home/romano/openmc/src/source.cpp:344
#2 0x00001555551adcbd in openmc::initialize_history (p=..., index_source=1) at /home/romano/openmc/src/simulation.cpp:460
#3 0x00001555551af11a in openmc::_ZN6openmc23transport_history_basedEv._omp_fn.0(void) () at /home/romano/openmc/src/simulation.cpp:694
#4 0x0000155553cef8e6 in GOMP_parallel () from /lib/x86_64-linux-gnu/libgomp.so.1
#5 0x00001555551aed81 in openmc::transport_history_based () at /home/romano/openmc/src/simulation.cpp:690
#6 0x00001555551ad3b2 in openmc_next_batch (status=0x7fffffffb990) at /home/romano/openmc/src/simulation.cpp:222
#7 0x00001555551acd86 in openmc_run () at /home/romano/openmc/src/simulation.cpp:59
#8 0x0000555555556348 in main (argc=1, argv=0x7fffffffbac8) at /home/romano/openmc/src/main.cpp:34