Svc/PassiveRateGroup: cycleTime used uninitialized when RawTime::getDiffUsec fails
| F´ Version | devel @ nasa/fprime b7dd5c4f8d26 |
| Affected Component | Svc/PassiveRateGroup |
| Severity | 3/5 |
Problem Description
PassiveRateGroup.cpp:81 and :101 declare U32 cycleTime; and assign it only via (void)portEnd.getDiffUsec(portStart, cycleTime). Os::RawTimeInterface::getDiffUsec (Os/DelegateRawTime.cpp) returns without writing result on INVALID_PARAMS/NOT_SUPPORTED/OTHER_ERROR, all legal for a project RawTime implementation. The indeterminate value feeds the max-cycle CAS loop and the PortCycleTime/CycleTime/MaxCycleTime telemetry.
Context / Environment
Found by static AI full-codebase review of nasa/fprime devel at commit b7dd5c4f8d268c5c70f0304a063d8ee27e026168 (current devel tip at posting time). Static finding; fprime-util version-check not applicable.
Finding id(s): 0d7418619c8eHow to Reproduce
- Use a RawTime implementation whose
getTimeIntervalreturnsNOT_SUPPORTED. - Observe garbage
MaxCycleTimetelemetry.
Expected Behavior
Initialize cycleTime = 0 and skip the update (or emit a one-shot event) when the status is not OP_OK.
IAMAI
Source: nasa/fprime