[GHC] #14269: ghc: internal error: PAP object entered!

#14269: ghc: internal error: PAP object entered! -------------------------------------+------------------------------------- Reporter: erisco | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Keywords: | Operating System: Windows Architecture: x86_64 | Type of failure: Compile-time (amd64) | crash or panic Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- {{{
ghc hplay.hs -o hplay.exe [1 of 1] Compiling Main ( hplay.hs, hplay.o ) ghc: internal error: PAP object entered! (GHC version 8.0.2 for x86_64_unknown_mingw32) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. }}} Test file: {{{ {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE QuasiQuotes #-} module Main where import qualified Language.C.Inline as C main :: IO () main = [C.block||] }}} Using inline-c-0.6.0.5 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14269 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14269: ghc: internal error: PAP object entered! -------------------------------------+------------------------------------- Reporter: erisco | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): How exactly are you using `inline-c-0.6.0.5` with GHC 8.0.2? `inline-c-0.6.0.5` has strict upper bounds on `template-haskell` to only allow version 2.12.0.0 or later, and GHC 8.0.2 is bundled with `template- haskell-2.11.1.0`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14269#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14269: ghc: internal error: PAP object entered! -------------------------------------+------------------------------------- Reporter: erisco | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): I attempted to build `inline-c-0.6.0.5` with GHC 8.0.2 using `--allow- older`, but was thwarted: {{{ $ cabal install -w /opt/ghc/8.0.2/bin/ghc inline-c --allow-older Resolving dependencies... Configuring inline-c-0.6.0.5... Building inline-c-0.6.0.5... Failed to install inline-c-0.6.0.5 Build log ( /u/rgscott/.cabal/logs/ghc-8.0.2/inline-c-0.6.0.5-6LPf8sxaoRe7ivvVOklwzp.log ): cabal: Entering directory '/tmp/cabal-tmp-15800/inline-c-0.6.0.5' Configuring inline-c-0.6.0.5... Preprocessing library for inline-c-0.6.0.5.. Building library for inline-c-0.6.0.5.. [1 of 9] Compiling Language.C.Types.Parse ( src/Language/C/Types/Parse.hs, dist/build/Language/C/Types/Parse.o ) [2 of 9] Compiling Language.C.Types ( src/Language/C/Types.hs, dist/build/Language/C/Types.o ) [3 of 9] Compiling Language.C.Inline.HaskellIdentifier ( src/Language/C/Inline/HaskellIdentifier.hs, dist/build/Language/C/Inline/HaskellIdentifier.o ) [4 of 9] Compiling Language.C.Inline.FunPtr ( src/Language/C/Inline/FunPtr.hs, dist/build/Language/C/Inline/FunPtr.o ) [5 of 9] Compiling Language.C.Inline.Context ( src/Language/C/Inline/Context.hs, dist/build/Language/C/Inline/Context.o ) src/Language/C/Inline/Context.hs:149:32: error: Not in scope: type constructor or class ‘TH.ForeignSrcLang’ Neither ‘Language.Haskell.TH’ nor ‘Language.Haskell.TH.Syntax’ exports ‘ForeignSrcLang’. cabal: Leaving directory '/tmp/cabal-tmp-15800/inline-c-0.6.0.5' cabal: Error: some packages failed to install: inline-c-0.6.0.5-6LPf8sxaoRe7ivvVOklwzp failed during the building phase. The exception was: ExitFailure 1 }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14269#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14269: ghc: internal error: PAP object entered! -------------------------------------+------------------------------------- Reporter: erisco | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by erisco): I don't know what to tell you… just ran 'cabal install inline-c' and it installed. I didn't ask further questions. I have now updated to GHC 8.2.1 and, after making a correct program with inline-c, it compiled successfully. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14269#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14269: ghc: internal error: PAP object entered! -------------------------------------+------------------------------------- Reporter: erisco | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: worksforme | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => closed * resolution: => worksforme Comment: Replying to [comment:3 erisco]:
I don't know what to tell you… just ran 'cabal install inline-c' and it installed. I didn't ask further questions. I may have gleaned the wrong version number perhaps by looking at the Hackage documentation rather than my console.
I see. In that event, you most likely installed `inline-c-0.5.6.1` (at least, that's what it defaulted to when I ran `cabal install inline-c` using GHC 8.0.2). However, I wasn't able to reproduce the panic even after doing this. I simply got: {{{ $ C:\Users\RyanGlScott\Software\ghc-8.0.2\bin\ghc hplay.hs -o hplay.exe [1 of 1] Compiling Main ( hplay.hs, hplay.o ) hplay.hs:8:17: error: * "hplay.hs" (line 8, column 17): unexpected end of input expecting white space, "typedef", "extern", "static", "auto", "register", "void", "char", "short", "int", "long", "float", "double", "signed", "unsigned", "struct", "enum", type name, "const", "restrict", "volatile" or "inline" * In the quasi-quotation: [C.block||] }}} I also experienced this same error when compiling the same program with `inline-c-0.5.6.1` and `inline-c-0.6.0.5` on GHC 8.2.1.
I have now updated to GHC 8.2.1 and, after making a correct program with inline-c, it compiled successfully.
That's good. If there was an issue in GHC 8.0.2, then it sounds like it's since been resolved. I'll close this ticket as a result. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14269#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC