Select record does not handle inf correctly
Bug #1349456 reported by
Ralph Lange
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
EPICS Base |
Fix Released
|
Medium
|
Ralph Lange |
Bug Description
The select record has not been updated to correctly work with inf and NaN values.
The code in selRecord.c contains code like:
if (!isinf(val)) {
prec->val = val;
prec->udf = isnan(prec->val);
} else {
/* If UDF is TRUE this alarm will be overwritten by checkAlarms*/
}
which sets the record in MAJOR alarm for inf values, no matter if the record's alarm levels have been set or not.
Related branches
lp://staging/~epics-core/epics-base/fix-nan-inf-updates
- mdavidsaver: Pending requested
- EPICS Core Developers: Pending requested
- Andrew Johnson: Pending requested
-
Diff: 1112 lines (+622/-247)19 files modifiedsrc/Makefile (+2/-0)
src/ioc/db/recGbl.c (+25/-1)
src/ioc/db/recGbl.h (+2/-0)
src/ioc/db/test/Makefile (+6/-0)
src/ioc/db/test/epicsRunDbTests.c (+2/-0)
src/ioc/db/test/recGblCheckDeadbandTest.c (+119/-0)
src/std/filters/dbnd.c (+8/-18)
src/std/rec/aiRecord.c (+7/-23)
src/std/rec/aoRecord.c (+13/-28)
src/std/rec/calcRecord.c (+7/-18)
src/std/rec/calcoutRecord.c (+32/-44)
src/std/rec/dfanoutRecord.c (+15/-30)
src/std/rec/selRecord.c (+50/-68)
src/std/rec/subRecord.c (+6/-17)
src/std/rec/test/Makefile (+39/-0)
src/std/rec/test/analogMonitorTest.c (+238/-0)
src/std/rec/test/analogMonitorTest.db (+13/-0)
src/std/rec/test/epicsRunTests.c (+24/-0)
src/std/rec/test/rtemsTestHarness.c (+14/-0)
description: | updated |
Changed in epics-base: | |
status: | New → Fix Committed |
Changed in epics-base: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Be careful when working on this, the select record does use and check for NaNs, and also uses ±Inf values in the do_sel() routine above the quoted code. I suspect the UDF/Major alarm was meant to fire if the none of the input links are set so all of the input value fields contain NaNs (see init_record). The Record Reference has some information about this (which I just corrected).