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

Subject: Re: caGateway crashes / use of *MustSucceed functions
From: Benjamin Franksen <benjamin.franksen@helmholtz-berlin.de>
To: <tech-talk@aps.anl.gov>
Date: Wed, 18 May 2011 14:51:22 +0200
On Wednesday, May 18, 2011, Dirk Zimoch wrote:
> I got several caGateway crashes with the error message:
> "errSymBld callocMustSucceed failed count 256 size 4"
> Obviously it has some memory problems.
>
> But is it really a good idea to abort a server only because of (probably
> temporary ?) resource problems? I think no.

I think we all agree on that!

> I would even go so far to
> say that the whole idea of the *MustSucceed functions is wrong. Many
> parts of EPICS are meant to run continuously as servers. Aborting the
> program when something goes wrong is probably the worst thing one can
> do. Thus I would consider any call of a *MustSucceed function during
> run-time a design flaw of the program.

Right.

> (It is probably a different
> question if this makes sense during startup.)

I am fairly sure that this is exactly what *MustSucceed was invented for.

> Therefore I propose to remove all *MustSucceed functions from future
> EPICS releases and allow and require proper error handling by the
> application.

The use of these functions during startup is legitimate. Using them during
run-time is an error. The error in this case seems to be in the function
errSymBld which should not use callocMustSucceed.

Obviously errSymBld is meant to be used only during startup. However, it
seems that the code in errSymLib.c does its initialization lazily, i.e. on
demand, i.e. delayed until the module is first used. This means it can
happen at run-time, which is what you observed. There is clearly a
contradiction here.

Newer versions of base (e.g. 3.14.12) try to fix the problem by calling
errSymBld explicitly during initialization, for instance in errlog.c in
function errlogInitPvt. I think this is the wrong fix: a module should
either do lazy initialization, in which case it must not use *Must*, or else
initialization must not be lazy.

Cheers
Ben

________________________________

Helmholtz-Zentrum Berlin für Materialien und Energie GmbH

Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V.

Aufsichtsrat: Vorsitzender Prof. Dr. Dr. h.c. mult. Joachim Treusch, stv. Vorsitzende Dr. Beatrix Vierkorn-Rudolph
Geschäftsführer: Prof. Dr. Anke Rita Kaysser-Pyzalla, Prof. Dr. Dr. h.c. Wolfgang Eberhardt, Dr. Ulrich Breuer

Sitz Berlin, AG Charlottenburg, 89 HRB 5583

Postadresse:
Hahn-Meitner-Platz 1
D-14109 Berlin

http://www.helmholtz-berlin.de


Replies:
Re: caGateway crashes / use of *MustSucceed functions Michael Davidsaver
References:
caGateway crashes / use of *MustSucceed functions Dirk Zimoch

Navigate by Date:
Prev: caGateway crashes / use of *MustSucceed functions Dirk Zimoch
Next: Re: caGateway crashes / use of *MustSucceed functions Michael Davidsaver
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019 
Navigate by Thread:
Prev: caGateway crashes / use of *MustSucceed functions Dirk Zimoch
Next: Re: caGateway crashes / use of *MustSucceed functions Michael Davidsaver
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  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 ·