Concurrency bug in channel access to local DB
Bug #541237 reported by
jahamilton
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
EPICS Base |
Fix Released
|
High
|
Jeff Hill |
Bug Description
dbContextReadNo
Additional information:
The bug is easily fixed by allocating and freeing this data buffer on each call.
Original Mantis Bug: mantis-192
http://
To post a comment you must log in.
I commited this fix
cvs diff: Diffing . ======= ======= ======= ======= ======= ======= ======= ======= ==== epicsmgr/ cvsroot/ epics/base/ src/db/ dbCAC.h, v vateListOfIO & operator = ( const dbContextPrivat eListOfIO & );
Index: dbCAC.h
=======
RCS file: /net/phoebus/
retrieving revision 1.39.2.5
diff -c -r1.39.2.5 dbCAC.h
*** dbCAC.h 23 Jan 2004 20:15:35 -0000 1.39.2.5
--- dbCAC.h 12 Apr 2005 16:38:59 -0000
***************
*** 126,145 ****
dbContextPri
};
! // allow only one thread at a time to use the cache, but do not hold tifyCache { ReadNotifyCache ( epicsMutex & ); otifyCache ();
cacReadNotify & notify ); Size; dNotifyCache ( const dbContextReadNo tifyCache & ); dNotifyCache & operator = ( const dbContextReadNo tifyCache & ); vateListOfIO & operator = ( const dbContextPrivat eListOfIO & );
! // lock when calling the callback
class dbContextReadNo
public:
dbContext
- ~dbContextReadN
void callReadNotify ( epicsGuard < epicsMutex > &,
struct dbAddr & addr, unsigned type, unsigned long count,
void show ( epicsGuard < epicsMutex > &, unsigned level ) const;
private:
! unsigned long readNotifyCache
! epicsMutex & mutex;
! char * pReadNotifyCache;
dbContextRea
dbContextRea
};
--- 126,159 ----
dbContextPri
};
! class dbContextReadNo tifyCacheAlloca tor { tifyCacheAlloca tor (); otifyCacheAlloc ator (); eSize; Entries (); tifyCacheAlloca tor ( const dbContextReadNo tifyCacheAlloca tor & ); tifyCacheAlloca tor & operator = ( const dbContextReadNo tifyCacheAlloca tor & ); tifyCache { ReadNotifyCache ( epicsMutex & );
cacReadNotify & notify ); tifyCacheAlloca tor _allocator; dNotifyCache ( const dbContextReadNo tifyCache & ); dNotifyCache & operator = ( const dbContextReadNo tifyCache & ); tifyCache. cpp ======= ======= ======= ======= ======= ======= ======= ======= ==== epicsmgr/ cvsroot/ epics/base/ src/db/ dbContextReadNo tifyCache. cpp,v tifyCache. cpp tifyCache. cpp 9 Jan 2004 00:42:13 -0000 1.1.2.1 tifyCache. cpp 12 Apr 2005 16:52:08 -0000
! public:
! dbContextReadNo
! ~dbContextReadN
! char * alloc ( unsigned long size );
! void free ( char * pFree );
! void show ( unsigned level ) const;
! private:
! struct cacheElem_t {
! struct cacheElem_t * pNext;
! };
! unsigned long _readNotifyCach
! cacheElem_t * _pReadNotifyCache;
! void reclaimAllCache
! dbContextReadNo
! dbContextReadNo
! };
!
class dbContextReadNo
public:
dbContext
void callReadNotify ( epicsGuard < epicsMutex > &,
struct dbAddr & addr, unsigned type, unsigned long count,
void show ( epicsGuard < epicsMutex > &, unsigned level ) const;
private:
! dbContextReadNo
! epicsMutex & _mutex;
dbContextRea
dbContextRea
};
Index: dbContextReadNo
=======
RCS file: /net/phoebus/
retrieving revision 1.1.2.1
diff -c -r1.1.2.1 dbContextReadNo
*** dbContextReadNo
--- dbContextReadNo
***************
*** 14,20 ****
*/
#include "epicsMutex.h"
- #include "tsFreeList.h"
#include "cadef.h" // this can be eliminated when the callbacks use the new interface
#include "db_access.h" // should be eliminated here in the future
--- 14,19 ----
***************
...