darkrock/ferite — pull request #5 by cention-nazri (2014-08-15 02:22:53+00:00)
Title: Bugfix: ferite hamt did not handle hash collision

The bug is reproducible as follows:

$ cat collision.fe
namespace Collision {
function newsprint() {}
function swig() {}
}

$ cache_ferite collision.fe # CPU will be pegged at 100% while RAM usage increases to OOM

The hamt code tries to cache the two functions using the following keys (note the colliding uint32 hashes):

key uint64 hash uint32 hash
Collision.newsprint_ 5862143705074859073 189234241
Collision.swig_ 17934375439221357633 189234241