[GHC] #9878: Static pointers in GHCi cause panic

GHC ghc-devs at haskell.org
Thu Dec 11 17:30:45 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 facundo.dominguez):

 For the record, this fails for me when GHCi interprets the code. Compiling
 the code seems to work.
 {{{
 Prelude> :set -fobject-code
 Prelude> :l Static
 [1 of 1] Compiling Static           ( Static.hs, Static.o )
 Ok, modules loaded: Static.
 Prelude Static> f
 True
 }}}

 Trying to access `GHC.StaticPtr.staticPtrKeys` segfaults:

 {{{
 Prelude Static> GHC.StaticPtr.staticPtrKeys
 Segmentation fault
 }}}

 But entering GHCi again so the preexisting .o is used allows to use
 `staticPtrKeys`:
 {{{
 Prelude> :l Static
 Ok, modules loaded: Static.
 Prelude Static> f
 True
 Prelude Static> GHC.StaticPtr.staticPtrKeys
 [df8d46d69bf517c3ca5f48d44485169a]
 }}}
 ... and if the call to `f` is omitted `staticPtrkeys` does not show the
 pointer:
 {{{
 Prelude> :l Static
 Ok, modules loaded: Static.
 Prelude Static> GHC.StaticPtr.staticPtrKeys
 []
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9878#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list