From d8f7c3731d475e5fc6a5a2cfb8e1ad444b218c19 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Mon, 12 Dec 2011 16:10:24 -0700 Subject: [PATCH 01/12] fixed various archaic sun pro build failures repoted by Dirk --- src/ca/udpiiu.cpp | 5 +++++ src/ca/udpiiu.h | 1 + src/cas/generic/st/casStreamOS.cc | 24 ++++++++++++------------ src/libCom/test/epicsTimeTest.cpp | 5 +++++ 4 files changed, 23 insertions(+), 12 deletions(-) diff --git a/src/ca/udpiiu.cpp b/src/ca/udpiiu.cpp index 625bead9f..4760583e9 100644 --- a/src/ca/udpiiu.cpp +++ b/src/ca/udpiiu.cpp @@ -397,6 +397,11 @@ void udpRecvThread::run () } while ( ! this->iiu.shutdownCmd ); } +/* for sunpro compiler */ +udpiiu::M_repeaterTimerNotify::~M_repeaterTimerNotify () +{ +} + /* * udpiiu::M_repeaterTimerNotify::repeaterRegistrationMessage () * diff --git a/src/ca/udpiiu.h b/src/ca/udpiiu.h index 2f9918e49..103547919 100644 --- a/src/ca/udpiiu.h +++ b/src/ca/udpiiu.h @@ -143,6 +143,7 @@ private: public: M_repeaterTimerNotify ( udpiiu & iiu ) : m_udpiiu ( iiu ) {} + ~M_repeaterTimerNotify (); /* for sunpro compiler */ // repeaterTimerNotify void repeaterRegistrationMessage ( unsigned attemptNumber ); diff --git a/src/cas/generic/st/casStreamOS.cc b/src/cas/generic/st/casStreamOS.cc index 12d2f2dab..e1fedb38a 100644 --- a/src/cas/generic/st/casStreamOS.cc +++ b/src/cas/generic/st/casStreamOS.cc @@ -230,6 +230,18 @@ void casStreamIOWakeup::show ( unsigned level ) const printf ( "}\n" ); } +// +// casStreamOS::armRecv () +// +inline void casStreamOS::armRecv() +{ + if ( ! this->pRdReg ) { + if ( ! this->inBufFull() ) { + this->pRdReg = new casStreamReadReg ( *this ); + } + } +} + // // casStreamIOWakeup::expire() // @@ -297,18 +309,6 @@ void casStreamIOWakeup::start ( casStreamOS &os ) this->pOS->printStatus ( "casStreamIOWakeup tmr start" ); } -// -// casStreamOS::armRecv () -// -inline void casStreamOS::armRecv() -{ - if ( ! this->pRdReg ) { - if ( ! this->inBufFull() ) { - this->pRdReg = new casStreamReadReg ( *this ); - } - } -} - // // casStreamOS::disarmRecv () // diff --git a/src/libCom/test/epicsTimeTest.cpp b/src/libCom/test/epicsTimeTest.cpp index 31a40f2b6..98cedd4bd 100644 --- a/src/libCom/test/epicsTimeTest.cpp +++ b/src/libCom/test/epicsTimeTest.cpp @@ -9,6 +9,11 @@ /* * Authors: Jeff Hill, Marty Kraimer and Andrew Johnson */ + +#ifdef __SUNPRO_CC +using namespace std; +#endif + #include #include #include From c32997ffa14f511f9e44f38025eda8a895330c33 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 20 Dec 2011 16:30:41 -0600 Subject: [PATCH 02/12] tools: Fix dependency file problem. Reported by Eric. --- src/tools/makeDbDepends.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/makeDbDepends.pl b/src/tools/makeDbDepends.pl index 16834de10..1366091c7 100644 --- a/src/tools/makeDbDepends.pl +++ b/src/tools/makeDbDepends.pl @@ -14,8 +14,8 @@ my $target = shift @ARGV; my %depends; while (my $line = <>) { - $depends{$2}++ if $line =~ m/^\s*file\s*(["']?)(.*)\1/; - $depends{$1}++ if $line =~ m/^\s*include\s+"(.*)"/; + $depends{$2}++ if $line =~ m/^ \s* file \s* (["']?) (\S*) \1 /x; + $depends{$1}++ if $line =~ m/^ \s* include \s* "(.*)" /x; } if (%depends) { From c538fc8cccf7fc162eaabe255edeec3732a796db Mon Sep 17 00:00:00 2001 From: Janet Anderson Date: Thu, 22 Dec 2011 11:33:41 -0600 Subject: [PATCH 03/12] Added -I$(COMMON_DIR) to DBFLAGS and DBDFLAGS definitions. --- configure/RULES.Db | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure/RULES.Db b/configure/RULES.Db index 96d51ec7f..e58e667aa 100644 --- a/configure/RULES.Db +++ b/configure/RULES.Db @@ -24,8 +24,8 @@ vpath %.acs $(USR_VPATH) $(GENERIC_SRC_DIRS) $(COMMON_DIR) # dbExpand INSTALL_DBDFLAGS += -I $(INSTALL_DBD) INSTALL_DBFLAGS += -I $(INSTALL_DB) -DBDFLAGS = $(USR_DBDFLAGS) -I . -I .. $(INSTALL_DBDFLAGS) $(RELEASE_DBDFLAGS) -DBFLAGS = $($*_DBFLAGS) $(USR_DBFLAGS) -I. -I.. $(INSTALL_DBFLAGS) $(RELEASE_DBFLAGS) +DBDFLAGS = $(USR_DBDFLAGS) -I. -I.. -I$(COMMON_DIR) $(INSTALL_DBDFLAGS) $(RELEASE_DBDFLAGS) +DBFLAGS = $($*_DBFLAGS) $(USR_DBFLAGS) -I. -I.. -I$(COMMON_DIR) $(INSTALL_DBFLAGS) $(RELEASE_DBFLAGS) ##################################################### # To allow os specific dbd files AND have the -j option work properly, From 2d6f8c585ad7808ac43658ecee0d2b7b208e1e47 Mon Sep 17 00:00:00 2001 From: Janet Anderson Date: Thu, 5 Jan 2012 10:45:20 -0600 Subject: [PATCH 04/12] Move DarwinPorts and Fink usage definitions to a CONFIG_SITE file --- configure/os/CONFIG.darwinCommon.darwinCommon | 14 ------------- .../os/CONFIG_SITE.darwinCommon.darwinCommon | 20 +++++++++++++++++++ 2 files changed, 20 insertions(+), 14 deletions(-) create mode 100644 configure/os/CONFIG_SITE.darwinCommon.darwinCommon diff --git a/configure/os/CONFIG.darwinCommon.darwinCommon b/configure/os/CONFIG.darwinCommon.darwinCommon index 2244276c6..dd794a02d 100644 --- a/configure/os/CONFIG.darwinCommon.darwinCommon +++ b/configure/os/CONFIG.darwinCommon.darwinCommon @@ -52,20 +52,6 @@ OP_SYS_CPPFLAGS += -Ddarwin OPT_CFLAGS_YES += -g OPT_CXXFLAGS_YES += -g -# -# The following two definitions enable the use of DarwinPorts packages. -# -OP_SYS_INCLUDES += -I/opt/local/include -# dir/firstword/wildcard used to avoid warning -L: directory name (...) does not exist -OP_SYS_LDFLAGS += $(addprefix -L,$(dir $(firstword $(wildcard /opt/local/lib/*)))) - -# -# The following two definitions enable the use of Fink packages. -# -OP_SYS_INCLUDES += -I/sw/include -# dir/firstword/wildcard used to avoid warning -L: directory name (...) does not exist -OP_SYS_LDFLAGS += $(addprefix -L,$(dir $(firstword $(wildcard /sw/lib/*)))) - # # Libraries for command-line editing. # diff --git a/configure/os/CONFIG_SITE.darwinCommon.darwinCommon b/configure/os/CONFIG_SITE.darwinCommon.darwinCommon new file mode 100644 index 000000000..e1690ba09 --- /dev/null +++ b/configure/os/CONFIG_SITE.darwinCommon.darwinCommon @@ -0,0 +1,20 @@ +# CONFIG_SITE.darwinCommon.darwinCommon +# +# $Revision-Id$ +# This file is maintained by the build community. +# +# Site specific definitions for darwin builds +#------------------------------------------------------- + +# Uncomment the following two definitions to enable the use of DarwinPorts packages. +# +#OP_SYS_INCLUDES += -I/opt/local/include +# dir/firstword/wildcard used to avoid warning -L: directory name (...) does not exist +#OP_SYS_LDFLAGS += $(addprefix -L,$(dir $(firstword $(wildcard /opt/local/lib/*)))) + +# Uncomment the following two definitions to enable the use of Fink packages. +# +#OP_SYS_INCLUDES += -I/sw/include +# dir/firstword/wildcard used to avoid warning -L: directory name (...) does not exist +#OP_SYS_LDFLAGS += $(addprefix -L,$(dir $(firstword $(wildcard /sw/lib/*)))) + From ee2a2dfffca5bf08293c6b326f240cd120821a40 Mon Sep 17 00:00:00 2001 From: "J. Lewis Muir" Date: Wed, 11 Jan 2012 11:40:30 -0600 Subject: [PATCH 05/12] libCom/iocsh: Ignore comment lines after macro expansion The handling of comment lines is only performed before macro expansion, thus lines with macros that expand to comment lines will not be correctly handled as comment lines. By chance this kind of worked sometimes because a "#" command that does nothing is internally added to the command registry to make it show up in the help output. Relying on this is broken. Furthermore, if the line starts with '#' followed by a non-separator character (e.g. "##", "#whatever", etc.) it will not work (i.e. it will produce a command-not-found error). This fix checks to see if the first character of the line after macro expansion is '#'. If it is, it considers the line to be a comment. --- src/libCom/iocsh/iocsh.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libCom/iocsh/iocsh.cpp b/src/libCom/iocsh/iocsh.cpp index a3cbd22a1..46f8d3529 100644 --- a/src/libCom/iocsh/iocsh.cpp +++ b/src/libCom/iocsh/iocsh.cpp @@ -567,6 +567,12 @@ iocshBody (const char *pathname, const char *commandLine) if ((prompt == NULL) && *line && (commandLine == NULL)) puts(line); + /* + * Ignore lines that become comment lines after macro expansion + */ + if (*line == '#') + continue; + /* * Break line into words */ From 7cc8a552a3efa25cf38ad81067a47ea5da970dfb Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 11 Jan 2012 16:47:37 -0600 Subject: [PATCH 06/12] db: Allow single-char accesses as long strings Clients try to use long string support to fetch DBF_STRING fields use DBF_CTRL_CHAR with a 1-element array, but the IOC was rejecting that. This permits it, and also ensures that the resulting strings are zero-terminated. Fixes lp:907761 --- documentation/RELEASE_NOTES.html | 12 ++++++++++++ src/db/dbAccess.c | 12 ++++++------ src/db/dbConvert.c | 14 ++++++++++++++ 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html index 91a84f214..93d3045c8 100644 --- a/documentation/RELEASE_NOTES.html +++ b/documentation/RELEASE_NOTES.html @@ -13,6 +13,18 @@ +

