Compare commits

...

83 Commits

Author SHA1 Message Date
Andrew Johnson
e613d685fd Merge 3.16 into database/master 2018-03-22 23:25:56 -05:00
Andrew Johnson
a3c01bbf77 Merge 3.16 into 3.17 2018-03-22 18:07:25 -05:00
Andrew Johnson
086bc961a4 Merge 3.15 into 3.16 2018-03-15 17:53:10 -05:00
Andrew Johnson
58dc1ced9b Fix softTest synchronization bug
Local CA output links do *not* trigger processing in the same thread;
need to wait for the dest record in Group 3, but not in Group 4.
2018-03-15 17:52:52 -05:00
Andrew Johnson
d8802c8b24 Merge 3.14 into 3.15 2018-03-15 17:46:48 -05:00
Andrew Johnson
b7d4609e57 Merge Bruce Hill's camonitor-server-relative-ts-bug-3.14 branch 2018-03-15 17:33:32 -05:00
Andrew Johnson
7b5b23f6d3 Merge 3.14 into 3.15 2018-03-15 17:11:20 -05:00
Andrew Johnson
c8a7e1597d VxWorks Timezone updates
Remove 2017; fix hour in MET settings
2018-03-15 10:57:55 -05:00
Andrew Johnson
0f7a7902e4 Merge ~bhill:checkRelease-error-msgs into 3.16 2018-03-14 17:59:28 -05:00
Andrew Johnson
42403232e9 Merge 3.15 into 3.16 2018-03-14 16:11:36 -05:00
Andrew Johnson
8333338f99 Merge 3.14 into 3.15 2018-03-14 16:08:07 -05:00
Andrew Johnson
ceaff61c09 Pull in the podToHtml.pl script and rules from 3.15
This lets src/cap5 build with Perl installations that lack Perl's
podchecker and pod2html scripts (e.g. Fedora 27).
2018-03-14 14:12:12 -05:00
Bruce Hill
12bb8969ad Rework module dependency conflict error message for easier debugging.
Now a simply grep for asyn in the build log will show you line by
line which modules depend on which asyn versions.
2018-03-12 18:47:04 -07:00
Andrew Johnson
ea408578e0 Merge 3.15 branch into 3.16 2018-03-12 16:51:23 -05:00
Andrew Johnson
2307e94d1c Rules for building bootable TESTPROD_RTEMS targets
Previously if you wanted a .boot file it had to be installed.
2018-03-12 16:34:54 -05:00
Andrew Johnson
f44da65942 Merge 3.15 branch into 3.16 2018-03-09 13:21:09 -06:00
Andrew Johnson
be8f35d782 Fix for lp: #1754298
Cleaned up and reformatted since Dirk's original.
2018-03-09 12:46:46 -06:00
Bruce Hill
6cc623a7b4 Fixed camonitor server side relative timestamps bug
tsFirst needs to get initialized from the first server side
timestamp instead of the client side tsNow.
2018-03-08 01:40:11 -08:00
Andrew Johnson
d7e416e76a Now dbGetString() works before iocInit, fix asTest to match
Previously dbGetString() of a link field would return an empty string
until iocInit was run. I fixed that earlier today, so asTest started
failing because it was checking for the old behavior.
2018-03-07 00:02:45 -06:00
Andrew Johnson
c05101bb3f Make dbGetString() fetch link fields properly before iocInit 2018-03-06 18:23:34 -06:00
Andrew Johnson
958c81db89 Protect dbGetString() if field has overflowed
Only return the number of characters that a string field can actually
hold, in case it had a buffer overflow.
2018-03-06 17:25:42 -06:00
Andrew Johnson
9020c2ce1a testdbConvert: Add some minor overflow checks 2018-03-06 14:45:06 -06:00
Andrew Johnson
1458f8640e Merge 3.15 into 3.16 2018-03-04 15:58:26 -06:00
Andrew Johnson
a9764c8f62 tools/caput: Report errors from ca_array_put*()
Fixes LP: #1747983
2018-03-04 15:51:39 -06:00
Andrew Johnson
98d9ea4545 ca/client: Catch by reference, missing '&' 2018-03-04 15:45:15 -06:00
Andrew Johnson
8eb4eec7d2 Corrected fix from Bruce Hill's Github PR#19 2018-03-03 17:17:34 -06:00
Andrew Johnson
98930eebc4 strcpy() -> strncpy() changes from Bruce Hill
Also added some additional static assertions for string field sizes.
2018-03-03 00:12:59 -06:00
Andrew Johnson
0e0a919567 Merge 3.16 into database/master 2018-02-25 00:28:39 -06:00
Andrew Johnson
cfdd689000 Merge 3.16 into 3.17 2018-02-25 00:07:45 -06:00
Andrew Johnson
292141458c Merge 3.15 branch into 3.16 2018-02-24 21:35:01 -06:00
Andrew Johnson
c18b6f2ccf Deny use of dbgf, dbpf, dbtr, dbtgf and dbtpf before iocInit
Can't use locking dbAccess routines until lock-sets have been calculated.
Fixes LP: #1725248
2018-02-24 20:15:08 -06:00
Andrew Johnson
e41f8bf518 Translate and escape chars in info tag strings
Fixes LP: #1716998
2018-02-24 19:11:54 -06:00
Andrew Johnson
ae548d3400 Remove cantProceed() from dbGetLink() and dbPutLink()
Fixes LP: #1528314
Affects 3.15 branch only.
2018-02-24 17:40:45 -06:00
Andrew Johnson
85c6e9bdfb Merge clang fixes from 3.15 into 3.16 2018-02-09 11:35:55 -06:00
Andrew Johnson
550beeab9f More clang warning clean-ups
The short => int change is a UB issue, the second argument to va_start()
must be of a type that does not undergo promotion. See
https://wiki.sei.cmu.edu/confluence/display/cplusplus/EXP58-CPP.+Pass+an+object+of+the+correct+type+to+va_start
2018-02-09 11:29:16 -06:00
Andrew Johnson
bf91275200 Merge clang fixes from 3.14 into 3.15 2018-02-09 11:16:26 -06:00
Andrew Johnson
ac4d5c95ac Clean up some compiler warnings from clang 2018-02-09 10:56:52 -06:00
Andrew Johnson
a4f072238a Merge 3.16 into database/master 2018-02-05 13:29:29 -06:00
Andrew Johnson
6603d778cb Merge 3.16 into 3.17 2018-02-05 12:51:06 -06:00
Andrew Johnson
cd8fd8a08f Merge 3.15 into 3.16 2018-02-05 12:06:37 -06:00
Andrew Johnson
61296b8cff Merge 3.14 into 3.15
Fix for LP: #1743076
2018-02-05 12:03:28 -06:00
Andrew Johnson
de442e9584 Fix for LP: #1743076
Never zero the CA client context private ID.
2018-02-05 12:02:13 -06:00
Andrew Johnson
ac367398b3 Merge fix for lp: #1747091 from 3.14 into 3.15 2018-02-02 17:49:00 -06:00
Andrew Johnson
713c2d5080 Fix for lp: #1747091
generalTimeGetEvent()
2018-02-02 17:47:35 -06:00
Andrew Johnson
eef6f3afbb Merge 3.15 branch into 3.16 2018-02-01 15:05:44 -06:00
Andrew Johnson
af07016464 Merge 3.14 branch into 3.15
Actually a different fix to Michael's 3.14 commit due to divergent code.
2018-02-01 14:20:47 -06:00
Michael Davidsaver
734d16291f rsrv: buffer for IP too small
An IPv4 address and port number
has 21 characters max.
2018-02-01 09:42:51 -08:00
Andrew Johnson
f1e5e9689b Merge 3.14 branch into 3.15 2018-02-01 11:23:29 -06:00
Andrew Johnson
1454f42a27 Config fix for parallel builds with MSVC 2015 and later
From Mark Rivers and Freddie Akeroyd.
2018-02-01 11:19:08 -06:00
Andrew Johnson
3174e22faf Merge 3.16 into 3.17 2018-01-21 00:50:16 -06:00
Andrew Johnson
506be838af Merge 3.15 into 3.16 2018-01-21 00:45:38 -06:00
Andrew Johnson
ddbdcf9462 rec/test: Add missing filename to DBDDEPENDS_FILES 2018-01-21 00:44:10 -06:00
Andrew Johnson
a5e58829fd Merge up changes from below 2018-01-20 19:17:35 -06:00
Andrew Johnson
729e6fda4d tools: Add some context to the 'Undefined macro' warning
Mark Rivers saw this warning when he forgot to configure and build a
dependent module properly. The additional information given by this
change would have helped him track down the problem faster.
2018-01-19 13:14:13 -06:00
Andrew Johnson
0315e90e6e Revert "tools: Use Carp"
This reverts commit f207b00b05.

