From a61827dcc1d2bd2ca6e14efe0b592e460be65501 Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Sat, 7 Nov 2026 13:49:40 +0100 Subject: [PATCH] EMCAL: initialise the MC kinematics reader pointer in the digitizer DigitizerSpec::mcReader had no initialiser, and run() only creates the reader when the pointer is null. When the memory the (large) spec is allocated in is not zeroed, the reader is never created and getMCEventHeader() dereferences garbage, crashing the digitizer at the first collision accepted by the CTP minimum-bias trigger. Seen on macOS in about one run in three; Linux likely hides it because large allocations come from fresh zeroed pages. Also initialise mCTPConfig, which follows the same pattern. --- .../workflow/include/EMCALWorkflow/EMCALDigitizerSpec.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Detectors/EMCAL/workflow/include/EMCALWorkflow/EMCALDigitizerSpec.h b/Detectors/EMCAL/workflow/include/EMCALWorkflow/EMCALDigitizerSpec.h index ca30bee08ea73..880d047c6af48 100644 --- a/Detectors/EMCAL/workflow/include/EMCALWorkflow/EMCALDigitizerSpec.h +++ b/Detectors/EMCAL/workflow/include/EMCALWorkflow/EMCALDigitizerSpec.h @@ -89,9 +89,9 @@ class DigitizerSpec final : public o2::base::BaseDPLDigitizer, public o2::framew std::shared_ptr mCalibHandler; ///< Handler of calibration objects std::vector mHits; ///< Vector with input hits std::vector mSimChains; - o2::ctp::CTPConfiguration* mCTPConfig; ///< CTP configuration - o2::detectors::DetID::mask_t mDetMask; ///< to keep track whether FT0 and FV0 are included - o2::steer::MCKinematicsReader* mcReader; ///< reader to access MC collision information + o2::ctp::CTPConfiguration* mCTPConfig = nullptr; ///< CTP configuration + o2::detectors::DetID::mask_t mDetMask; ///< to keep track whether FT0 and FV0 are included + o2::steer::MCKinematicsReader* mcReader = nullptr; ///< reader to access MC collision information DigitizerTRU mDigitizerTRU; ///< Digitizer object TRU o2::emcal::SDigitizer mSumDigitizerTRU; ///< Summed digitizer TRU