[GHC] #13216: internal error: stg_ap_pppppp_ret

#13216: internal error: stg_ap_pppppp_ret -------------------------------------+------------------------------------- Reporter: lerkok | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- We started getting the following from our app; though it's not reliably reproducible: {{{ internal error: stg_ap_pppppp_ret (GHC version 8.0.1 for x86_64_unknown_linux) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug Abort }}} Unfortunately I cannot share code, nor I can upgrade to GHC 8.0.2 due to work environment restrictions. My apologies for the worst bug report. Neither google nor Trac searches produced anything related. I'm wondering if anybody has seen this, or have any ideas where to look at. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13216 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13216: internal error: stg_ap_pppppp_ret -------------------------------------+------------------------------------- Reporter: lerkok | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by rwbarton): The panic indicates that you tried to apply something that wasn't a function (to six arguments). A likely cause is heap corruption, possibly due to a misbehaving FFI function or something of that sort. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13216#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13216: internal error: stg_ap_pppppp_ret -------------------------------------+------------------------------------- Reporter: lerkok | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by lerkok): Thanks! There is no FFI involved in the app; pure Haskell. The dependencies also look quite benign: {{{ base >= 3 && < 5 , array, bytestring, binary, containers, directory, edit- distance , filepath, haskeline, mtl, process, time, old-time, old-locale , text, utf8-string, xml, zlib, unix, split, gitrev, deepseq, git-date }}} though of course I don't know if any of these might be doing some FFI. (Perhaps `git-date` does.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13216#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13216: internal error: stg_ap_pppppp_ret -------------------------------------+------------------------------------- Reporter: lerkok | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by rwbarton): You can also try building with `-debug` (purely a linktime option, no need to recompile any modules) and run with `+RTS -DS`, which will turn on various runtime sanity checks which might find the issue sooner. See Debugging/RuntimeSystem. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13216#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13216: internal error: stg_ap_pppppp_ret -------------------------------------+------------------------------------- Reporter: lerkok | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): Also try `-dcore-lint -dstg-lint`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13216#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13216: internal error: stg_ap_pppppp_ret -------------------------------------+------------------------------------- Reporter: lerkok | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by lerkok): @goldfire: Thanks! Lint indeed finds an issue: {{{ ghc: panic! (the 'impossible' happened) (GHC version 8.0.1 for x86_64-unknown-linux): *** Stg Lint ErrMsgs: in Stg2Stg *** <no location info>: warning: [RHS of help2 :: [([Char], [Char], [Char])]] In a function application, function type doesn't match arg types: Function type: [Char] -> ((State -> Exp -> State# RealWorld -> (# State# RealWorld, State #)) :: *) ~R# ((State -> Exp -> IO State) :: *) => [Char] -> [Char] -> [([Char], (State -> Exp -> IO State, State -> [Char], [Char] -> [Completion], [Char], [Char]))] -> [([Char], [Char], [Char])] Arg types: [Char] (() :: *) ~# (() :: *) [Char] [Char] [(String, (State -> Exp -> IO State, State -> String, String -> [Completion], String, String))] Expression: help_$sgo settables92 coercionToken# settables81 settables80 settables1 }}} I've created a gist for the whole output (which is quite large): https://gist.github.com/LeventErkok/55aa19176d6adeb48eef56f39019c202 Is it the second argument that's having an issue here? Perhaps I'm reading it wrong. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13216#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13216: internal error: stg_ap_pppppp_ret -------------------------------------+------------------------------------- Reporter: lerkok | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): I haven't a clue about STG. I just knew there was a flag about it. :) Sorry I can't be of further help here... -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13216#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13216: internal error: stg_ap_pppppp_ret -------------------------------------+------------------------------------- Reporter: lerkok | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by lerkok): Just wanted to drop a note here: I'm still trying to create a minimal example that I can share for the experts to look at. Unfortunately, my attempts so far failed: Any meaningful reduction of the code and the lint- error goes away. I haven't given up however; and I'm hopefull I'll be able to share something next week. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13216#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13216: internal error: stg_ap_pppppp_ret -------------------------------------+------------------------------------- Reporter: lerkok | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Sadly, the lint error is a bug in lint. In the conversion from Core to STG we replace `(Coercion blah)` with `coercionToken#`; the latter has a fixed type. It's just a placeholder. STG lint complains about this but it shouldn't; we could have recorded the type in `corecionToken#` (maybe by having variants or something) but it'd just be work to no gain. So I am sill clueless about why this `stg_app_ppp` thing is happening, sorry. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13216#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13216: internal error: stg_ap_pppppp_ret -------------------------------------+------------------------------------- Reporter: lerkok | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by dobenour): Are you using any GHC primops, or functions with names that begin with `unsafe`? Those functions could easily corrupt the heap if misused. In particular, are you using `unsafeCoerce` anywhere? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13216#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13216: internal error: stg_ap_pppppp_ret -------------------------------------+------------------------------------- Reporter: lerkok | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by lerkok): No, no `unsafe` calls to anywhere.. (Unless one of the dependencies does; which I doubt.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13216#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC