hashtables icon indicating copy to clipboard operation
hashtables copied to clipboard

undefined, called at src/Data/HashTable/ST/Cuckoo.hs:406:31

Open jwaldmann opened this issue 4 years ago • 2 comments

Hi, I am seeing this error

...  Prelude.undefined                                                                                      
CallStack (from HasCallStack):                             
  error, called at libraries/base/GHC/Err.hs:79:14 in base:GHC.Err
  undefined, called at src/Data/HashTable/ST/Cuckoo.hs:406:31 in hashtables-1.2.4.1-6MJy5UcaJATEc9hXD9mdTw:Data.HashTa
ble.ST.Cuckoo  

on x86_64, with +RTS -A400m -M100g. I am only using insert and lookup. The code runs in the ST monad. The error is happening when re-sizing?

is it worth investigating? I cannot easily release the code as-is. I could debug on my machine (how?), or try to extract a reproducer.

jwaldmann avatar Sep 11 '20 10:09 jwaldmann

It's not a good sign -- this means that the hashcodes array and keys/values arrays have gotten out of sync, and we've dereferenced a key containing undefined that we expected to hold a user-provided value.

If you add the debug flag to the hashtables build it will spew diagnostic output to stderr, which you could capture -- it would help in narrowing down the precise sequence of events that leads to the problem.

Also: does the issue happen with the version of hashtables prior to the addition of modify to the typeclasses? A lot of things were mutated there and I think many of them are buggy

gregorycollins avatar Oct 30 '20 14:10 gregorycollins

the addition of modify to the typeclasses

when was that? (what versions should I use for testing)

jwaldmann avatar Oct 30 '20 20:10 jwaldmann