[GHC] #9878: Static pointers in GHCi cause panic
GHC
ghc-devs at haskell.org
Mon Dec 15 01:51:46 UTC 2014
#9878: Static pointers in GHCi cause panic
-------------------------------------+-------------------------------------
Reporter: monoidal | Owner: facundo.dominguez
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.9
Resolution: | Keywords:
Operating System: | Architecture: Unknown/Multiple
Unknown/Multiple | Difficulty: Unknown
Type of failure: GHCi crash | Blocked By:
Test Case: | Related Tickets:
Blocking: |
Differential Revisions: |
-------------------------------------+-------------------------------------
Comment (by qnikst):
There are 2 issues here:
1. That we don't support static pointers in ghci without fobject code.
This is because module constructor that we are creating is not called, and
because `speEntry` expressions that float out on desugarer phase is not
instantiated by ghci.
2. Also staticPtrKeys works incorrectly:
a. it segfaults
b. it memoizes it's result:
{{{
Prelude> :l Static
Ok, modules loaded: Static.
Prelude Static> length GHC.StaticPtr.currentStaticPtrKeys
Prelude Static> length GHC.StaticPtr.staticPtrKeys
staticPtrKeys <-- debug ouput (function was called)
0
Prelude Static> f99 <-- forcing module loading
True
Prelude Static> length GHC.StaticPtr.staticPtrKeys
0 <-- no debug output (function was not called)
Prelude Static> fmap length GHC.StaticPtr.currentStaticPtrKeys <-- IO
variant
staticPtrKeys <-- debug output
count: 1025
1025
}}}
While I don't know an easy way to workaround 1st issue, I'll attach
patches for the 2a and 2b.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9878#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list