Possibility? of infinite loop in MultinameHashtable::get
Haghighat, Mohammad R
mohammad.r.haghighat at intel.com
Mon Jan 14 16:59:33 PST 2008
I've been looking at optimizing the "get" method of MultinameHashtable,
which is often the hottest VM function. It seems that its implementation
is at risk of infinite loop not only at insertion time but also during
lookups. For lookups, when a match is found the method doesn't return
the match before it inspects all the possible collisions until it finds
an empty slot. This is done to check if there's an ambiguous binding.
Even if the occupancy of the table is below the load factor, it is
conceivable that all cells in the collision chain might be occupied. In
such a case, the get method will not terminate. This is more probable
with small tables. A remedy could be to rehash the table upon the first
revisit of the first cell.
More information about the Tamarin-devel