EPICS Controls 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  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Race condition in db_get_field_and_count() (3.14.12)
From: Till Straumann <[email protected]>
To: [email protected]
Date: Tue, 10 May 2016 19:18:43 -0700
Still present on 3.15 and 3.16 branches/heads

On 05/10/2016 07:10 PM, Till Straumann wrote:
Dehong reported the following bug:

In order to convert between legacy and more 'modern' representation of
data with at least DBR_STATUS auxiliary information

db_access.c: db_get_field_and_count()

calls dbGetField() twice; a first time to retrieve the auxiliary information
(status, timestamps, ...) and a second time to fetch data.

Since the underlying record is not locked across the two calls to dbGetField()
the record could be processed in between and render the auxiliary data
invalid/obsolete.

Proposed fix:

AFAIK, dbScanLock() supports recursion and therefore the easiest
fix would be acquiring the record lock within db_get_field_and_count()

RFC
- Till

PS: the bug seems to still be present in the 3.14 branch head


References:
Race condition in db_get_field_and_count() (3.14.12) Till Straumann

Navigate by Date:
Prev: Race condition in db_get_field_and_count() (3.14.12) Till Straumann
Next: Re: Reg programming in EPICS environment for master slave control Himanshu Tyagi
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Race condition in db_get_field_and_count() (3.14.12) Till Straumann
Next: Race condition in db_get_field_and_count() (3.14.12) Williams Jr., Ernest L.
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 11 Aug 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·