No subject


Thu Jul 12 09:23:04 CDT 2007


to
the container, so it cannot unlink the bucket. 

Because the bucket is still there, and points to unallocated mem,
subsequent memory allocations will re-use the space, and searching for key
"A", which would otherwise yield no match, trips over garbaged memory and
the process aborts.

This is not an unusual situation.

My personal guess is that memory should not be freed in ao2_ref(), and
that buckets with 0 refs need to be purged in more places. Actually, every
possible operation that might bump into them at the container level. This
is a bit messy.



====================================================================== 

---------------------------------------------------------------------- 
 murf - 09-07-07 13:01  
---------------------------------------------------------------------- 
A misconception on my part; I was using ao2_ref(obj,-2) to unlink the
container,
when I should have been using ao2_unlink(c,obj) instead. Sorry!

The test harness passes just fine this way, even with 10 threads. The
algorithm is vindicated! 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
09-07-07 13:01  murf           Status                   new => closed       
09-07-07 13:01  murf           Note Added: 0070121                          
======================================================================




More information about the asterisk-bugs mailing list