fix: remove reference in time frame builder#4177
fix: remove reference in time frame builder#4177osbornjd merged 1 commit intosPHENIX-Collaboration:masterfrom
Conversation
📝 WalkthroughWalkthroughModified the Changes
✨ Finishing touches
No actionable comments were generated in the recent review. 🎉 Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Build & test reportReport for commit 0a41d07cf2e4fcfaa240632a2a7b4be646bbcfdc:
Automatically generated by sPHENIX Jenkins continuous integration |
|
The clang tidy warnings are benign |
7255ce1
into
sPHENIX-Collaboration:master



The TPC event combining jobs occasionally seg fault. Valgrind claimed a problem at QA histogram filling, which points back to this reference being used. Removing the reference causes valgrind to no longer indicate an invalid read, and testing on one of the files that identified this the segfault no longer occurs. This will cost some CPU performance decrease for better stability
Types of changes
What kind of change does this PR introduce? (Bug fix, feature, ...)
TODOs (if applicable)
Links to other PRs in macros and calibration repositories (if applicable)
TPC Time Frame Builder: Dangling Reference Removal
Motivation and Context
This PR fixes occasional segmentation faults encountered during TPC event combining jobs. Valgrind identified an invalid memory read originating from QA histogram filling in the time frame builder. Root cause analysis traced this to a dangling reference:
pkt_lengthwas aliasingdata_buffer[0], but the underlying deque was subsequently modified viapop_front()anderase()operations, invalidating the reference before it was used in QA histogram filling.Key Changes
const uint16_t& pkt_length = data_buffer[0];const uint16_t pkt_length = data_buffer[0];pop_front()at lines 697/709/724,erase()at line 749) can no longer invalidate thepkt_lengthvariablepkt_lengthremains semantically identical; no logic changesValidation and Risk Assessment
Notes