Opened 6 years ago

Closed 6 years ago

#8495 closed bug (wontfix)

Infinite loop when using Data.HashTable.newHint and Data.HashTable.update

Reported by: erszcz Owned by:
Priority: normal Milestone:
Component: libraries/base Version: 7.4.2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


When using Data.HashTable.newHint and Data.HashTable.update to read a big (~1.5mln words) file into a HashTable the program seems to fall into an infinite loop.

"Seems to" since I couldn't wait long enough for it to finish computation. At least the execution time is way bigger than expected (orders of magnitude, like hours vs. expected seconds). doesn't cause the same issue.

Attached to the report is an example program reproducing the bug along with a data file the issue occurs with.

The bug was discussed on haskell-beginners mailing list quite a while ago, though I've summarized the findings in this bug report. See:

Attachments (1)

TestReadIntoHashTable.hs (1.8 KB) - added by erszcz 6 years ago.
program demonstrating the invalid Data.HashTable behaviour

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by erszcz

Attachment: TestReadIntoHashTable.hs added

program demonstrating the invalid Data.HashTable behaviour

comment:1 Changed 6 years ago by erszcz

The file size limit is too small to attach the original data file causing the problem. It's available here:

comment:2 Changed 6 years ago by simonpj

I see that the online documentation for Data.HashTable says "Deprecated: Data.HashTable will be removed in GHC 7.8. Please use an alternative, e.g. the hashtables package, instead."

So it might be worth checking out that package?


comment:3 Changed 6 years ago by erszcz

Resolution: wontfix
Status: newclosed

Definitely. I haven't noticed the deprecation notice and it probably wasn't there yet when I initially discovered the bug about a year ago. I guess the ticket might be closed then.

Note: See TracTickets for help on using tickets.