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  2012  <20132014  2015  2016  2017  2018  2019  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019 
<== Date ==> <== Thread ==>

Subject: Re: Macros limited (edition ;-)
From: Andrew Johnson <anj@aps.anl.gov>
To: tech-talk@aps.anl.gov
Cc: Touchard Dominique <dominique.touchard@ganil.fr>
Date: Fri, 5 Jul 2013 10:39:43 -0500
Hi Dominique,

On 2013-07-05 Dominique Touchard wrote:
> It seems that the number of macros for template substitutions during IOC
> startup is limited to 100. Over, a segmentation fault stop the IOCs.
> 
> Is this number correct? Is there any reason?

I was surprised but you're right, src/dbtools/dbLoadTemplate.y defines 
VAR_MAX_VARS as 100 which sets a limit to the number of variables that 
dbLoadTemplate() can handle.  It also defines VAR_MAX_VAR_STRING as 5000 
setting the maximum size of the "variable=value,..." string which it 
constructs to pass to dbLoadRecords().  In neither case though does it check 
when the storage limit set by those macros gets exceeded, thus causing a 
crash.  This is obviously unacceptable and needs to be fixed in Base.

To get around this limit for a particular application you could do the 
template expansion on the host at build time using the msi (Macro 
Substitution and Include) program which is distributed as an EPICS extension.  
You can also increase the above values in your source code and rebuild base, 
which might be a simpler fix in some circumstances.

I have filed a bug-report for this issue.  If someone feels inclined to look 
at rewriting the dbLoadTemplate() code to remove these limitations please let 
me know.
    https://bugs.launchpad.net/epics-base/+bug/1198234

- Andrew
-- 
Advertising may be described as the science of arresting the human
intelligence long enough to get money from it. -- Stephen Leacock

References:
Macros limited (edition ;-) Touchard Dominique

Navigate by Date:
Prev: Re: Reading binary file from sscan saveData Hovanes Egiyan
Next: Re: Development with EPICS and CSS marcus . michalsky
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019 
Navigate by Thread:
Prev: Macros limited (edition ;-) Touchard Dominique
Next: Development with EPICS and CSS Ganesh Jangir
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·