manual config beacon addr list fails on little endian arch

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

Bug Description

Symptom:
When manual configuration of the IOCs beacon address list is used via EPICS_CA_ADDR_LIST (or EPICS_CAS_BEACON_ADDR_LIST) on a little endian architecture (Intel architecture) beacon address list is empty, and no beacons are sent.

Version:
The bug exists only on in EPICS R3.14.10. It was introduced by the fix for mantis 302.

Additional information:
From Mark Rivers:

I have now proven that there is a change in the behavior of the beacon address list from 3.14.8.2 to 3.14.10 on both Linux and Win32. Linux and Win32 seem to behave identically, contrary to what I originally thought.

On 3.14.10 if EPICS_CA_AUTO_ADDR_LIST=NO and EPICS_CA_ADDR_LIST is manually set (even to the same as the default would be if EPICS_CA_AUTO_ADDR_LIST were YES) then the beacon address list is empty.

On 3.14.8.2 this is not the case, even if EPICS_CA_AUTO_ADDR_LIST=NO then a correct beacon address list is created.

Here is the proof on a Linux system running 3.14.10:

Here is what I get with EPICS_CA_ADDR_LIST and EPICS_CA_AUTO_ADDR_LIST
undefined:

epics> epicsPrtEnvParams
EPICS_AR_PORT: 7002
EPICS_CAS_AUTO_BEACON_ADDR_LIST is undefined EPICS_CAS_BEACON_ADDR_LIST is undefined EPICS_CAS_BEACON_PERIOD is undefined EPICS_CAS_BEACON_PORT is undefined EPICS_CAS_IGNORE_ADDR_LIST is undefined EPICS_CAS_INTF_ADDR_LIST is undefined EPICS_CAS_SERVER_PORT is undefined EPICS_CA_ADDR_LIST is undefined
EPICS_CA_AUTO_ADDR_LIST: YES
EPICS_CA_BEACON_PERIOD: 15.0
EPICS_CA_CONN_TMO: 30.0
EPICS_CA_MAX_ARRAY_BYTES: 10000000
EPICS_CA_MAX_SEARCH_PERIOD: 300.0
EPICS_CA_REPEATER_PORT: 5065
EPICS_CA_SERVER_PORT: 5064
EPICS_CMD_PROTO_PORT is undefined
EPICS_IOC_LOG_FILE_COMMAND is undefined
EPICS_IOC_LOG_FILE_LIMIT: 10000000
EPICS_IOC_LOG_FILE_NAME: /home/epics/logs/IOC.log EPICS_IOC_LOG_INET is undefined
EPICS_IOC_LOG_PORT: 7004
EPICS_TIMEZONE: CUS::360:030902:110202
EPICS_TS_NTP_INET is undefined
IOCSH_HISTSIZE: 50
IOCSH_PS1: epics>

epics> casr 20
...
There are currently 282784 bytes on the server's free list
6 client(s), 422 channel(s), 422 event(s) (monitors) 0 putNotify(s)
14 small buffers (16384 bytes ea), and 0 jumbo buffers (10000024 bytes
ea)
The server's resource id conversion table:
Bucket entries in use = 90 bytes in use = 17844 Bucket entries/hash id - mean = 0.021973 std dev = 0.146594 max = 1 The server's array size limit is 10000024 bytes max Channel Access Address List
164.54.160.255:5065

So that is fine the beacon Channel Access Address List is set to 164.54.160.255:5065, which is correct. Now here is what I get with EPICS_CA_AUTO_ADDR_LIST=NO and EPICS_CA_ADDR_LIST=164.54.160.255, i.e.
the same as the default value if it is not manually set.

epics> epicsPrtEnvParams
EPICS_AR_PORT: 7002
EPICS_CAS_AUTO_BEACON_ADDR_LIST is undefined EPICS_CAS_BEACON_ADDR_LIST is undefined EPICS_CAS_BEACON_PERIOD is undefined EPICS_CAS_BEACON_PORT is undefined EPICS_CAS_IGNORE_ADDR_LIST is undefined EPICS_CAS_INTF_ADDR_LIST is undefined EPICS_CAS_SERVER_PORT is undefined
EPICS_CA_ADDR_LIST: 164.54.160.255
EPICS_CA_AUTO_ADDR_LIST: NO
EPICS_CA_BEACON_PERIOD: 15.0
EPICS_CA_CONN_TMO: 30.0
EPICS_CA_MAX_ARRAY_BYTES: 10000000
EPICS_CA_MAX_SEARCH_PERIOD: 300.0
EPICS_CA_REPEATER_PORT: 5065
EPICS_CA_SERVER_PORT: 5064
EPICS_CMD_PROTO_PORT is undefined
EPICS_IOC_LOG_FILE_COMMAND is undefined
EPICS_IOC_LOG_FILE_LIMIT: 10000000
EPICS_IOC_LOG_FILE_NAME: /home/epics/logs/IOC.log EPICS_IOC_LOG_INET is undefined
EPICS_IOC_LOG_PORT: 7004
EPICS_TIMEZONE: CUS::360:030902:110202
EPICS_TS_NTP_INET is undefined
IOCSH_HISTSIZE: 50
IOCSH_PS1: epics>

