EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: a race condition between rsrv_init() and casStatsFetch()
From: "Kim, Kukhee via Core-talk" <[email protected]>
To: Michael Davidsaver <[email protected]>
Cc: EPICS Core-Talk <[email protected]>
Date: Thu, 19 Sep 2019 01:41:03 +0000
Hi Michael,

You are right. 
It is a false alarm. A guard code has been added before calling casStatsFetch().

Somehow, we are using way behind one in SLAC.

Thank you
Best regards,
Kukhee

Kukhee Kim

TID AIR Advanced Control System

SLAC National Accelerator Laboratory

2575 Sand Hill Rd, MS 94

Menlo Park, CA 94025

Email: [email protected]

Phone: (650)926-4912

Fax:   (650)926-2923


From: Michael Davidsaver <[email protected]>
Sent: Wednesday, September 18, 2019 5:52 PM
To: Kim, Kukhee <[email protected]>
Cc: EPICS Core-Talk <[email protected]>
Subject: Re: a race condition between rsrv_init() and casStatsFetch()
 
Is this issue distinct from what was fixed with https://github.com/epics-modules/iocStats/pull/21

On Wed, Sep 18, 2019, 4:14 PM Kim, Kukhee via Core-talk <[email protected]> wrote:
Hi Everyone,

Some of our colleagues in SLAC found a race condition between rsrv_init() and casStatsFetch() during starting iocs. iocAdmin calls casStatsFetch() periodically to get CA statistics. The casStatsFetch relies on a global mutex clientQlock which is created by rsrv_init(). 

We found that the casStatsFetch is called before the rsrv_init is completed during iocs start, sometimes.

We would like to add the following code into veery first part of casStatsFetch function as a protection to avoid trouble.

if(!clientQlock) {
    return;
}

One of function in caservertask.c, casr() has the protection as above, but the casStatsFetch does not have it.
I think epics 3.15, 3.16, and epics 7 all of them have the same potential issue.

Thank you for your concern.
Best regards,
Kukhee

Kukhee Kim

TID AIR Advanced Control System

SLAC National Accelerator Laboratory

2575 Sand Hill Rd, MS 94

Menlo Park, CA 94025

Email: [email protected]

Phone: (650)926-4912

Fax:   (650)926-2923


References:
a race condition between rsrv_init() and casStatsFetch() Kim, Kukhee via Core-talk
Re: a race condition between rsrv_init() and casStatsFetch() Michael Davidsaver via Core-talk

Navigate by Date:
Prev: Build failed: EPICS Base base-3.15-456 AppVeyor via Core-talk
Next: Re: [Merge] ~dirk.zimoch/epics-base:iocLogClientFixesTry2 into epics-base:7.0 Dirk Zimoch via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: a race condition between rsrv_init() and casStatsFetch() Michael Davidsaver via Core-talk
Next: Build failed: EPICS Base base-3.15-456 AppVeyor via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
ANJ, 19 Sep 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·