DUNE-DAQ / trigemu

Trigger decision emulator for January 2020 readout application tests
0 stars 0 forks source link

Fix the case where no TimeSyncs are received at all between "start" and "stop" #21

Closed philiprodrigues closed 3 years ago

philiprodrigues commented 3 years ago

There were two separate problems:

  1. The m_timestamp_estimator pointer was reset (calling TimestampEstimator's dtor) before joining the threads at stop, so threads could dereference a nullptr
  2. The case where the wait for a valid timestamp at the start of send_trigger_decisions was interrupted by stop was not handled correctly. We should just return there, not carry on as if a valid timestamp was available

To reproduce the problem, create a two-process minidaqapp config, run just the trigemu process, and send it "init", "conf", "start", "stop". Eg:

python rudf_trg.py
daq_application --name trigemu -c stdin://minidaqapp-trgemu.json

Without this PR, I get a segfault