Commit Graph
905 Commits
Author SHA1 Message Date
Sang Woo Kim 5a225a9bbb rsrv: reject a non-finite beacon period
The beacon-period gate in online_notify already rejected a parse
failure and a non-positive value, but epicsScanDouble parses "nan" and
"inf", and maxPeriod<=0.0 is false for both, so a non-finite period
reached the beacon delay loop. A NaN maxdelay makes delay<maxdelay
false forever, pinning the beacon interval at the 0.02 s startup value
- a ~50 Hz beacon flood on every configured interface; an infinite
maxdelay lets the doubling delay grow without bound, silencing beacons
entirely.

Gate on finite() (from epicsMath.h), matching the client-side
EPICS_CA_MAX_SEARCH_PERIOD handling in udpiiu.cpp, and name the actual
problem in the diagnostic instead of "float fetch failed" (the message
already covered the non-positive case, which is not a fetch failure).
2026-10-14 11:21:36 +02:00
Sang Woo Kim f373f04396 calcRecord: drop unhandled special(SPC_MOD) from INPM..INPU
INPM..INPU each declared special(SPC_MOD), but calcRecord's special()
only implements SPC_CALC and returns S_db_badChoice for anything else.
Every dbPutField/caput to one of those nine link fields therefore ran
special(after=TRUE), hit the fall-through, and failed with
S_db_badChoice ("bad special value") -- nine documented input links
were unwritable at run time.

The twelve sibling links INPA..INPL carry no special and accept writes,
and calcRecord (unlike calcoutRecord) does no run-time link
re-initialization, so there is no handler for SPC_MOD to reach. Remove
the erroneous attribute from the nine fields so they match INPA..INPL;
special() then runs only for CALC, which is the only field that still
carries a special.
2026-10-14 11:20:53 +02:00
Jacqueline GarrahanandClaude Opus 4.8 617a7902f2 printfRecord: fix one-byte VAL overflow in %ls conversion
In the long-string (%ls) branch dbGetLink(DBR_CHAR) / dbLoadLinkLS can
leave n at vspace+1, so pval[n] = 0 writes at pval[vspace+1], one byte
past the sizv-byte VAL buffer (pval + vspace + 1 == prec->val + sizv).
Clamp n to vspace immediately before writing the terminator.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-10-14 11:19:59 +02:00
Jacqueline GarrahanandClaude Opus 4.8 f63c5e9d3b dbConvert: fix UInt64->String conversion truncating to 32 bits
putUInt64String used cvtUlongToString, which is cvtUInt32ToString, so the
64-bit source was narrowed to its low 32 bits (e.g. 0x1_0000_0007 printed
as "7").  Use cvtUInt64ToString, matching getUInt64String and every other
width-specific putXxxString.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-10-14 11:19:19 +02:00
Sang Woo Kim ee673d87ec seqRecord: fix upper display limit of the DLYn fields
get_graphic_double() assigns lower_disp_limit twice and never writes
upper_disp_limit, so a DBR_GR_DOUBLE read of any DLYn field reports
the inverted range lower=10, upper=0.  The second assignment was
evidently meant for the upper limit; the 0 in the upper slot is the
zeroed buffer dbAccess.c hands to the RSET, not a chosen value.

Both assignments date from commit 27e80be2e5 which introduced the
DLYn limits, so every release since 3.14.11 reports the inverted
range over both CA (DBR_GR/CTRL) and PVA (display.limitLow/High).

Extend seqTest with a DBR_GR_DOUBLE read of DLY0; the new cases
fail with lower=10, upper=0 before this fix.
2026-10-14 11:18:58 +02:00
Jacqueline GarrahanandClaude Opus 4.8 91aba2cb0a dbJLink: fix assignment-instead-of-compare in dbJLinkMapAll
The guard used recname[0] = '\0' (assignment) instead of == , which wrote
a NUL into the caller's string, truncating it to "", and evaluated to 0
so recname was left non-NULL pointing at "".  Every record then failed
the name comparison and nothing was mapped.  Use ==, matching dbjlr.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-10-14 11:18:33 +02:00
Sang Woo Kim 2ec624aad6 selRecord: fix the precision reported for the A-L and LA-LL fields
get_precision() walks pvalue and plvalue over the A-L and LA-LL fields,
then compares paddr->pfield against &pvalue and &plvalue -- the
addresses of the two local pointer variables, not of the fields they
point at.  Those are stack addresses, so neither test has ever matched
and every A-L or LA-LL precision request falls through to
recGblGetPrec().  The line just above gets it right: prec->val is a
field and needs the &, whereas pvalue and plvalue are already pointers.

