Opened 8 years ago
Last modified 8 years ago
#38 new task
errors should never pass silently?
Reported by: | dneise | Owned by: | somebody |
---|---|---|---|
Priority: | minor | Milestone: | milestone:milestone1 |
Component: | component1 | Version: | |
Keywords: | Cc: |
Description
I think here lurks a problem:
https://trac.fact-project.org/browser/trunk/Mars/mcore/DrsCalib.h#L58
"spos" is the so called "stop cell" or "start cell" of a drs4 channel, so the allowed range is [0..1023]. In case this number is out of range the entire following calculation fails.
I am not saying this is a bug or so, I just say, when this number happens to be out of range "continue" is maybe not the correct reaction.
What is the right reaction I cannot say. I don't understand the Mars and FACT++ framework well enough. I would throw an exception, since this is a fatal error.
I have found another place, where stopcells are checked for being <0.
https://trac.fact-project.org/browser/trunk/Mars/mcore/DrsCalib.h#L522
Both "prev" and "start" in that line 522 are arrays full of stopcells, which have a range of [0..1024-1]. So they simply can never be smaller 0, can they?
Anyway I think, in case somehow a number outside of this range found its way into an array that is supposed to contain stopcell, this is a severe bug and should not simply be ignored, should it?