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: RE: ASYN 4-19 createParam return status
From: Mark Rivers <rivers@cars.uchicago.edu>
To: Hinko Kocevar <hinko.kocevar@i-tech.si>, EPICS Tech Talk <tech-talk@aps.anl.gov>
Date: Fri, 8 Jun 2012 18:27:44 +0000
Hi Hinko,

Thanks for finding this problem.  I have applied the patch, which will be in the next release of asyn.

Mark


________________________________________
From: tech-talk-bounces@aps.anl.gov [tech-talk-bounces@aps.anl.gov] on behalf of Hinko Kocevar [hinko.kocevar@i-tech.si]
Sent: Tuesday, June 05, 2012 2:18 AM
To: EPICS Tech Talk
Subject: ASYN 4-19 createParam return status

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

References:
ASYN 4-19 createParam return status Hinko Kocevar

Navigate by Date:
Prev: Re: VxWorks 6.8 & devIocStats Andrew Johnson
Next: Re: EPICS host architectures Andrew Johnson
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: ASYN 4-19 createParam return status Hinko Kocevar
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 
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 ·