Both tests date from e87551df24, the commit that added the loop, and
have been dead ever since, so every release since R3.12 has this.  They
carried a (void *) cast until 6d85a36397 removed it, which is why the
compiler was never shown a double ** to complain about.  That the
fields were meant to be covered is not in doubt: this record's
get_graphic_double() and get_control_double() both name A-L and LA-LL.

This changes what those fields report.  recGblGetPrec() substitutes 15
for a DOUBLE precision outside 0 to 15, so today A-L and LA-LL answer
15 for a PREC of 17 while VAL answers 17.  They now answer PREC
unclamped, which is what VAL has always done.

Add selTest, reading the precision of VAL, A, L, LA, LL and HIHI from a
record with PREC=17.  The four A-L and LA-LL cases report 15 before
this fix; VAL and HIHI pin the two paths either side of them.
2026-10-14 11:18:16 +02:00
Michael Davidsaver fe59acb15f rsrv: USE_TYPED_DBEVENT 2026-10-14 11:17:44 +02:00
Andrew Johnson 906abc98d7 Release notes, add a drvet to the example template 2026-10-14 11:17:11 +02:00
Andrew Johnson f73f888df8 Move -DUSE_TYPED_DRVET to USR_CPPFLAGS
Also fixes an issue in the generated registerRecordDeviceDriver code.
2026-10-14 11:17:01 +02:00
Michael Davidsaver 2f460bdf26 rsrv: log_header paddr=
Currently prints dbChannel**
2026-10-14 11:16:22 +02:00
Michael Davidsaver c7e9310439 minor 2026-10-14 11:16:10 +02:00
Michael Davidsaver bb5b1b5c7b fix last LOCAL 2026-10-14 11:16:03 +02:00
Jeremy Lorelli 5b962a702b database: Replace epicsEventMustSignal -> epicsEventMustTrigger in comments 2026-10-14 11:15:56 +02:00
Michael Davidsaver 84c56e99b5 doc devSup.h 2026-10-14 11:15:36 +02:00
Michael Davidsaver 1dc953a672 Document dbScan.h 2026-10-14 11:15:24 +02:00
Michael Davidsaver 50c0fcc725 dbScan one more NUM_TIME_EVENTS 2026-10-14 11:15:03 +02:00
Michael Davidsaver 884e001f6e minor 2026-10-14 11:14:51 +02:00
mdavidsaver a6c4933742 Embed GDB helper
* Add GDB helper script

Pretty printing of some common argument types

Need to add a line to ~/.gdbinit

> add-auto-load-safe-path /path/to/base/checkout/

afterwards verify at GDB shell with

> info auto-load python-scripts
> info pretty-printer

Tested with GDB 16.3 circa Debian 13

