issues with epicsTime

Bug #541279 reported by Jeff Hill
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
EPICS Base
Fix Released
Wishlist
Jeff Hill

Bug Description

The issues originally reported by Kay Kasemir:

The epicsTime.cpp in R3.14.8.2 has the
     assert ( this->nSec < nSecPerSec );
in the conversion from epicsTime to epicsTimeStamp.

That's OK, the nanoseconds should be normalized,
but it turns out that a few SNS IOCs produce such
bad time stamps, and now I have to catch that in the
archiver in time before I run into the assert().

The thing is that epicsTime.cpp could be more rigorous. epicsTime.strftime contains this mod 1e9:
     int frac = ... nSec ... % ((int)1e9)
... and the result is that 'camonitor' will show all those
bad PVs with good looking time stamps,
so IOC engineers who check their time stamps don't see
anything wrong until they try to archive those PVs.

Additional information:
I see the following issues:

1) The epicsTime constructor does not throw an exception when an invalid epicsTimeStamp is passed to it.
2) The "epicsTime::operator epicsTimeStamp ()" conversion operator should throw an exception instead of assert failing when it discovers that the internal state of the time stamp is invalid.
3) William Lupton's epicsTime::strftime doesn’t add .OVF if the nano-seconds field is invalid. Kay's original issue.
4) William Lupton's epicsTime::strftime has a buffer overrun vulnerability.
5) Certain C interfaces to epicsTime were not bracketed by try catch blocks.

Original Mantis Bug: mantis-245
    http://www.aps.anl.gov/epics/mantis/view_bug_page.php?f_id=245

Tags: libcom 3.14
Revision history for this message
Jeff Hill (johill-lanl) wrote :

Fixed in R3.14.9

Revision history for this message
Andrew Johnson (anj) wrote :

R3.14.9 Released.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.