Launchpad Bugs Resolved

+ +

The following are links to bugs in the Launchpad bug tracker that have been +fixed in this release:

+ + +

Comments in iocsh scripts

The IOC shell was very particular about comments in previous versions of diff --git a/src/db/dbAccess.c b/src/db/dbAccess.c index a358270f3..22f4e20e7 100644 --- a/src/db/dbAccess.c +++ b/src/db/dbAccess.c @@ -969,7 +969,7 @@ long epicsShareAPI dbGetField(DBADDR *paddr,short dbrType, case DBR_CHAR: case DBR_UCHAR: - if (nRequest && *nRequest > 1) { + if (nRequest && *nRequest > 0) { maxlen = *nRequest - 1; break; } @@ -984,8 +984,8 @@ long epicsShareAPI dbGetField(DBADDR *paddr,short dbrType, if (!status) status = dbFindField(&dbEntry, pfldDes->name); if (!status) { rtnString = dbGetString(&dbEntry); - strncpy(pbuf, rtnString, maxlen - 1); - pbuf[maxlen - 1] = 0; + strncpy(pbuf, rtnString, maxlen); + pbuf[maxlen] = 0; } dbFinishEntry(&dbEntry); } else { @@ -1028,7 +1028,7 @@ long epicsShareAPI dbGet(DBADDR *paddr, short dbrType, case DBR_CHAR: case DBR_UCHAR: - if (nRequest && *nRequest > 1) { + if (nRequest && *nRequest > 0) { maxlen = *nRequest - 1; break; } @@ -1037,8 +1037,8 @@ long epicsShareAPI dbGet(DBADDR *paddr, short dbrType, return S_db_badDbrtype; } - strncpy(pbuf, (char *)paddr->pfield, maxlen - 1); - pbuf[maxlen - 1] = 0; + strncpy(pbuf, (char *)paddr->pfield, maxlen); + pbuf[maxlen] = 0; return 0; } diff --git a/src/db/dbConvert.c b/src/db/dbConvert.c index f370e0aa2..4b7ad7da1 100644 --- a/src/db/dbConvert.c +++ b/src/db/dbConvert.c @@ -416,6 +416,13 @@ static long getCharChar( char *pbuffer = (char *)pto; char *psrc=(char *)(paddr->pfield); + if (paddr->pfldDes->field_type == DBF_STRING) { + /* This is a DBF_STRING field being read as a long string. + * The buffer we return must be zero-terminated. + */ + pbuffer[--nRequest] = 0; + if (nRequest == 0) return(0); + } if(nRequest==1 && offset==0) { *pbuffer = *psrc; return(0); @@ -436,6 +443,13 @@ static long getCharUchar( unsigned char *pbuffer = (unsigned char *)pto; char *psrc=(char *)(paddr->pfield); + if (paddr->pfldDes->field_type == DBF_STRING) { + /* This is a DBF_STRING field being read as a long string. + * The buffer we return must be zero-terminated. + */ + pbuffer[--nRequest] = 0; + if (nRequest == 0) return(0); + } if(nRequest==1 && offset==0) { *pbuffer = *psrc; return(0); From adfa1257f50b81ae55ac5b9ac48b105f6e529970 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 16 Jan 2012 16:40:37 -0600 Subject: [PATCH 07/12] makeBaseApp: caMonitor example should use ca_create_subscription() It was calling ca_add_event(), which is a deprecated API. --- src/makeBaseApp/top/caClientApp/caMonitor.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/makeBaseApp/top/caClientApp/caMonitor.c b/src/makeBaseApp/top/caClientApp/caMonitor.c index 9bd77e8ea..059fefb5e 100644 --- a/src/makeBaseApp/top/caClientApp/caMonitor.c +++ b/src/makeBaseApp/top/caClientApp/caMonitor.c @@ -1,7 +1,9 @@ /*caMonitor.c*/ -/* This example accepts a file containing a list of pvs to monitor - * It prints a message for all ca evemts: connection, access rights, data + +/* This example accepts the name of a file containing a list of pvs to monitor. + * It prints a message for all ca events: connection, access rights and monitor. */ + #include #include #include @@ -110,18 +112,18 @@ int main(int argc,char **argv) SEVCHK(ca_context_create(ca_disable_preemptive_callback),"ca_context_create"); SEVCHK(ca_add_exception_event(exceptionCallback,NULL), "ca_add_exception_event"); - for(i=0; imychid), "ca_create_channel"); SEVCHK(ca_replace_access_rights_event(pmynode[i]->mychid, accessRightsCallback), "ca_replace_access_rights_event"); - SEVCHK(ca_add_event(DBR_STRING,pmynode[i]->mychid,eventCallback, - pmynode[i],&pmynode[i]->myevid), - "ca_add_event"); + SEVCHK(ca_create_subscription(DBR_STRING,1,pmynode[i]->mychid, + DBE_VALUE,eventCallback,pmynode[i],&pmynode[i]->myevid), + "ca_create_subscription"); } /*Should never return from following call*/ SEVCHK(ca_pend_event(0.0),"ca_pend_event"); - return(0); + return 0; } From 73768aae9a567485e6340fc2d2468d51fbe5d3ee Mon Sep 17 00:00:00 2001 From: Janet Anderson Date: Fri, 20 Jan 2012 10:50:10 -0600 Subject: [PATCH 08/12] Allow install of *.H header files. --- configure/RULES_BUILD | 1 + 1 file changed, 1 insertion(+) diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD index 0d6de95ff..a455f064a 100644 --- a/configure/RULES_BUILD +++ b/configure/RULES_BUILD @@ -22,6 +22,7 @@ vpath %.cpp $(USR_VPATH) $(ALL_SRC_DIRS) vpath %.C $(USR_VPATH) $(ALL_SRC_DIRS) vpath %.rc $(USR_VPATH) $(ALL_SRC_DIRS) vpath %.h $(USR_VPATH) $(ALL_SRC_DIRS) +vpath %.H $(USR_VPATH) $(ALL_SRC_DIRS) vpath %.skel.static $(USR_VPATH) $(ALL_SRC_DIRS) vpath %.y $(USR_VPATH) $(ALL_SRC_DIRS) vpath %.l $(USR_VPATH) $(ALL_SRC_DIRS) From f86cf730e9538335935962a66702a690f87ff2e6 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 27 Jan 2012 09:41:37 -0600 Subject: [PATCH 09/12] db: fix dbpf to enum from integer bug --- src/db/dbTest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/db/dbTest.c b/src/db/dbTest.c index 32733fe4d..84cc23e48 100644 --- a/src/db/dbTest.c +++ b/src/db/dbTest.c @@ -317,7 +317,7 @@ long epicsShareAPI dbpf(const char *pname,const char *pvalue) if (nameToAddr(pname, &addr)) return -1; /* For enumerated types must allow for ENUM rather than string*/ /* If entire field is digits then use DBR_ENUM else DBR_STRING*/ - if (addr.dbr_field_type == DBR_ENUM && !*pvalue && + if (addr.dbr_field_type == DBR_ENUM && *pvalue && strspn(pvalue,"0123456789") == strlen(pvalue)) { unsigned short value; From f5bc02393eea783c1d688f23aa88a6b32e098d68 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Thu, 2 Feb 2012 18:14:01 -0600 Subject: [PATCH 10/12] libCom: Increase stack sizes for Windows and Posix Windows stack sizes were the same as vxWorks - tiny. The stack sizes are now multiples of sizeof(void*). On 32-bit systems they give 256KB, 512KB and 1MB; 64-bit systems get twice those numbers. Fixes lp:903448 --- documentation/RELEASE_NOTES.html | 3 +++ src/libCom/osi/os/WIN32/osdThread.c | 5 ++++- src/libCom/osi/os/posix/osdThread.c | 9 ++++----- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html index 93d3045c8..14203fb03 100644 --- a/documentation/RELEASE_NOTES.html +++ b/documentation/RELEASE_NOTES.html @@ -23,6 +23,9 @@ fixed in this release:

reading only 1st char of link in "long string" ($) syntax fails in read error +
  • 903448 + + RHEL5 nss ldap update cause stack size related failure
  • Comments in iocsh scripts

    diff --git a/src/libCom/osi/os/WIN32/osdThread.c b/src/libCom/osi/os/WIN32/osdThread.c index c880fbd1a..86f7b7df7 100644 --- a/src/libCom/osi/os/WIN32/osdThread.c +++ b/src/libCom/osi/os/WIN32/osdThread.c @@ -446,7 +446,10 @@ epicsShareFunc epicsThreadBooleanStatus epicsShareAPI epicsThreadHighestPriority epicsShareFunc unsigned int epicsShareAPI epicsThreadGetStackSize ( epicsThreadStackSizeClass stackSizeClass ) { - static const unsigned stackSizeTable[epicsThreadStackBig+1] = {4000, 6000, 11000}; + #define STACK_SIZE(f) (f * 0x10000 * sizeof(void *)) + static const unsigned stackSizeTable[epicsThreadStackBig+1] = { + STACK_SIZE(1), STACK_SIZE(2), STACK_SIZE(4) + }; if (stackSizeClass Date: Fri, 3 Feb 2012 16:12:06 -0600 Subject: [PATCH 11/12] libCom/test: Add diagnostic to epicsStdioTest on vxWorks This test fails if the cwd is not writable, but on vxWorks the fault appears at the fclose() not the fopen() line. The code now detects this and tells the user what's probably wrong. --- src/libCom/test/epicsStdioTest.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/libCom/test/epicsStdioTest.c b/src/libCom/test/epicsStdioTest.c index da4256805..54fc3a48a 100644 --- a/src/libCom/test/epicsStdioTest.c +++ b/src/libCom/test/epicsStdioTest.c @@ -85,8 +85,13 @@ void testStdoutRedir (const char *report) testOk1(stdout == realStdout); errno = 0; - if (!testOk1(!fclose(stream))) - testDiag("fclose error: %s\n", strerror(errno)); + if (!testOk1(!fclose(stream))) { + testDiag("fclose error: %s", strerror(errno)); +#ifdef vxWorks + testDiag("The above test fails if you don't cd to a writable directory"); + testDiag("before running the test. The next test will also fail..."); +#endif + } if (!testOk1((stream = fopen(report, "r")) != NULL)) { testDiag("'%s' could not be opened for reading: %s", From 3dec8f8c78c5650073499e6a4390eb70f1f7ff11 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 20 Feb 2012 09:52:54 -0600 Subject: [PATCH 12/12] configure: Removed _ARM_NWFP_ Apparently this hasn't been needed for quite a while. --- configure/os/CONFIG.Common.linux-arm | 3 --- 1 file changed, 3 deletions(-) diff --git a/configure/os/CONFIG.Common.linux-arm b/configure/os/CONFIG.Common.linux-arm index 8b0a8c2a4..15dad9e9e 100644 --- a/configure/os/CONFIG.Common.linux-arm +++ b/configure/os/CONFIG.Common.linux-arm @@ -11,9 +11,6 @@ include $(CONFIG)/os/CONFIG.Common.linuxCommon ARCH_CLASS = arm -# Set a special definition for network order of Netwinder ARM floating point -ARCH_DEP_CPPFLAGS += -D_ARM_NWFP_ - ifeq ($(BUILD_CLASS),CROSS) VALID_BUILDS = Ioc GNU_TARGET = arm-linux