Crash occurs in Com.dll if filetime is before the EPICS epoch
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
EPICS Base |
Fix Released
|
Medium
|
Unassigned | ||
3.14 |
Fix Released
|
Medium
|
Jeff Hill |
Bug Description
EPICS Base 3.14.9
File: \src\libCom\
Function: extern "C" void epicsThreadCall
Problem:
If system returns a filetime before the EPICS epoch, exception std::logic_error is thrown from the 'catch' (at line 67 'catch ( std::exception & except )' and at line 83 ' catch ( ... )'). The std::logic_error is actually thrown by the 'epicsTime cur = epicsTime:
The root cause:
File: \src\libCom\
Function: epicsTimerNotif
Line 516:
‘LONGLONG epicsTimeFromCu
( curFileTime.
curFileTime could be smaller than the EPICS epoch if user changes the system time, so this will produce a wield 'epicsTimeFromC
We need to handle:
If the filetime returned by system is earlier than the EPICS epoch, how do we generate the 'delta' (at line 520) and adjust the perfCounterFreq accordingly.
no longer affects: | epics-base/3.15 |
Changed in epics-base: | |
status: | Fix Committed → Fix Released |
maybe this is fixed in recent EPICS. I see code like this which seems to handle that exception?
void epicsThread :: printLastChance ExceptionMessag e (
cur.strftime ( date, sizeof ( date ), "%a %b %d %Y %H:%M:%S.%f"); GetName ( this->id, name, sizeof ( name ) );
"epicsThread: Unexpected C++ exception \"%s\" "
pExceptionCont ext, pExceptionTypeName, name, date );
const char * pExceptionTypeName,
const char * pExceptionContext )
{
char date[64];
try {
epicsTime cur = epicsTime :: getCurrent ();
}
catch ( ... ) {
strcpy ( date, "<UKN DATE>" );
}
char name [128];
epicsThread
errlogPrintf (
"with type \"%s\" in thread \"%s\" at %s\n",
errlogFlush ();
// this should behave as the C++ implementation intends when an
// exception isnt handled. If users dont like this behavior, they
// can install an application specific unexpected handler.
std::unexpected ();
}