Ticket #652 (closed task: fixed)

Opened 7 years ago

Last modified 4 years ago

Have a single Data.Typeable hash table in GHCi

Reported by: simonmar Owned by:
Priority: high Milestone: 6.6
Component: Runtime System Version: 6.4.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Moderate (less than a day)
Test Case: Blocked By:
Blocking: Related Tickets:

Description (last modified by simonmar) (diff)

The hash table used by Data.Typeable is declared as a top-level IORef. This means in GHCi, there will be two Data.Typeable hash tables: one in the dynamically-loaded base package, and one in the statically-linked GHCi binary. Therefore Dyanmics created in one world are incompatible with the other world.

We have a hack to make sure the two hash tables don't use the same uniques, so at least a TypeRep created in one world will never compare equal to a TypeRep from the other world (before this hack we could different TypeReps bogusly claiming to be equal). However, we would like them to compare equal when they are equal.

This implies that the packages in use in both world must be compatible (preferably identical). This is because when a TypeRep compares equal, we must be sure that the value has the representation we expect. Fortunately this is the case in a stage2 GHC.

We should store a ptr (StablePtr?) to the hash table in an RTS global, so that there is only one per runtime instance.

Change History

Changed 7 years ago by simonmar

  • description modified (diff)

Changed 7 years ago by simonmar

  • description modified (diff)

Changed 7 years ago by simonmar

  • priority changed from normal to high

Changed 7 years ago by simonmar

  • status changed from new to closed
  • resolution set to fixed

Done, thanks to Esa.

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple

Changed 4 years ago by simonmar

  • difficulty changed from Moderate (1 day) to Moderate (less than a day)
Note: See TracTickets for help on using tickets.