Add $rcast(dbCommon) to up-cast
Add $record("name") to lookup record
Add $elln(ELLLIST,#) to index into list
2026-10-14 11:14:32 +02:00
Abdalla Al-Dalleh f4ea5cc1e9 biRecord.c/boRecord.c: Fix gcc -Wsizeof-pointer-memaccess (#887)
../rec/biRecord.c:191:42: warning: argument to ‘sizeof’ in ‘strncpy’
call is the same expression as the source; did you mean to use the
size of the destination? [-Wsizeof-pointer-memaccess]
  191 |         strncpy(pstring,prec->znam,sizeof(prec->znam));
      |                                          ^

Use memcpy instead of snprintf.

STATIC_ASSERT is added to ensure znam and onam are sized enough.
2026-10-14 11:00:22 +02:00
Torsten Bögershausen 88a2b165ae dbAccess.c: Improve logging of illegal field_type
Debugging a problem and looking at the message

recGblDbaddrError: dbPut: Request type is 0 Illegal Database Request Type...
does not help very much: request type 0 is a legal value.

Improve the message to show the field type as well:
recGblDbaddrError: dbPut: dbrType = 0 field_type = DBF_INLIK (14)...

Do the same for both dbPut and dbGet.
2026-10-14 10:57:09 +02:00
Michael Davidsaver 70070d8276 doc dbBase.h
document dbBase list node types
2026-10-13 10:18:22 +02:00
Andrew Johnson c2726b87d2 Error message fixes/improvements 2026-10-13 10:17:37 +02:00
Michael Davidsaver 12e75c541c doc dbProcess() 2026-10-13 10:16:51 +02:00
zimoch d6df659acf Merge commit '631c8831b942ee5533a2f7016085dcef52c2f3ba' into PSI-7.0
Merge latest 7.0 until before records are modified
2026-10-13 10:15:50 +02:00
Michael Davidsaver cf7ab0f65e dbCa: iocInit wait for all conditions
After connectCallback, need to wait for up to three
concurrent actions.  Native and string subscriptions,
as well as GET of metadata.

Complicated because event_handler_args does not identify
the evid.

see 717d69e1fc
2026-10-13 09:42:17 +02:00
zimoch 15ba5ed863 Merge branch '7.0' into PSI-7.0 2026-09-28 09:39:12 +02:00
ronaldomercado 2d8a6f91a9 Use consistent language for string termination (#806)
Avoid hyphen, prefer space: "null terminated"
2026-03-18 10:45:25 -05:00
Irie Railton f4ccf7bc8c iocsh command dbCreateRecord (#812)
* skeleton for implementation of dbCreateRecord iocsh exposure

* Add functionality of dbCreateRecordCallFunc
Includes adding dependancy to iocInit.h and a new error type in dbStaticLib.h

* Fix error message for case when adding record to IOC post init

* add new error message for when no record name is passed and check for empty strings

* add release note for dbCreateRecord IOC shell command

* fix issues from codeql in release notes

* fix documentation md based on codacy styling
2026-03-10 12:48:05 -05:00
Andrew Johnson 01e1073163 Fix editorconfig failure 2026-03-10 12:42:18 -05:00
ReBarsotti-HZB 5b23dcb466 Added Doxygen annotations to iocInit.h (#804)
Doxygen annotations for iocInit.h
2026-03-05 11:43:14 -06:00
ronaldomercado c7b899dca3 Annotate dbbase (#815)
* add doxygen tags

* add dbBase to be processed by sphinx
2026-03-03 18:13:52 -06:00
Michael Davidsaver d44ddf441a configure: ensure output file only updated on success
eg. After running "false > $@", the output file modification
time will be updated.  So a despite failure, a repeated
"make" will not re-run.

Handle this by accumulating output to "$@.tmp", then
move to $@ as a final step.
2026-02-27 16:17:53 +00:00
Michael Davidsaver 717d69e1fc dbCa: iocInit wait for local CA links to connect 2026-02-27 13:01:27 +00:00
Michael Davidsaver c41210c008 whitespace 2026-02-27 11:45:42 +00:00
ReBarsotti-HZB 976ef26381 Added Doxygen annotations to dbLock.h 2026-02-27 11:28:00 +00:00
ReBarsotti-HZB 06ec85be80 Added @file to dbExtractArray
File was already annotated but missing the @file declaration.
2026-02-27 11:25:15 +00:00
zimoch db693d4930 enable trim_trailing_whitespace 2026-02-18 10:34:08 -06:00
zimoch cd36c03da4 Enforce consistent space indent style 2026-02-18 10:34:08 -06:00
zimoch 8c9dd71f6e Fix gcc warning 'stringop-truncation' 2026-02-18 10:06:26 -06:00
zimoch fe39a007d8 Allow percentages for callbackParallelThreads count 2026-02-18 09:50:03 -06:00
zimoch e66bb87909 document change in epicsThreadGetCPUs 2026-02-18 09:50:03 -06:00
Jakub Wlodek 4fe5f75387 Fixing minor memory leak when dbPutConvertJSON call fails 2026-02-08 08:15:44 -08:00
Simon Rose 7e3255ff8e Add release notes and macros to (generated) header files 2026-02-04 10:15:24 -06:00
Henrique Silva 51c5b8f1ee Post NORD update event during record process for subArray 2026-02-04 10:15:24 -06:00
Henrique Silva 64011ba0f3 Remove NORD post event from subArray device support layer 2026-02-04 10:15:24 -06:00
Henrique Silva 5d1f572cea Remove NORD post event from device support layer
Fixes #280
This event will only be posted in the record support layer, specifically
in the process function.
2026-02-04 10:15:24 -06:00
Henrique Silva aff74638bd Post NORD update event during record process for aai and aao
Applying the same change as #263 did for waveform records
2026-02-04 10:15:24 -06:00
Bruce Hill fc8319ad10 Use NUM_TIME_EVENTS instead of hard constants for dbScan.c event code. 2026-02-04 09:50:44 -06:00
Hugo Slepicka 005e36258d Add error number to rsrv mcast loopback error msg. 2026-02-04 09:50:44 -06:00