< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index Next in Thread >

RE: [reSIProcate] AbstractFifo bug?


Can you get a stack trace this? AbstractFifo is used a lot in resip, but it does have several subclasses.  The size is incremeneted in the add methods of the subclasses, which lock before adding.

 

Also, run resiprocate/test/testFifo.cxx on your configuration.

 

--Derek

 

PS -- What is your platform/compiler?

 

CONFIDENTIALITY NOTICE

This email and any files transmitted with it contains proprietary information and, unless expressly stated otherwise, all contents and attachments are confidential. This email is intended for the addressee(s) only and access by anyone else is unauthorized. If you are not an addressee, any disclosure, distribution, printing or copying of the contents of this email or its attachments, or any action taken in reliance on it, is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately and then delete this email and any copies of it. Thank you for your co-operation.


From: resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxx [mailto:resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Micky Kaufmann
Sent: Thursday, May 19, 2005 6:31 AM
To: resiprocate-devel@xxxxxxxxxxxxxxxxxxx
Subject: [reSIProcate] AbstractFifo bug?

 

Hi. All

 

While running repro I go an assert error from the AbstractFifo::getNext method:

 

void* AbstractFifo::getNext() {

   Lock lock(mMutex); (void)lock;

 

   while (mFifo.empty())

   {

      mCondition.wait(mMutex);

   }

   void* firstMessage = mFifo.front();

   mFifo.pop_front();

   assert(mSize != 0);

   mSize--;

   return firstMessage;

}

 

As I see it the problem is caused probably because non thread safe adding of elements to the Fifo. Meaning mSize++ is missing somewhere and from what I investigated the only reason for using mSize instead of using std::deque::size is because we want to make sure that mSize < mMaxSize.

Is there another reason?

 

Is it ok to replace the lines:

   assert(mSize != 0);

   mSize--;

with

   mSize = mFifo.size();

 

Is it ok to replace the line:

   while (mFifo.empty())

with

   while (mSize==0)  //this.empty()

 

Any other solution?