Valgrind reports and "invalid read of size 4" at this location (see below). Debugging reveals that the array index nscal is zero, causing the code to read scal_prev_read[-1]. In fact, in the test replay I am doing, run 4914 with the UTIL_KAONLT/scripts_Replay/replay_production_coin.C script, nscal is always zero at this point in the code.
https://github.com/JeffersonLab/hcana/blob/b20e8b9b73ac698c053aa60e8702a1311f81fd83/src/THcScalerEvtHandler.cxx#L538
Valgrind reports and "invalid read of size 4" at this location (see below). Debugging reveals that the array index
nscal
is zero, causing the code to readscal_prev_read[-1]
. In fact, in the test replay I am doing, run 4914 with theUTIL_KAONLT/scripts_Replay/replay_production_coin.C
script,nscal
is always zero at this point in the code.Looks like a logic error.
As a temporary fix, I have changed that line to
but I doubt that that does what is intended here.
Partial output of