epics> casr 20
...
There are currently 282784 bytes on the server's free list
6 client(s), 422 channel(s), 422 event(s) (monitors) 0 putNotify(s)
14 small buffers (16384 bytes ea), and 0 jumbo buffers (10000024 bytes
ea)
The server's resource id conversion table:
Bucket entries in use = 90 bytes in use = 17844 Bucket entries/hash id - mean = 0.021973 std dev = 0.146594 max = 1 The server's array size limit is 10000024 bytes max Channel Access Address List
epics>

So the Channel Access Address List is undefined if EPICS_CA_AUTO_ADDR_LIST is NO.

This is definitely new behavior. In this case no beacons are sent, and hence clients will be very slow to reconnect.

Here is the output when I run a 3.14.8.2 IOC on the same Linux system with the same environment variable settings.

epics> coreRelease
########################################################################
####
### EPICS IOC CORE built on Oct 6 2008 ### EPICS R3.14.8.2 $R3-14-8-2$ $2006/01/06 15:55:13$ ########################################################################
####

epics> epicsPrtEnvParams
EPICS_AR_PORT: 7002
EPICS_CAS_AUTO_BEACON_ADDR_LIST is undefined EPICS_CAS_BEACON_ADDR_LIST is undefined EPICS_CAS_BEACON_PERIOD is undefined EPICS_CAS_BEACON_PORT is undefined EPICS_CAS_IGNORE_ADDR_LIST is undefined EPICS_CAS_INTF_ADDR_LIST is undefined EPICS_CAS_SERVER_PORT is undefined
EPICS_CA_ADDR_LIST: 164.54.160.255
EPICS_CA_AUTO_ADDR_LIST: NO
EPICS_CA_BEACON_PERIOD: 15.0
EPICS_CA_CONN_TMO: 30.0
EPICS_CA_MAX_ARRAY_BYTES: 10000000
EPICS_CA_MAX_SEARCH_PERIOD: 300.0
EPICS_CA_REPEATER_PORT: 5065
EPICS_CA_SERVER_PORT: 5064
EPICS_CMD_PROTO_PORT is undefined
EPICS_IOC_LOG_FILE_COMMAND is undefined
EPICS_IOC_LOG_FILE_LIMIT: 10000000
EPICS_IOC_LOG_FILE_NAME: /home/epics/logs/IOC.log EPICS_IOC_LOG_INET is undefined
EPICS_IOC_LOG_PORT: 7004
EPICS_TIMEZONE: CUS::360:040202:102902
EPICS_TS_NTP_INET is undefined
IOCSH_HISTSIZE: 50
IOCSH_PS1: epics>

epics> casr 20
...
There are currently 285316 bytes on the server's free list
6 client(s), 443 channel(s), 443 event(s) (monitors) 0 putNotify(s)
14 small buffers (16384 bytes ea), and 0 jumbo buffers (10000024 bytes
ea)
The server's resource id conversion table:
Bucket entries in use = 69 bytes in use = 17508 Bucket entries/hash id - mean = 0.016846 std dev = 0.128693 max = 1 The server's array size limit is 10000024 bytes max Channel Access Address List
164.54.160.255:5065

So on 3.14.8.2 it builds a correct beacon address list, even if EPICS_CA_AUTO_ADDR_LIST=NO.

Platform: little endian arch

Version: R3.14.10

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

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

Committed this fix. The database inst building at the moment so I tested with excas - which should be a good test because both PCAS and RSRV use the same common component in CA where the fix was applied.

cvs diff -wb -- iocinf.cpp (in directory C:\hill\R3.14.dll_hell_fix\epics\base\src\ca\)
Index: iocinf.cpp
===================================================================
RCS file: /net/phoebus/epicsmgr/cvsroot/epics/base/src/ca/iocinf.cpp,v
retrieving revision 1.23.2.5
diff -u -b -w -b -r1.23.2.5 iocinf.cpp
--- iocinf.cpp 22 Sep 2008 18:20:56 -0000 1.23.2.5
+++ iocinf.cpp 9 Feb 2009 16:48:55 -0000
@@ -97,7 +97,7 @@
             continue;
         }

- if ( ignoreNonDefaultPort && addr.sin_port != port ) {
+ if ( ignoreNonDefaultPort && ntohs ( addr.sin_port ) != port ) {
             continue;
         }

***** CVS exited normally with code 1 *****

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

Fixed in R3.14.11

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

R3.14.11 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.