ghc-heap-view
ghc-heap-view copied to clipboard
assertNF crashed with unsafe head operation on empty list
It was difficult to diagnose a problem, because the thing just spewed that head was applied to an empty list, and there was no clue, whether it was my code, or some library. I was able to hunt it down eventually, that the unsafe head operation was done in ghc-heap-view 0.5.9 src/GHC/HeapView.hs: getClosureData
t | t == MUT_VAR_CLEAN || t == MUT_VAR_DIRTY ->
return $ MutVarClosure itbl (head ptrs)
Unfortunately I do not have the original closure at hand to reproduce it. But in any case if I would hit this problem again, it would be very useful for debugging to get a more informative error message.
I guess that’s true. Patch is welcome :-)