McCode
McCode copied to clipboard
Segfaults may occur when using Progress_bar(flag_save=1) in instruments with MCPL_output
When MCPL_output was written we likely forgot that saves may occur multiple times during execution, triggered by Progress_bar
Problem reported by Harry Nelson for 2.7.1 on Ubuntu 20.04 but also occurs with later McStas versions on other platforms. (Very likely also for McXtrace)
The workaround for now is to NOT use flag_save=1.
mcrun -c Polychromatic_beam_PRH.orig.instr -n 20000000
Instrument parameters for SNS_fp13_UCN (Polychromatic_beam_PRH.orig.instr)
[SNS_fp13_UCN] Initialize
Loading moderator file sct41a_bd_14_1.dat
sct41a_bd_14_1.dat
total vals: 12691
ntvals: 90 idx: 0
Start calculating probability distribution
Finished calculating probability distribution
MCPL_output verbose mode: after generating the mcpl-file it will be reread and a summary printed.
Trace ETA 1.36667 [min] % 13
Save [SNS_fp13_UCN]
Detector: sourcedet_I=1.28681e+10 sourcedet_ERR=7.86636e+06 sourcedet_N=2.67599e+06 "source_out.txt"
Detector: detL2_I=6.29902e+08 detL2_ERR=1.5225e+06 detL2_N=289109 "lout_2.txt"
Detector: detL3_I=4.44605e+08 detL3_ERR=1.21891e+06 detL3_N=254154 "lout_3.txt"
Detector: detL4_I=3.78315e+08 detL4_ERR=1.08979e+06 detL4_N=243591 "lout_4.txt"
MCPL: Attempting to compress file SNS_.mcpl with gzip
MCPL: Succesfully compressed file into SNS_.mcpl.gz
Detector: detL5_I=3.13339e+08 detL5_ERR=958060 detL5_N=240682 "lout_5.txt"
Detector: detL6_I=3.1329e+08 detL6_ERR=958003 detL6_N=240616 "eout_5.txt"
<E> : 3.08016 meV , E-width : 2.96717 meV
# McStas 2.7.1 - Oct. 04, 2021: [pid 7800] Signal 11 detected SIGSEGV (Mem Error)
# Simulation: SNS_fp13_UCN (Polychromatic_beam_PRH.orig.instr)
# Breakpoint: mcpl_output (Trace) 13.38 % ( 2676000.0/20000000.0)
# Date: Wed Jun 5 07:15:20 2024
# Started: Wed Jun 5 07:15:09 2024
# Last I/O Error: No such file or directory
# McStas 2.7.1 - Oct. 04, 2021: Simulation stop (abort).