Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019 
<== Date ==> <== Thread ==>

Subject: ASYN 4-19 createParam return status
From: Hinko Kocevar <hinko.kocevar@i-tech.si>
To: EPICS Tech Talk <tech-talk@aps.anl.gov>
Date: Tue, 05 Jun 2012 09:18:54 +0200
Hi,

I've found a potential problem in the Asyn 4-19 (I think that 4-18 has the same problem) when calling createParam() with the existing parameter string (already in the list).

The return value of findParam() and createParam() in asynPortDriver::createParam() is not tested properly and error is never caught. I believe that the call to findParam() can be omitted. Only call to createParam() is needed and return status compared with asynParamBadIndex and asynParamAlreadyExists afterwards.

Here is the patch.


### Eclipse Workspace Patch 1.0
#P kofein-epics-ioc
Index: 3rdParty/extensions/src/asyn4-19/asyn/asynPortDriver/asynPortDriver.cpp
===================================================================
--- 3rdParty/extensions/src/asyn4-19/asyn/asynPortDriver/asynPortDriver.cpp (revision 16365) +++ 3rdParty/extensions/src/asyn4-19/asyn/asynPortDriver/asynPortDriver.cpp (working copy)
@@ -99,17 +99,15 @@
asynStatus asynPortDriver::createParam(int list, const char *name, asynParamType type, int *index)
 {
     asynStatus status;
-    int itemp;
     static const char *functionName = "createParam";

-    status = this->params[list]->findParam(name, &itemp);
+    status = this->params[list]->createParam(name, type, index);
     if (status == asynParamAlreadyExists) {
         asynPrint(this->pasynUserSelf, ASYN_TRACE_ERROR,
"%s:%s: port=%s error adding parameter %s to list %d, parameter already exists.\n",
             driverName, functionName, portName, name, list);
         return(asynError);
     }
-    status = this->params[list]->createParam(name, type, index);
     if (status == asynParamBadIndex) {
         asynPrint(this->pasynUserSelf, ASYN_TRACE_ERROR,
"%s:%s: port=%s error adding parameter %s to list %d, too many parameters\n",




Best regards,
Hinko
--
Hinko Kocevar
Software development engineer
Instrumentation Technologies d.d.
Velika pot 22, SI-5250 Solkan - Slovenia
T:+386 5 3352600, F:+386 5 3352601
E-mail: hinko.kocevar@i-tech.si

http://www.i-tech.si - When your users demand stability

Replies:
RE: ASYN 4-19 createParam return status Mark Rivers

Navigate by Date:
Prev: Re: [StreamDevice] ? Pavel Masloff
Next: mask for bitwise operation in CALC record haquin
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019 
Navigate by Thread:
Prev: Re: counter of clients for specific PV in IOC Andrew Johnson
Next: RE: ASYN 4-19 createParam return status Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·