None of these warn/die messages request a stack dump since they all
end with \n, but carp & croak ignore that.
2018-01-19 11:06:23 -06:00
Andrew Johnson
00f30ac53a Merge URL updates from 3.15 branch into 3.16 2018-01-18 23:52:18 -06:00
Andrew Johnson
66c6aaa44f Merge URL updates from 3.14 branch into 3.15 2018-01-18 23:46:42 -06:00
Andrew Johnson
c830a3a4ee Updated links to new EPICS website at Argonne
Only done for documents that are still present in EPICS 7.
2018-01-18 23:35:09 -06:00
Andrew Johnson
1daab5fb35 Add soft-channel tests for local dbCa links, both input and output
Update test descriptions.
Renamed records to match their group number.
103 more tests, but some could fail on a busy system...
2018-01-18 23:16:42 -06:00
Andrew Johnson
f5cd555383 Describe recent 3.16-only fixes in Release Notes
Preparing for Base-3.16.2 at some point.
2018-01-08 16:53:11 -06:00
Andrew Johnson
f527e5939e Cleanup epicsReadline.c
No real code changes, just reformatting and variable renames.
2018-01-08 11:58:20 -06:00
Andrew Johnson
d41f2e6806 Configure command-line interface for VxWorks
Add new LEDLIB and OTHER configuration options.
Fix typo in vxWorks/osdReadline.c
Use LEDLIB on VxWorks.

Fixes LP: #1741578
2018-01-08 11:56:37 -06:00
Andrew Johnson
692b971e06 Merge branch '3.15' into 3.16 2018-01-04 14:48:25 -06:00
Andrew Johnson
8766ce05aa Fix slow callback test failures.
Slow callbacks no longer cause test failures, now they just emit a
diagnostic. Jenkins on MacOS frequently failed those tests.

We should never test for something that we can't fix.
2018-01-04 11:41:38 -06:00
Ralph Lange
84e0220852 Merge appveyor change from 3.15 2018-01-04 09:05:49 +01:00
Ralph Lange
8f62940265 Merge appveyor change from 3.14 2018-01-04 09:03:50 +01:00
Ralph Lange
8a1477ecab appveyor-ci: update APS download URL 2018-01-04 09:00:18 +01:00
Andrew Johnson
5c97e54cf7 Drop seconds from genVersionHeader's build date/time
On Windows a build can loop forever if seconds are included.
2017-12-28 11:28:41 -06:00
Ralph Lange
3646493014 Merge appveyor changes from 3.15 into 3.16 2017-12-19 09:54:23 +01:00
Ralph Lange
89cbb95c2c Merge appveyor changes from 3.14 2017-12-19 09:52:15 +01:00
Ralph Lange
006ce1a240 appveyor-ci: remove VS 2008, add VS 2017 2017-12-19 09:39:57 +01:00
Ralph Lange
276dee2c3e appveyor-ci: use curl for download of make.zip 2017-12-19 09:39:10 +01:00
Andrew Johnson
98a2871727 Reset SNAPSHOT to -DEV after tagging 3.14.12.7 2017-12-15 16:09:21 -06:00
Andrew Johnson
5ca1bb3bd5 Set SNAPSHOT for 3.14.12.7 final release 2017-12-15 16:06:08 -06:00
Andrew Johnson
07e8cf162d Update version number after tagging release 2017-12-14 16:16:21 -06:00
Andrew Johnson
f6be3c7f70 Set snapshot to -rc1-DEV 2017-12-08 16:40:08 -06:00
Andrew Johnson
00924dcba0 About to tag 3.14.12.7-rc1 2017-12-08 16:37:03 -06:00
Andrew Johnson
20312f82ed Merge Release.pm fix from 3.16 into 3.17 2017-12-06 16:55:51 -06:00
Andrew Johnson
8e2b782b7c Merge Release.pm fix from 3.15 into 3.16 2017-12-06 16:52:04 -06:00
Andrew Johnson
3b0f34e0be Fix recursive check in Release.pm 2017-12-06 16:29:31 -06:00
Andrew Johnson
ab555a280b Merge 3.16 into 3.17 2017-11-18 13:32:59 -06:00
Andrew Johnson
527a49bfc1 Merge branch 3.16 into 3.17 2017-11-15 22:23:32 -06:00
Andrew Johnson
f36ce8ca3d Merge 3.16 into 3.17 2017-11-11 18:17:54 -06:00
16 changed files with 320 additions and 107 deletions

