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

Subject: Re: recordGenerator record
From: Dirk Zimoch <[email protected]>
To: Andrew Johnson <[email protected]>, Kalantari Babak <[email protected]>
Cc: [email protected]
Date: Mon, 27 Oct 2008 15:48:00 +0100
Andrew Johnson wrote:

Unfortunately there are major problems with doing this in a running IOC: we don't have locks in all the database structures that need to be modified when a new record instance is created, which makes this a precarious activity. The current dbStaticLib design assumes that all record creation happens while the IOC is running single-threaded before initialization of any scan or server threads. For example, the pdbbase->ppvd structure which is a hash table of all the record instances has no locks, so one or more server threads could be searching for PV names in the hash bucket linked list that your new record instance gets added to.

Looking at the code in base/src/dbStatic/dbPvdLib.c I can see several ways that simultaneous calls to dbPvdFind() and dbPvdAdd() in different threads could cause a segfault, because this code has not been written with that possibility in mind.

It might be possible to make this thread-safe by disabling interrupts before calling dbPvdAdd().


Dirk

--
Dr. Dirk Zimoch
Paul Scherrer Institut, WBGB/006
5232 Villigen PSI, Switzerland
Phone +41 56 310 5182

Replies:
Re: recordGenerator record Andrew Johnson
References:
recordGenerator record Kalantari Babak
Re: recordGenerator record Andrew Johnson

Navigate by Date:
Prev: CAJ 1.1.5 and JCA 2.3.2 released Matej Sekoranja
Next: Re: recordGenerator record Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: recordGenerator record Andrew Johnson
Next: Re: recordGenerator record Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·