-
Notifications
You must be signed in to change notification settings - Fork 225
Fix combiner crash #4322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix combiner crash #4322
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -729,6 +729,15 @@ void SingleTriggeredInput::FillPool() | |||||||||||||||||||||||||||||||||||||||||||
| if (!FilesDone()) | ||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||
| int eventvectorsize = FillEventVector(); | ||||||||||||||||||||||||||||||||||||||||||||
| // this seems a unique signature for raw data files which only contain the | ||||||||||||||||||||||||||||||||||||||||||||
| // begin and end run event but no data events. FillEventVector() returns -1 | ||||||||||||||||||||||||||||||||||||||||||||
| // and since no events were read the m_PacketEventDeque is empty | ||||||||||||||||||||||||||||||||||||||||||||
| if (eventvectorsize < 0 && m_PacketEventDeque.empty()) | ||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||
| std::cout << Name() << ": No data Events in input file " << FileName() << std::endl; | ||||||||||||||||||||||||||||||||||||||||||||
| AllDone(1); | ||||||||||||||||||||||||||||||||||||||||||||
| return; | ||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
731
to
+739
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win The no-data-file guard never fires once packet keys have been seeded.
Suggested fix int eventvectorsize = FillEventVector();
- if (eventvectorsize < 0 && m_PacketEventDeque.empty())
+ const bool no_packet_events = std::all_of(
+ m_PacketEventDeque.begin(), m_PacketEventDeque.end(),
+ [](const auto& entry) { return entry.second.empty(); });
+ if (eventvectorsize < 0 && no_packet_events)
{
std::cout << Name() << ": No data Events in input file " << FileName() << std::endl;
AllDone(1);
return;
}📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| if (eventvectorsize != 0) | ||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||
| if (Gl1Input()->m_bclkdiffarray_map.empty()) | ||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -1226,7 +1235,6 @@ int SingleTriggeredInput::ReadEvent() | |||||||||||||||||||||||||||||||||||||||||||
| size_t size = m_PacketEventDeque.begin()->second.size(); | ||||||||||||||||||||||||||||||||||||||||||||
| std::cout << "deque size: " << size << std::endl; | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| auto* ref_evt = m_PacketEventDeque.begin()->second.front(); | ||||||||||||||||||||||||||||||||||||||||||||
| RunNumber(ref_evt->getRunNumber()); | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Use an int-specific RUNNUMBER check here.
PHFlag::FlagExist()is type-agnostic, so this branch is still unsafe: it returns true ifRUNNUMBERexists as a string/float/etc., andget_IntFlag("RUNNUMBER")then emits the same error/stack trace and falls back to0. That means the new guard does not fully satisfy thePHFlagcontract and can still callEndRun(0)in a mistyped-flag scenario. Please gate this on integer-flag existence specifically, or otherwise avoidget_IntFlag()unless the flag is known to be an int.