[GHC] #9001: unexpected runtime crash

#9001: unexpected runtime crash ------------------------------------+------------------------------------- Reporter: jwlato | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: Runtime crash Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- Apologies for the poor summary, I'm not sure how to be more descriptive. I don't see anything dodgy here. Compiling the attached program `ghc -O -dcore-lint Test.hs` and running it results in a runtime crash. Various incarnations of this code have resulted in Test: internal error: scavenge_one: strange object 0 Test: internal error: stg_ap_p_ret and core dumps with no further information. I've been able to reproduce this with ghc-7.8.2 and ghc-7.6.3. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9001 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9001: unexpected runtime crash -------------------------------------+------------------------------------ Reporter: jwlato | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: Runtime crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by goldfire): I can reproduce this behavior on Mac OS 10.8.5 & GHC 7.8.2. After a bunch of (presumably expected) output, I get {{{ Test: internal error: scavenge_one: strange object 0 (GHC version 7.8.2 for x86_64_apple_darwin) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug Abort trap: 6 }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9001#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9001: unexpected runtime crash -------------------------------------+------------------------------------ Reporter: jwlato | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: Component: Runtime System | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: Runtime crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by rwbarton): * cc: simonmar (added) * owner: => simonmar * component: Compiler => Runtime System Comment: I can reproduce it on Linux also. It seems to be related to stack overflow handling somehow: when I run with `-k1M` the program completes successfully (even with the `-Dg` and `-DS` debug options too). (Though it could still be either a bug in the runtime system or a bug in the code generation.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9001#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9001: unexpected runtime crash -------------------------------------+------------------------------------ Reporter: jwlato | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: Component: Runtime System | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: Runtime crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by rwbarton): It looks like the stack overflows in a long sequence of `stg_ap_*` function calls and the overflow isn't detected until a point at which `Sp` is not only less than `SpLim` but even less than the start of the stack segment, whereupon bad things happen. Isn't it bad that these `stg_ap_*_fast` functions push things onto the stack without checking for overflow? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9001#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9001: unexpected runtime crash -------------------------------------+------------------------------------ Reporter: jwlato | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: Component: Runtime System | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: Runtime crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by monoidal): I've reduced the testcase, but it got messy; compiling `ghc-7.8.2 X.hs` and running should give an internal error: {{{ {-# LANGUAGE RankNTypes #-} newtype FMList = FM {unFM :: forall m. (m -> m -> m) -> m -> m} main = print $ build $ delete $ FM (\_ x -> x) delete l = FM (\map x -> unFM l const (const undefined) `seq` unFM (delete (dr l)) map x `seq` x) build t = unFM t (.) (+1) 0 dr t = FM $ \_ g -> unFM t (.) (const g) undefined }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9001#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9001: unexpected runtime crash -------------------------------------+------------------------------------ Reporter: jwlato | Owner: simonmar Type: bug | Status: new Priority: highest | Milestone: 7.8.3 Component: Runtime System | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: Runtime crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by simonmar): * priority: normal => highest * milestone: => 7.8.3 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9001#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9001: unexpected runtime crash -------------------------------------+------------------------------------ Reporter: jwlato | Owner: simonmar Type: bug | Status: new Priority: highest | Milestone: 7.8.3 Component: Runtime System | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: Runtime crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by simonmar): Yes, it looks like missing stack checks in the `stg_ap_*_fast` functions. I'm looking into it. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9001#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9001: unexpected runtime crash -------------------------------------+------------------------------------ Reporter: jwlato | Owner: simonmar Type: bug | Status: new Priority: highest | Milestone: 7.8.3 Component: Runtime System | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: Runtime crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Description changed by simonpj: Old description:
Apologies for the poor summary, I'm not sure how to be more descriptive. I don't see anything dodgy here.
Compiling the attached program `ghc -O -dcore-lint Test.hs` and running it results in a runtime crash. Various incarnations of this code have resulted in
Test: internal error: scavenge_one: strange object 0
Test: internal error: stg_ap_p_ret
and core dumps with no further information.
I've been able to reproduce this with ghc-7.8.2 and ghc-7.6.3.
New description: Apologies for the poor summary, I'm not sure how to be more descriptive. I don't see anything dodgy here. Compiling the attached program `ghc -O -dcore-lint Test.hs` and running it results in a runtime crash. Various incarnations of this code have resulted in {{{ Test: internal error: scavenge_one: strange object 0 Test: internal error: stg_ap_p_ret }}} and core dumps with no further information. I've been able to reproduce this with ghc-7.8.2 and ghc-7.6.3. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9001#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9001: unexpected runtime crash
-------------------------------------+------------------------------------
Reporter: jwlato | Owner: simonmar
Type: bug | Status: new
Priority: highest | Milestone: 7.8.3
Component: Runtime System | Version: 7.8.2
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture: Unknown/Multiple
Type of failure: Runtime crash | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets:
-------------------------------------+------------------------------------
Comment (by Simon Marlow

#9001: unexpected runtime crash -------------------------------------+------------------------------------ Reporter: jwlato | Owner: simonmar Type: bug | Status: merge Priority: highest | Milestone: 7.8.3 Component: Runtime System | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: Runtime crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by simonmar): * status: new => merge -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9001#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9001: unexpected runtime crash -------------------------------------+------------------------------------ Reporter: jwlato | Owner: simonmar Type: bug | Status: closed Priority: highest | Milestone: 7.8.3 Component: Runtime System | Version: 7.8.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: Runtime crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by thoughtpolice): * status: merge => closed * resolution: => fixed Comment: Merged, thanks! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9001#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC