SLUG Mailing List Archives
Re: [SLUG] delete crashes ...
- To: "Tiwari, Rajnish" <Rajnish.Tiwari@xxxxxxxxx>
- Subject: Re: [SLUG] delete crashes ...
- From: Dave Airlie <airlied@xxxxxxxxx>
- Date: Fri, 31 Oct 2003 02:46:08 +0000 (GMT)
- Cc: slug@xxxxxxxxxxx
Sounds more like a race condition, maybe link with efence to see does
someone mess up some memory without the lock or something...
Other than that the best way I've discovered to find race conditions is to
be Andrea Arcangeli (the kernel developer - some of the races he used to
find were scary) and failing that ability, examine the locking and make
sure you are doing what you actually want tod o..
On Fri, 31 Oct 2003, Tiwari, Rajnish wrote:
> hi All,
> I have a multithreaded c/c++ app containing a simple
> queue. 3 operations -'insert(..)', 'retrieve()' & 'length()'.
> As part of 'retrieve' a call to 'delete' is made to remove the
> head of the queue. Only 2 threads ever use this queue - strictly one
> inserting and another for retrieving ( and yes access is mutex
> on all 3 operations ).
> Although very _infrequent_, the problem is that the call
> to delete in retrieve causes segmentation violation. It is a real
> nuisance as
> one may run the app many times without fail but on some occassions
> it fails.
> Has anyone encountered/resolved simliar problems in anyother app ?
> Could this issue be the result of word alignment ?
> I suspect a memory corruption - but I cannot seem to figure out
> when/where/how it could happen.
> One characteristic of the app is that this queue is hammered quite
> intensively - both inserts and retrieves.
> Any hints much appreciated. Thanks in advance.
David Airlie, Software Engineer
http://www.skynet.ie/~airlied / airlied at skynet.ie
pam_smb / Linux DECstation / Linux VAX / ILUG person