Opened 6 months ago

Closed 6 months 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 Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

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).

Data.HashTable.new 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 months ago.
program demonstrating the invalid Data.HashTable? behaviour

Download all attachments as: .zip

Change History (4)

Changed 6 months ago by erszcz

program demonstrating the invalid Data.HashTable? behaviour

comment:1 Changed 6 months ago by erszcz

The file size limit is too small to attach the original data file causing the problem. It's available here: https://dl.dropboxusercontent.com/u/1169871/formy.utf8.xz

comment:2 Changed 6 months 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?

Simon

comment:3 Changed 6 months ago by erszcz

  • Resolution set to wontfix
  • Status changed from new to closed

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.