[asterisk-dev] A problem with Hash Tables...

Steve Murphy murf at digium.com
Mon Sep 10 12:18:45 CDT 2007


On Mon, 2007-09-10 at 00:26 +0200, Marta Carbone wrote:
> Hi,
> 
> On Sat, Sep 08, 2007 at 03:35:46PM -0600, Steve Murphy wrote:
> > On Sat, 2007-09-08 at 00:04 -0700, Luigi Rizzo wrote:
> 
> [...]
> 
> > see team/murf/datastructs; I've checked in my utils/hashtest2.c file;
> > right at the moment it's crashing, but it worked fine yesterday. The
> > utils/Makefile is made to compile hashtest2 with everything else.
> > Something must have changed... the crash I see is during the traversal,
> > I'm unref'ing a pointer as I'm about to iterate again when the crash
> > occurs.
> >
> > It could easily be that I have the wrong version of astobj2 or
> > something. See if you have the same problem...
> >
> 
> in team/marta/astobj2, commit 82061 fixes a possible race that could
> have caused the crash in your test.
> 
> The same problem is also present in trunk, please consider reviewing
> and applying the fix.
> 
> marta
> 

marta--

I copied the new astobj2.c file into my datastructs branch and rebuilt
and reran the hashtest2 test... it successfully passes now. 14 min 59
sec for hashtest2 to run; a fairly similar hashtab-based hashtest runs
in 53 sec; both tables presized
to 180K elements, so they will not have to resize. I think I used
write-locking
traversals on the hashtab side.

I applied the changes in your branch to trunk as you requested; I did
not touch 1.4, however, as there are several diffs between trunk and
1.4's astobj2.[ch] files, and I was not certain these changes would
apply to both... If you think I should apply these changes to 1.4 also,
let me know.

I also added the hashtest2.c program to trunk, so it's easier for you to
test with it, if you desire.

murf



-- 
Steve Murphy
Software Developer
Digium
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3227 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-dev/attachments/20070910/58a4d3ea/attachment.bin 


More information about the asterisk-dev mailing list