EPICS Base Release

Changes made on the 3.16 branch since 3.15.3

Build support for CapFast and dbst removed

The build rules associated with the CapFast-related tools sch2edif and e2db and the database optimization tool dbst have been removed, along with the DB_OPT build configuration variable.

compressRecord buffering order

The compressRecord has a new field BALG which can select between FIFO (append) and LIFO (prepend) ordering for insertion of new elements. FIFO ordering is the default, matching the behviour of previous versions.

Valgrind Instrumentation

Valgrind is a software debugging suite provided by many Linux distributions. The header valgrind/valgrind.h is now included in, and installed by, Base. When included by a C or C++ source file this header defines some macros which expand to provide hints to the Valgrind runtime. These have no effect on normal operation of the software, but when run using the valgrind tool they can help to find memory leaks and buffer overflows. Suitable hints have been added to several free-lists within libCom, including freeListLib, allowing valgrind to provide more accurate information about the source of potential leaks.

valgrind.h automatically disables itself when the build target is not supported by the valgrind tool. It can also explicitly be disabled by defining the macro NVALGRIND. See src/libCom/Makefile for a commented-out example.

As a matter of policy valgrind.h will never be included by any header file installed by Base, so its use will remain purely an implementation detail hidden from application software. Support modules which choose to use valgrind.h are advised to do likewise.

Database Multi-locking

The IOC record locking code has been re-written with an expanded API; global locks are no longer required by the IOC database implementation.

The new API functions center around dbScanLockMany(), which behaves like dbScanLock() applied to an arbitrary group of records. dbLockerAlloc() is used to prepare a list or record pointers, then dbScanLockMany() is called. When it returns, all of the records listed may be accessed (in any order) until dbScanUnlockMany() is called.

The Application Developer's Guide has been updated to describe the API and implementation is more detail.

Previously a global mutex 'lockSetModifyLock' was locked and unlocked during dbScanLock(), acting as a sequencing point for otherwise unrelated calls. The new dbLock.c implementation does not include any global mutex in dbScanLock() or dbScanLockMany(). Locking/unlocking of unrelated lock sets is now completely concurrent.

Generate Version Header

A Perl script and Makefile rules have been added to allow modules to generate a C header file with a macro defined with an automatically updated identifier. This is a VCS revision ID (Darcs, Git, Mercurial, Subversion, and Bazaar are supported) or the date/time of the build if no VCS system is in use.

The makeBaseApp example template has been updated with a new device support which makes this identifier visible via a lsi (long string input) record.

epicsTime API return status

The epicsTime routines that used to return epicsTimeERROR now return a specific S_time_ status value, allowing the caller to discover the reason for any failure. The identifier epicsTimeERROR is no longer defined, so any references to it in source code will no longer compile. The identifier epicsTimeOK still exists and has the value 0 as before, so most code that uses these APIs can be changed in a way that is backwards-compatible with the previous return status.

Time providers that have to return a status value and still need to be built with earlier versions of Base can define the necessary status symbols like this:

#include "epicsTime.h"

#ifndef M_time
/* S_time_... status values were not provided before Base 3.16 */
#define S_time_unsynchronized epicsTimeERROR
#define S_time_...whatever... epicsTimeERROR

Refactoring of epicsReadline

The epicsReadline code has been reorganized to allow the commandline history editor to be disabled at runtime. The EPICS_COMMANDLINE_LIBRARY build setting still selects the preferred editor, but the new IOCSH_HISTEDIT_DISABLE environment variable can be set at runtime to disable history editing and make the IOC or other program use the basic editor instead. This is useful when starting and controlling an IOC from another program through its stdin and stdout streams since history editors often insert invisible escape codes into the stdout stream, making it hard to parse.

Callback subsystem API

Added a new macro callbackGetPriority(prio, callback) to the callback.h header and removed the need for dbScan.c to reach into the internals of its CALLBACK objects.

Changes pulled from the 3.15 branch since 3.15.3

CA server configuration changes

RSRV now honors EPICS_CAS_INTF_ADDR_LIST and binds only to the provided list of network interfaces. Name searches (UDP and TCP) on other network interfaces are ignored. For example on a computer with interfaces,, and, setting "EPICS_CAS_INTF_ADDR_LIST=''" will accept traffic on the .1.1 and .2.1, but ignore from .3.1

RSRV now honors EPICS_CAS_IGNORE_ADDR_LIST and ignores UDP messages received from addresses in this list.

Previously, CA servers (RSRV and PCAS) would build the beacon address list using EPICS_CA_ADDR_LIST if EPICS_CAS_BEACON_ADDR_LIST was no set. This is no longer done. Sites depending on this should set both envronment variables to the same value.

IPv4 multicast for name search and beacons

libca, RSRV, and PCAS may now use IPv4 multicasting for UDP traffic (name search and beacons). This is disabled by default. To enable multicast address(s) must be listed in EPICS_CA_ADDR_LIST for clients and EPICS_CAS_INTF_ADDR_LIST for servers (IOCs should set both). For example: "EPICS_CAS_INTF_ADDR_LIST='' EPICS_CA_ADDR_LIST=".

Please note that no IPv4 multicast address is officially assigned for Channel Access by IANA. The example is taken from the AD-HOC Block I range.

Moved mlockall() into its own epicsThread routine

Since EPICS Base on Posix OSs the initialization of the epicsThread subsystem has called mlockall() when the OS supports it and thread priority scheduling is enabled. Doing so has caused problems in third-party applications that call the CA client library, so the functionality has been moved to a separate routine epicsThreadRealtimeLock() which will be called by the IOC at iocInit (unless disabled by setting the global variable dbThreadRealtimeLock to zero).

Added dbQuietMacroWarnings control

When loading database files, macros get expanded even on comment lines. If a comment contains an undefined macro, the load still continues but an error message gets printed. For this release the error message has been changed to a warning, but even this warning can be made less verbose by setting this new variable to a non-zero value before loading the file, like this:

var dbQuietMacroWarnings 1      iocsh
dbQuietMacroWarnings=1          VxWorks

This was Launchpad bug 541119.

Changes pulled from the 3.14 branch since 3.15.3

RTEMS NTP Support Issue

On RTEMS the NTP Time Provider could in some circumstances get out of sync with the server because the osdNTPGet() code wasn't clearing its input socket before sending out a new request. This (Launchpad bug 1549908) has now been fixed.

CALC engine bitwise operator fixes

The bitwise operators in the CALC engine have been modified to work properly with values that have bit 31 (0x80000000) set. This modification involved back-porting some earlier changes from the 3.15 branch, and fixes Launchpad bug #1514520.

Fix ipAddrToAsciiAsync(): Don't try to join the daemon thread

On process exit, don't try to stop the worker thread that makes DNS lookups asynchronous. Previously this would wait for any lookups still in progress, delaying the exit unnecessarily. This was most obvious with catools (eg. cainfo). lp:1527636

Fix epicsTime_localtime() on Windows

Simpler versions of the epicsTime_gmtime() and epicsTime_localtime() routines have been included in the Windows implementations, and a new test program added. The original versions do not report DST status properly. Fixes Launchpad bug 1528284.