View File

@@ -1,4 +1,4 @@
EPICS_DATABASE_MAJOR_VERSION = 3
EPICS_DATABASE_MINOR_VERSION = 17
EPICS_DATABASE_MAINTENANCE_VERSION = 0
EPICS_DATABASE_DEVELOPMENT_FLAG = 0
EPICS_DATABASE_MAINTENANCE_VERSION = 1
EPICS_DATABASE_DEVELOPMENT_FLAG = 1

View File

@@ -410,7 +410,7 @@ long dbd(const char *record_name)
precord = addr.precord;
if (! (precord->bkpt & BKPT_ON_MASK)) {
if (!(precord->bkpt & BKPT_ON_MASK)) {
printf(" BKPT> No breakpoint set in this record\n");
return(S_db_bkptNotSet);
}

View File

@@ -309,6 +309,11 @@ long dbgf(const char *pname)
if (nameToAddr(pname, &addr))
return -1;
if (addr.precord->lset == NULL) {
printf("dbgf only works after iocInit\n");
return -1;
}
no_elements = MIN(addr.no_elements, sizeof(buffer)/addr.field_size);
if (addr.dbr_field_type == DBR_ENUM) {
long status = dbGetField(&addr, DBR_STRING, pbuffer,
@@ -345,6 +350,11 @@ long dbpf(const char *pname,const char *pvalue)
if (nameToAddr(pname, &addr))
return -1;
if (addr.precord->lset == NULL) {
printf("dbpf only works after iocInit\n");
return -1;
}
if (addr.no_elements > 1 &&
(addr.dbr_field_type == DBR_CHAR || addr.dbr_field_type == DBR_UCHAR)) {
dbrType = addr.dbr_field_type;
@@ -399,6 +409,11 @@ long dbtr(const char *pname)
if (nameToAddr(pname, &addr))
return -1;
if (addr.precord->lset == NULL) {
printf("dbtr only works after iocInit\n");
return -1;
}
precord = (struct dbCommon*)addr.precord;
if (precord->pact) {
printf("record active\n");
@@ -438,6 +453,11 @@ long dbtgf(const char *pname)
if (nameToAddr(pname, &addr))
return -1;
if (addr.precord->lset == NULL) {
printf("dbtgf only works after iocInit\n");
return -1;
}
/* try all options first */
req_options = 0xffffffff;
ret_options = req_options;
@@ -534,6 +554,11 @@ long dbtpf(const char *pname, const char *pvalue)
if (nameToAddr(pname, &addr))
return -1;
if (addr.precord->lset == NULL) {
printf("dbtpf only works after iocInit\n");
return -1;
}
for (put_type = DBR_STRING; put_type <= DBF_ENUM; put_type++) {
union {
epicsInt8 i8;
@@ -795,7 +820,7 @@ static void printBuffer(
printf("no_strs = %u:\n",
pdbr_enumStrs->no_str);
for (i = 0; i < pdbr_enumStrs->no_str; i++)
for (i = 0; i < pdbr_enumStrs->no_str; i++)
printf("\t\"%s\"\n", pdbr_enumStrs->strs[i]);
}
else {

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* Author: Marty Kraimer Date: 13JUL95*/
@@ -169,7 +169,7 @@ static char *dbOpenFile(DBBASE *pdbbase,const char *filename,FILE **fp)
}
pdbPathNode = (dbPathNode *)ellFirst(ppathList);
while (pdbPathNode) {
fullfilename = dbMalloc(strlen(pdbPathNode->directory) +
fullfilename = dbMalloc(strlen(pdbPathNode->directory) +
strlen(filename) + 2);
strcpy(fullfilename, pdbPathNode->directory);
strcat(fullfilename, "/");
@@ -190,7 +190,7 @@ static void freeInputFileList(void)
inputFile *pinputFileNow;
while((pinputFileNow=(inputFile *)ellFirst(&inputFileList))) {
if(fclose(pinputFileNow->fp))
if(fclose(pinputFileNow->fp))
errPrintf(0,__FILE__, __LINE__,
"Closing file %s",pinputFileNow->filename);
free((void *)pinputFileNow->filename);
@@ -215,7 +215,7 @@ static long dbReadCOM(DBBASE **ppdbbase,const char *filename, FILE *fp,
inputFile *pinputFile = NULL;
char *penv;
char **macPairs;
if(ellCount(&tempList)) {
epicsPrintf("dbReadCOM: Parser stack dirty %d\n", ellCount(&tempList));
}
@@ -341,7 +341,7 @@ static int db_yyinput(char *buf, int max_size)
{
size_t l,n;
char *fgetsRtn;
if(yyAbort) return(0);
if(*my_buffer_ptr==0) {
while(TRUE) { /*until we get some input*/
@@ -360,7 +360,7 @@ static int db_yyinput(char *buf, int max_size)
fgetsRtn = fgets(my_buffer,MY_BUFFER_SIZE,pinputFileNow->fp);
}
if(fgetsRtn) break;
if(fclose(pinputFileNow->fp))
if(fclose(pinputFileNow->fp))
errPrintf(0,__FILE__, __LINE__,
"Closing file %s",pinputFileNow->filename);
free((void *)pinputFileNow->filename);
@@ -511,7 +511,7 @@ static void dbRecordtypeFieldHead(char *name,char *type)
{
dbFldDes *pdbFldDes;
int i;
if(duplicate) return;
pdbFldDes = dbCalloc(1,sizeof(dbFldDes));
allocTemp(pdbFldDes);
@@ -544,7 +544,7 @@ static short findOrAddGuiGroup(const char *name)
static void dbRecordtypeFieldItem(char *name,char *value)
{
dbFldDes *pdbFldDes;
if(duplicate) return;
pdbFldDes = (dbFldDes *)getLastTemp();
if(strcmp(name,"asl")==0) {
@@ -636,11 +636,11 @@ static void dbRecordtypeCdef(char *text) {
dbText *pdbCdef;
tempListNode *ptempListNode;
dbRecordType *pdbRecordType;
if (!pdbbase->loadCdefs || duplicate) return;
ptempListNode = (tempListNode *)ellFirst(&tempList);
pdbRecordType = ptempListNode->item;
pdbCdef = dbCalloc(1,sizeof(dbText));
if (text[0] == ' ') text++; /* strip leading space if present */
pdbCdef->text = epicsStrDup(text);
@@ -699,7 +699,7 @@ static void dbRecordtypeBody(void)
if((field_type==DBF_STRING) && (pdbFldDes->size==0))
fprintf(stderr,"recordtype(%s).%s size not specified\n",
pdbRecordType->name,pdbFldDes->name);
if((field_type==DBF_NOACCESS) && (pdbFldDes->extra==0))
if((field_type==DBF_NOACCESS) && (pdbFldDes->extra==0))
fprintf(stderr,"recordtype(%s).%s extra not specified\n",
pdbRecordType->name,pdbFldDes->name);
}
@@ -811,7 +811,7 @@ static void dbDriver(char *name)
pgphentry = gphAdd(pdbbase->pgpHash,pdrvSup->name,&pdbbase->drvList);
if(!pgphentry) {
yyerrorAbort("gphAdd failed");
}
}
pgphentry->userPvt = pdrvSup;
ellAdd(&pdbbase->drvList,&pdrvSup->node);
}
@@ -831,7 +831,7 @@ static void dbLinkType(char *name, char *jlif_name)
pgphentry = gphAdd(pdbbase->pgpHash, pLinkSup->name, &pdbbase->linkList);
if (!pgphentry) {
yyerrorAbort("gphAdd failed");
}
}
pgphentry->userPvt = pLinkSup;
ellAdd(&pdbbase->linkList, &pLinkSup->node);
}
@@ -850,7 +850,7 @@ static void dbRegistrar(char *name)
pgphentry = gphAdd(pdbbase->pgpHash,ptext->text,&pdbbase->registrarList);
if(!pgphentry) {
yyerrorAbort("gphAdd failed");
}
}
pgphentry->userPvt = ptext;
ellAdd(&pdbbase->registrarList,&ptext->node);
}
@@ -889,7 +889,7 @@ static void dbVariable(char *name, char *type)
pgphentry = gphAdd(pdbbase->pgpHash,pvar->name,&pdbbase->variableList);
if(!pgphentry) {
yyerrorAbort("gphAdd failed");
}
}
pgphentry->userPvt = pvar;
ellAdd(&pdbbase->variableList,&pvar->node);
}
@@ -948,11 +948,11 @@ static void dbBreakBody(void)
pnewbrkTable->paBrkInt = paBrkInt = dbCalloc(number, sizeof(brkInt));
for (i=0; i<number; i++) {
char *str;
str = (char *)popFirstTemp();
(void) epicsScanDouble(str, &paBrkInt[i].raw);
free(str);
str = (char *)popFirstTemp();
(void) epicsScanDouble(str, &paBrkInt[i].eng);
free(str);
@@ -1073,7 +1073,7 @@ static void dbRecordField(char *name,char *value)
pdbentry = ptempListNode->item;
status = dbFindField(pdbentry,name);
if(status) {
epicsPrintf("Record \"%s\" does not have a field \"%s\"\n",
epicsPrintf("Record \"%s\" does not have a field \"%s\"\n",
dbGetRecordName(pdbentry), name);
yyerror(NULL);
return;

View File

@@ -51,8 +51,11 @@ static char *pNullString = "";
#define messagesize 276
#define RPCL_LEN INFIX_TO_POSTFIX_SIZE(80)
/* must be long enough to hold 32-bit signed integer in base 10 */
STATIC_ASSERT(messagesize>=11);
/* Must be big enough to hold a 64-bit integer in base 10, but in
* the future when fields hold large JSON objects this fixed size
* allocation will probably have to become variable sized.
*/
STATIC_ASSERT(messagesize >= 21);
static char *ppstring[5]={" NPP"," PP"," CA"," CP"," CPP"};
static char *msstring[4]={" NMS"," MS"," MSI"," MSS"};
@@ -208,11 +211,13 @@ static void zeroDbentry(DBENTRY *pdbentry)
static char *getpMessage(DBENTRY *pdbentry)
{
char *msg = pdbentry->message;
if (!msg) {
msg = dbCalloc(1, messagesize);
pdbentry->message = msg;
}
*msg = '\0';
else
*msg = '\0';
return msg;
}
@@ -224,6 +229,17 @@ void dbMsgCpy(DBENTRY *pdbentry, const char *msg)
pdbentry->message[messagesize-1] = '\0';
}
static
void dbMsgNCpy(DBENTRY *pdbentry, const char *msg, size_t len)
{
getpMessage(pdbentry);
if (len >= messagesize)
len = messagesize-1; /* FIXME: Quietly truncates */
strncpy(pdbentry->message, msg, len);
pdbentry->message[len] = '\0';
}
static
void dbMsgPrint(DBENTRY *pdbentry, const char *fmt, ...)
{
@@ -879,10 +895,14 @@ long dbWriteRecordFP(
status=dbNextField(pdbentry,dctonly);
}
status = dbFirstInfo(pdbentry);
while(!status) {
fprintf(fp,"\tinfo(\"%s\",\"%s\")\n",
dbGetInfoName(pdbentry), dbGetInfoString(pdbentry));
status=dbNextInfo(pdbentry);
while (!status) {
const char *pinfostr = dbGetInfoString(pdbentry);
fprintf(fp, "\tinfo(\"%s\",\"",
dbGetInfoName(pdbentry));
epicsStrPrintEscaped(fp, pinfostr, strlen(pinfostr));
fprintf(fp, "\")\n");
status = dbNextInfo(pdbentry);
}
fprintf(fp,"}\n");
status = dbNextRecord(pdbentry);
@@ -1674,21 +1694,27 @@ int dbIsVisibleRecord(DBENTRY *pdbentry)
long dbCreateAlias(DBENTRY *pdbentry, const char *alias)
{
dbRecordType *precordType = pdbentry->precordType;
dbRecordNode *precnode = pdbentry->precnode;
dbRecordNode *pnewnode;
PVDENTRY *ppvd;
ELLLIST *preclist = NULL;
if (!precordType) return S_dbLib_recordTypeNotFound;
dbRecordType *precordType = pdbentry->precordType;
dbRecordNode *precnode = pdbentry->precnode;
dbRecordNode *pnewnode;
DBENTRY tempEntry;
PVDENTRY *ppvd;
if (!precordType)
return S_dbLib_recordTypeNotFound;
/* alias of alias still references actual record */
while(precnode && (precnode->flags&DBRN_FLAGS_ISALIAS))
while (precnode && (precnode->flags & DBRN_FLAGS_ISALIAS))
precnode = precnode->aliasedRecnode;
if (!precnode) return S_dbLib_recNotFound;
zeroDbentry(pdbentry);
if (!dbFindRecord(pdbentry, alias)) return S_dbLib_recExists;
zeroDbentry(pdbentry);
pdbentry->precordType = precordType;
preclist = &precordType->recList;
if (!precnode)
return S_dbLib_recNotFound;
dbInitEntry(pdbentry->pdbbase, &tempEntry);
if (!dbFindRecord(&tempEntry, alias))
return S_dbLib_recExists;
dbFinishEntry(&tempEntry);
pnewnode = dbCalloc(1, sizeof(dbRecordNode));
pnewnode->recordname = epicsStrDup(alias);
pnewnode->precord = precnode->precord;
@@ -1696,11 +1722,16 @@ long dbCreateAlias(DBENTRY *pdbentry, const char *alias)
pnewnode->flags = DBRN_FLAGS_ISALIAS;
precnode->flags |= DBRN_FLAGS_HASALIAS;
ellInit(&pnewnode->infoList);
ellAdd(preclist, &pnewnode->node);
ellAdd(&precordType->recList, &pnewnode->node);
precordType->no_aliases++;
pdbentry->precnode = pnewnode;
ppvd = dbPvdAdd(pdbentry->pdbbase, precordType, pnewnode);
if (!ppvd) {errMessage(-1,"Logic Err: Could not add to PVD");return(-1);}
if (!ppvd) {
errMessage(-1, "dbCreateAlias: Add to PVD failed");
return -1;
}
return 0;
}
@@ -1884,7 +1915,8 @@ char * dbGetString(DBENTRY *pdbentry)
switch (pflddes->field_type) {
case DBF_STRING:
dbMsgCpy(pdbentry, (char *)pfield);
/* Protect against a missing nil-terminator */
dbMsgNCpy(pdbentry, (char *)pfield, pflddes->size);
break;
case DBF_CHAR:
case DBF_UCHAR:
@@ -1907,6 +1939,8 @@ char * dbGetString(DBENTRY *pdbentry)
case CONSTANT:
if (plink->value.constantStr) {
dbMsgCpy(pdbentry, plink->value.constantStr);
} else if (plink->text) {
dbMsgCpy(pdbentry, plink->text);
} else {
dbMsgCpy(pdbentry, "");
}
@@ -2007,7 +2041,13 @@ char * dbGetString(DBENTRY *pdbentry)
switch(plink->type) {
case CONSTANT:
dbMsgCpy(pdbentry, "0");
if (plink->value.constantStr) {
dbMsgCpy(pdbentry, plink->value.constantStr);
} else if (plink->text) {
dbMsgCpy(pdbentry, plink->text);
} else {
dbMsgCpy(pdbentry, "");
}
break;
case MACRO_LINK:
if (plink->value.macro_link.macroStr) {

View File

@@ -17,9 +17,6 @@
#define epicsExportSharedSymbols
#include "epicsRelease.h"
static const char id[] EPICS_UNUSED =
"@(#) " EPICS_VERSION_STRING ", Misc. Utilities Library" __DATE__;
epicsShareFunc int coreRelease(void)
{
printf ( "############################################################################\n" );

View File

@@ -45,7 +45,6 @@ void rsrv_online_notify_task(void *pParm)
caHdr msg;
int status;
ca_uint32_t beaconCounter = 0;
char buf[16];
taskwdInsert (epicsThreadGetIdSelf(),NULL,NULL);
@@ -85,10 +84,12 @@ void rsrv_online_notify_task(void *pParm)
&pAddr->addr.sa, sizeof(pAddr->addr));
if (status < 0) {
char sockErrBuf[64];
epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) );
ipAddrToDottedIP (&pAddr->addr.ia, buf, sizeof(buf));
char sockDipBuf[22];
epicsSocketConvertErrnoToString(sockErrBuf, sizeof(sockErrBuf));
ipAddrToDottedIP(&pAddr->addr.ia, sockDipBuf, sizeof(sockDipBuf));
errlogPrintf ( "CAS: CA beacon send to %s error: %s\n",
buf, sockErrBuf);
sockDipBuf, sockErrBuf);
}
else {
assert (status == sizeof(msg));

View File

@@ -96,6 +96,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
{
struct stringinRecord *prec = (struct stringinRecord *)pcommon;
STATIC_ASSERT(sizeof(prec->oval)==sizeof(prec->val));
STATIC_ASSERT(sizeof(prec->sval)==sizeof(prec->val));
struct stringindset *pdset = (struct stringindset *) prec->dset;
if (pass == 0) return 0;
@@ -120,7 +121,8 @@ static long init_record(struct dbCommon *pcommon, int pass)
if (status)
return status;
}
strcpy(prec->oval, prec->val);
strncpy(prec->oval, prec->val, sizeof(prec->val));
return 0;
}
@@ -213,7 +215,7 @@ static long readValue(stringinRecord *prec)
if (prec->pact || (prec->sdly < 0.)) {
status = dbGetLink(&prec->siol, DBR_STRING, prec->sval, 0, 0);
if (status == 0) {
strcpy(prec->val, prec->sval);
strncpy(prec->val, prec->sval, sizeof(prec->val));
prec->udf = FALSE;
}
prec->pact = FALSE;

View File

@@ -98,6 +98,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
{
struct stringoutRecord *prec = (struct stringoutRecord *)pcommon;
STATIC_ASSERT(sizeof(prec->oval)==sizeof(prec->val));
STATIC_ASSERT(sizeof(prec->ivov)==sizeof(prec->val));
struct stringoutdset *pdset = (struct stringoutdset *) prec->dset;
if (pass == 0) return 0;
@@ -126,7 +127,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
return status;
}
strcpy(prec->oval, prec->val);
strncpy(prec->oval, prec->val, sizeof(prec->val));
return 0;
}
@@ -165,7 +166,7 @@ static long process(struct dbCommon *pcommon)
break;
case (menuIvoaSet_output_to_IVOV) :
if(prec->pact == FALSE){
strcpy(prec->val,prec->ivov);
strncpy(prec->val, prec->ivov, sizeof(prec->val));
}
status=writeValue(prec); /* write the new value */
break;

View File

@@ -34,6 +34,8 @@
*
* Two time intervals are measured. The time to queue and run each of
* the immediate callbacks, and the actual delay of the delayed callback.
*
* Slow callbacks no longer fail the test, they just emit a diagnostic.
*/
#define NCALLBACKS 169
@@ -108,7 +110,7 @@ MAIN(callbackParallelTest)
for (j = 0; j < 5; j++)
setupError[i][j] = timeError[i][j] = defaultError[j];
testPlan(4);
testPlan(2);
testDiag("Starting %d parallel callback threads", noCpus);
@@ -165,7 +167,8 @@ MAIN(callbackParallelTest)
}
}
testOk(faults == 0, "%d faults during callback setup", faults);
testOk(slowups <= 1, "%d slowups during callback setup", slowups);
if (slowups)
testDiag("%d slowups during callback setup", slowups);
slowups = 0;
for (i = 0; i < NCALLBACKS ; i++) {
@@ -182,7 +185,8 @@ MAIN(callbackParallelTest)
}
updateStats(timeError[i%NUM_CALLBACK_PRIORITIES], error);
}
testOk(slowups < 5, "%d slowups during callbacks", slowups);
if (slowups)
testDiag("%d slowups during callback setup", slowups);
testDiag("Setup time statistics");
printStats(setupError[0], "LOW");

View File

@@ -34,6 +34,8 @@
*
* Two time intervals are measured. The time to queue and run each of
* the immediate callbacks, and the actual delay of the delayed callback.
*
* Slow callbacks no longer fail the test, they just emit a diagnostic.
*/
#define NCALLBACKS 169
@@ -108,7 +110,7 @@ MAIN(callbackTest)
for (j = 0; j < 5; j++)
setupError[i][j] = timeError[i][j] = defaultError[j];
testPlan(4);
testPlan(2);
callbackInit();
epicsThreadSleep(1.0);
@@ -162,7 +164,8 @@ MAIN(callbackTest)
}
}
testOk(faults == 0, "%d faults during callback setup", faults);
testOk(slowups <= 1, "%d slowups during callback setup", slowups);
if (slowups)
testDiag("%d slowups during callback setup", slowups);
slowups = 0;
for (i = 0; i < NCALLBACKS ; i++) {
@@ -179,7 +182,8 @@ MAIN(callbackTest)
}
updateStats(timeError[i%NUM_CALLBACK_PRIORITIES], error);
}
testOk(slowups < 5, "%d slowups during callbacks", slowups);
if (slowups)
testDiag("%d slowups during callback setup", slowups);
testDiag("Setup time statistics");
printStats(setupError[0], "LOW");

View File

@@ -38,7 +38,7 @@ static void testBasicGet(void)
getter(&addr, scratch, 1, s_input_len, 0);
testOk1(scratch[0]==s_input[0]);
testOk1(scratch[0]==s_input[0] && scratch[1]==0);
memset(scratch, 0x42, sizeof(s_input));
}
@@ -128,7 +128,7 @@ static void testBasicPut(void)
putter(&addr, s_input, 1, s_input_len, 0);
testOk1(scratch[0]==s_input[0]);
testOk1(scratch[0]==s_input[0] && scratch[1]==0);
memset(scratch, 0x42, sizeof(s_input));
}

View File

@@ -97,6 +97,7 @@ TESTFILES += $(COMMON_DIR)/analogMonitorTest.dbd ../analogMonitorTest.db
TESTS += analogMonitorTest
TARGETS += $(COMMON_DIR)/regressTest.dbd
DBDDEPENDS_FILES += regressTest.dbd$(DEP)
regressTest_DBD += base.dbd
TESTPROD_HOST += regressTest
regressTest_SRCS += regressTest.c

View File

@@ -109,11 +109,7 @@ static void hookPass0(initHookState state)
else
testFail("Wrong link type: %d", (int)prec->out.type);
/* note that dbGetString() reads an empty string before links are initialized
* should probably be considered a bug, but has been the case for so long
* we call it a 'feature'.
*/
checkGetString(&entry, "");
checkGetString(&entry, "rec0.DISV");
testOk1(dbPutString(&entry, "rec0.SEVR")==0);
} else{

View File

@@ -11,6 +11,8 @@
#include "dbStaticLib.h"
#include "dbTest.h"
#include "dbUnitTest.h"
#include "epicsThread.h"
#include "epicsEvent.h"
#include "errlog.h"
#include "registryFunction.h"
#include "subRecord.h"
@@ -39,10 +41,10 @@ void doProcess(const char *rec)
testdbPutFieldOk(proc, DBR_CHAR, 1);
}
/* Group 0 are all soft-channel input records with INP being a DB link
/* Group 0 are soft-channel input records with INP being a DB or CA link
* to the PV 'source'. Their VAL fields all start out with the default
* value for the type, i.e. 0 or an empty string. Triggering record
* processing should read the integer value from the 'source' PV.
* processing reads the value from the 'source' PV.
*/
static
@@ -50,14 +52,22 @@ void testGroup0(void)
{
const char ** rec;
const char * records[] = {
"ai0", "bi0", "di0", "ii0", "li0", "lsi0", "mi0", "si0", NULL
"ai0", "bi0", "di0", "ii0", "li0", "lsi0", "mi0", "si0",
"ai0c", "bi0c", "di0c", "ii0c", "li0c", "lsi0c", "mi0c", "si0c",
NULL
};
testDiag("============ Starting %s ============", EPICS_FUNCTION);
testdbPutFieldOk("source", DBR_LONG, 1);
/* The above put sends CA monitors to all of the CA links, but
* doesn't trigger record processing (the links are not CP/CPP).
* How could we wait until all of those monitors have arrived,
* instead of just waiting for an arbitrary time period?
*/
epicsThreadSleep(1.0); /* FIXME: Wait here? */
for (rec = records; *rec; rec++) {
if (strcmp(*rec, "lsi0") != 0)
if (strncmp(*rec, "lsi0", 4) != 0)
testdbGetFieldEqual(*rec, DBR_LONG, 0);
checkDtyp(*rec);
doProcess(*rec);
@@ -65,6 +75,7 @@ void testGroup0(void)
}
testdbPutFieldOk("source", DBR_LONG, 0);
epicsThreadSleep(1.0); /* FIXME: Wait here as above */
for (rec = records; *rec; rec++) {
doProcess(*rec);
testdbGetFieldEqual(*rec, DBR_LONG, 0);
@@ -124,49 +135,70 @@ void testGroup2(void)
int dest;
epicsEventId destEvent;
static
long destSubr(subRecord *prec)
{
dest = prec->val;
prec->val = -1;
epicsEventMustTrigger(destEvent);
return 0;
}
static
void checkOutput(const char *rec, int value)
void checkOutput3(const char *rec, int value)
{
testDiag("Checking record '%s'", rec);
testdbPutFieldOk(rec, DBR_LONG, value);
epicsEventMustWait(destEvent);
testOk(dest == value, "value %d output -> %d", value, dest);
}
/* Group 3 are all soft-channel output records with OUT being a DB link
* to the PV 'dest' with PP. Putting a value to the record writes that
* value to 'dest' and processes it.
/* Group 3 are all soft-channel output records with OUT being a DB or
* local CA link to the subRecord 'dest'; DB links have the PP flag,
* for CA links the VAL field is marked PP. Putting a value to the
* output record writes that value to 'dest'.
*/
static
void testGroup3(void)
{
const char ** rec;
const char * records[] = {
"ao0", "bo0", "io0", "lo0", "lso0", "mo0", "so0", NULL,
"ao3", "bo3", "io3", "lo3", "lso3", "mo3", "so3",
"ao3c", "bo3c", "io3c", "lo3c", "lso3c", "mo3c", "so3c",
NULL,
};
destEvent = epicsEventMustCreate(epicsEventEmpty);
testDiag("============ Starting %s ============", EPICS_FUNCTION);
for (rec = records; *rec; rec++) {
checkOutput(*rec, 1);
checkOutput3(*rec, 1);
checkDtyp(*rec);
}
checkOutput("do0.B0", 1);
checkDtyp("do0");
checkOutput3("do3.B0", 1);
checkDtyp("do3");
checkOutput3("do3c.B0", 1);
checkDtyp("do3c");
for (rec = records; *rec; rec++) {
checkOutput(*rec, 0);
checkOutput3(*rec, 0);
}
checkOutput("do0.B0", 0);
checkOutput3("do3.B0", 0);
checkOutput3("do3c.B0", 0);
}
static
void checkOutput4(const char *rec, int value)
{
testDiag("Checking record '%s'", rec);
testdbPutFieldOk(rec, DBR_LONG, value);
}
/* Group 4 are all soft-channel output records with OUT being empty
@@ -177,21 +209,22 @@ void testGroup4(void)
{
const char ** rec;
const char * records[] = {
"ao1", "bo1", "do1.B0", "io1", "lo1", "lso1", "mo1", "so1", NULL,
"ao4", "bo4", "do4.B0", "io4", "lo4", "lso4", "mo4", "so4", NULL,
};
testDiag("============ Starting %s ============", EPICS_FUNCTION);
for (rec = records; *rec; rec++) {
checkOutput(*rec, 0);
checkOutput4(*rec, 0);
}
}
void recTestIoc_registerRecordDeviceDriver(struct dbBase *);
MAIN(softTest)
{
testPlan(163);
testPlan(258);
testdbPrepare();
testdbReadDatabase("recTestIoc.dbd", NULL, NULL);

View File

@@ -59,6 +59,60 @@ record(stringin, "si0") {
field(INP, "source")
}
record(ai, "ai0c") {
field(DTYP, "Soft Channel")
field(INP, "source CA")
}
record(bi, "bi0c") {
field(DTYP, "Soft Channel")
field(INP, "source CA")
field(ZNAM, "Zero")
field(ONAM, "One")
}
record(int64in, "ii0c") {
field(DTYP, "Soft Channel")
field(INP, "source CA")
}
record(longin, "li0c") {
field(DTYP, "Soft Channel")
field(INP, "source CA")
}
record(mbbiDirect, "di0c") {
field(DTYP, "Soft Channel")
field(NOBT, 4)
field(INP, "source CA")
}
record(mbbi, "mi0c") {
field(DTYP, "Soft Channel")
field(NOBT, 4)
field(INP, "source CA")
field(ZRST, "Zero")
field(ONST, "One")
field(TWST, "Two")
field(THST, "Three")
field(FRST, "Four")
field(FVST, "Five")
field(SXST, "Six")
field(SVST, "Seven")
field(EIST, "Eight")
field(NIST, "Nine")
field(TEST, "Ten")
field(ELST, "Eleven")
field(TWST, "Twelve")
field(TTST, "Thirteen")
field(FTST, "Fourteen")
field(FFST, "Fifteen")
}
record(lsi, "lsi0c") {
field(DTYP, "Soft Channel")
field(SIZV, 40)
field(INP, "source CA")
}
record(stringin, "si0c") {
field(DTYP, "Soft Channel")
field(INP, "source CA")
}
# Group 1 are all soft-channel input records with INP being a non-zero
# "const" JSON-link, 9 for most records, 1 for the binary. Their VAL
@@ -171,38 +225,39 @@ record(mbbi, "mi2") {
}
# Group 3 are all soft-channel output records with OUT being a DB link
# to the PV 'dest' with PP. Putting a value to the record writes that
# value to 'dest' and processes it.
# Group 3 are all soft-channel output records with OUT being a DB or
# CA link to the PV 'dest' with PP. Putting a value to the record
# under test writes the value to 'dest' and processes it.
record(sub, "dest") {
field(SNAM, "destSubr")
field(VAL, -1)
}
record(ao, "ao0") {
record(ao, "ao3") {
field(DTYP, "Soft Channel")
field(OUT, "dest PP")
}
record(bo, "bo0") {
record(bo, "bo3") {
field(DTYP, "Soft Channel")
field(OUT, "dest PP")
field(ZNAM, "Zero")
field(ONAM, "One")
}
record(int64out, "io0") {
record(int64out, "io3") {
field(DTYP, "Soft Channel")
field(OUT, "dest PP")
}
record(longout, "lo0") {
record(longout, "lo3") {
field(DTYP, "Soft Channel")
field(OUT, "dest PP")
}
record(mbboDirect, "do0") {
record(mbboDirect, "do3") {
field(DTYP, "Soft Channel")
field(NOBT, 4)
field(OUT, "dest PP")
}
record(mbbo, "mo0") {
record(mbbo, "mo3") {
field(DTYP, "Soft Channel")
field(NOBT, 4)
field(OUT, "dest PP")
@@ -223,39 +278,93 @@ record(mbbo, "mo0") {
field(FTST, "Fourteen")
field(FFST, "Fifteen")
}
record(lso, "lso0") {
record(lso, "lso3") {
field(DTYP, "Soft Channel")
field(OUT, "dest PP")
field(SIZV, 40)
}
record(stringout, "so0") {
record(stringout, "so3") {
field(DTYP, "Soft Channel")
field(OUT, "dest PP")
}
record(ao, "ao3c") {
field(DTYP, "Soft Channel")
field(OUT, "dest CA")
}
record(bo, "bo3c") {
field(DTYP, "Soft Channel")
field(OUT, "dest CA")
field(ZNAM, "Zero")
field(ONAM, "One")
}
record(int64out, "io3c") {
field(DTYP, "Soft Channel")
field(OUT, "dest CA")
}
record(longout, "lo3c") {
field(DTYP, "Soft Channel")
field(OUT, "dest CA")
}
record(mbboDirect, "do3c") {
field(DTYP, "Soft Channel")
field(NOBT, 4)
field(OUT, "dest CA")
}
record(mbbo, "mo3c") {
field(DTYP, "Soft Channel")
field(NOBT, 4)
field(OUT, "dest CA")
field(ZRST, "Zero")
field(ONST, "One")
field(TWST, "Two")
field(THST, "Three")
field(FRST, "Four")
field(FVST, "Five")
field(SXST, "Six")
field(SVST, "Seven")
field(EIST, "Eight")
field(NIST, "Nine")
field(TEST, "Ten")
field(ELST, "Eleven")
field(TWST, "Twelve")
field(TTST, "Thirteen")
field(FTST, "Fourteen")
field(FFST, "Fifteen")
}
record(lso, "lso3c") {
field(DTYP, "Soft Channel")
field(OUT, "dest CA")
field(SIZV, 40)
}
record(stringout, "so3c") {
field(DTYP, "Soft Channel")
field(OUT, "dest CA")
}
# Group 4 are all soft-channel output records with OUT being empty
# (i.e. a CONSTANT link). Putting a value to the record must succeed.
record(ao, "ao1") {
record(ao, "ao4") {
field(DTYP, "Soft Channel")
}
record(bo, "bo1") {
record(bo, "bo4") {
field(DTYP, "Soft Channel")
field(ZNAM, "Zero")
field(ONAM, "One")
}
record(int64out, "io1") {
record(int64out, "io4") {
field(DTYP, "Soft Channel")
}
record(longout, "lo1") {
record(longout, "lo4") {
field(DTYP, "Soft Channel")
}
record(mbboDirect, "do1") {
record(mbboDirect, "do4") {
field(DTYP, "Soft Channel")
field(NOBT, 4)
}
record(mbbo, "mo1") {
record(mbbo, "mo4") {
field(DTYP, "Soft Channel")
field(NOBT, 4)
field(ZRST, "Zero")
@@ -275,10 +384,10 @@ record(mbbo, "mo1") {
field(FTST, "Fourteen")
field(FFST, "Fifteen")
}
record(lso, "lso1") {
record(lso, "lso4") {
field(DTYP, "Soft Channel")
field(SIZV, 40)
}
record(stringout, "so1") {
record(stringout, "so4") {
field(DTYP, "Soft Channel")
}