[GHC] #15721: Command `:show bindings` throws exception for bindings without `let`
#15721: Command `:show bindings` throws exception for bindings without `let` -------------------------------------+------------------------------------- Reporter: sighingnow | Owner: (none) Type: bug | Status: new Priority: high | Milestone: Component: GHCi | Version: 8.6.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: GHCi crash Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- The command `:show bindings` works for `let a = 1`: {{{#!hs Prelude> let a = 1 Prelude> :show bindings a :: Num p => p = _ }}} But not for `a = 1`: {{{#!hs Prelude> a = 1 Prelude> :show bindings ghc-stage2.exe: ^^ Could not load 'interactive_Ghci1_zdtrModule2_closure', dependency unresolved. See top entry above. ghc-stage2.exe: ^^ Could not load 'interactive_Ghci1_zdtrModule4_closure', dependency unresolved. See top entry above. $trModule :: GHC.Types.Module = _ $trModule1 :: GHC.Types.TrName = _ $trModule2 :: GHC.Prim.Addr# = *** Exception: ByteCodeLink.lookupCE During interactive linking, GHCi couldn't find the following symbol: interactive_Ghci1_zdtrModule2_closure This may be due to you not asking GHCi to load extra object files, archives or DLLs needed by your current session. Restart GHCi, specifying the missing library using the -L/path/to/object/dir and -lmissinglibname flags, or simply by naming the relevant files on the GHCi command line. Alternatively, this link failure might indicate a bug in GHCi. If you suspect the latter, please send a bug report to: glasgow-haskell-bugs@haskell.org $trModule3 :: GHC.Types.TrName = _ $trModule4 :: GHC.Prim.Addr# = *** Exception: ByteCodeLink.lookupCE During interactive linking, GHCi couldn't find the following symbol: interactive_Ghci1_zdtrModule4_closure This may be due to you not asking GHCi to load extra object files, archives or DLLs needed by your current session. Restart GHCi, specifying the missing library using the -L/path/to/object/dir and -lmissinglibname flags, or simply by naming the relevant files on the GHCi command line. Alternatively, this link failure might indicate a bug in GHCi. If you suspect the latter, please send a bug report to: glasgow-haskell-bugs@haskell.org a :: Num p => p = _ a1 :: Integer = _ }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15721> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15721: Command `:show bindings` throws exception for bindings without `let` -------------------------------------+------------------------------------- Reporter: sighingnow | Owner: (none) Type: bug | Status: new Priority: high | Milestone: Component: GHCi | Version: 8.6.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by mpickering): * keywords: => newcomer Comment: I can't reproduce this on linux so it seems like a windows problem. Two other strange things about `x = a` {{{ let x = 'a' x = 'a' }}} doesn't warn about name shadowing. If you inspect the heap representation of the two versions of `x` they are also different. The latter is a thunk whilst the former is just the character. Making `x = a` behave exactly like `let x = a` will probably fix this ticket the above two problems as well. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15721#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15721: Command `:show bindings` throws exception for bindings without `let` -------------------------------------+------------------------------------- Reporter: sighingnow | Owner: (none) Type: bug | Status: new Priority: high | Milestone: Component: GHCi | Version: 8.6.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by AndreasK): Can't reproduce this on windows either. Tried 8.6.1 and master: {{{ PS C:\Users\Andi> stack ghci --compiler=ghc-8.6 ... Configuring GHCi with the following packages: GHCi, version 8.6.1: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from C:\Users\Andi\AppData\Local\Temp\haskell- stack-ghci\2a3bbd58\ghci-script Prelude> x = 'a' Prelude> :show bindings $trModule :: GHC.Types.Module = _ x :: Char = _ Prelude> }}} What OS have you been using? And what commit on master? -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15721#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15721: Command `:show bindings` throws exception for bindings without `let` -------------------------------------+------------------------------------- Reporter: sighingnow | Owner: (none) Type: bug | Status: infoneeded Priority: high | Milestone: Component: GHCi | Version: 8.6.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by sighingnow): * status: new => infoneeded Comment: I can reproduce the problem with ghc-8.2.2/8.6.1/head on Windows 10 (10.0.17134.286), but this problem doesn't appear on another laptop also with Windows 10. I will try to post more detailed information tomorrow. Anyway, I have marked this ticket as infoneeded. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15721#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15721: Command `:show bindings` throws exception for bindings without `let` -------------------------------------+------------------------------------- Reporter: sighingnow | Owner: (none) Type: bug | Status: patch Priority: high | Milestone: Component: GHCi | Version: 8.6.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): MR:97 Wiki Page: | -------------------------------------+------------------------------------- Changes (by osa1): * status: infoneeded => patch * differential: => MR:97 Comment: Even if there's still a bug here it'll be fixed with MR:97 where we treat `x = y` as `let x = y`. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15721#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15721: Command `:show bindings` throws exception for bindings without `let` -------------------------------------+------------------------------------- Reporter: sighingnow | Owner: (none) Type: bug | Status: closed Priority: high | Milestone: Component: GHCi | Version: 8.6.1 Resolution: fixed | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): MR:97 Wiki Page: | -------------------------------------+------------------------------------- Changes (by osa1): * status: patch => closed * resolution: => fixed Comment: Fixed with a34ee6154. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15721#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15721: Command `:show bindings` throws exception for bindings without `let` -------------------------------------+------------------------------------- Reporter: sighingnow | Owner: (none) Type: bug | Status: closed Priority: high | Milestone: 8.8.1 Component: GHCi | Version: 8.6.1 Resolution: fixed | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): MR:97 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * milestone: => 8.8.1 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15721#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15721: Command `:show bindings` throws exception for bindings without `let` -------------------------------------+------------------------------------- Reporter: sighingnow | Owner: (none) Type: bug | Status: closed Priority: high | Milestone: 8.8.1 Component: GHCi | Version: 8.6.1 Resolution: fixed | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): MR:97 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ömer Sinan Ağacan <omeragacan@…>): In [changeset:"a34ee61545930d569d0dbafb3a4a5db3a7a711e5/ghc" a34ee615/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="a34ee61545930d569d0dbafb3a4a5db3a7a711e5" Refactor GHCi UI to fix #11606, #12091, #15721, #16096 Instead of parsing and executing a statement or declaration directly we now parse them first and then execute in a separate step. This gives us the flexibility to inspect the parsed declaration before execution. Using this we now inspect parsed declarations, and if it's a single declaration of form `x = y` we execute it as `let x = y` instead, fixing a ton of problems caused by poor declaration support in GHCi. To avoid any users of the modules I left `execStmt` and `runDecls` unchanged and added `execStmt'` and `runDecls'` which work on parsed statements/declarations. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15721#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC