Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] delete crashes ...

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
> (self-developed)
> 	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
> for
> 	inserting and another for retrieving ( and yes access is mutex
> protected
> 	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.
> Regards,
> Rajnish

David Airlie, Software Engineer
http://www.skynet.ie/~airlied / airlied at skynet.ie
pam_smb / Linux DECstation / Linux VAX / ILUG person