[GHC] #14947: internal error: Invalid object *c in push()

#14947: internal error: Invalid object *c in push() -------------------------------------+------------------------------------- Reporter: varosi | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Profiling | Version: 8.4.1 Keywords: | Operating System: Unknown/Multiple Architecture: x86_64 | Type of failure: Runtime crash (amd64) | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Steps to reproduce on Windows 10 x64: {{{ stack --version Version 1.6.5, Git revision 24ab0d6ff07f28276e082c3ce74dfdeb1a2ca9e9 (5514 commits) x86_64 hpack-0.20.0 git clone https://github.com/varosi/cgraytrace.git cd cgraytrace git checkout 8c9499e4f3b1ba18b71e499667e865bb6db61856 stack build --profile stack exec --rts-options="-hr" -- cgraytrace-exe Rendering to sample.png... cgraytrace-exe.EXE: internal error: Invalid object *c in push() (GHC version 8.4.1 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. }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14947 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14947: internal error: Invalid object *c in push() ----------------------------------+-------------------------------------- Reporter: varosi | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Profiling | Version: 8.4.1 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------+-------------------------------------- Changes (by varosi): * os: Unknown/Multiple => Windows -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14947#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14947: internal error: Invalid object *c in push() -------------------------------------+------------------------------------- Reporter: varosi | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Profiling | Version: 8.4.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * os: Windows => Unknown/Multiple * architecture: x86_64 (amd64) => Unknown/Multiple Comment: I can also reproduce this on Linux. One thing that would help enormously in debugging this is producing a more minimal example that has minimal dependencies. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14947#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14947: internal error: Invalid object *c in push() -------------------------------------+------------------------------------- Reporter: varosi | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Profiling | Version: 8.4.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by varosi): Pushed varosi/ghc84_bug with lot less dependencies (mainly without Yesod). Is it enough? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14947#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14947: internal error: Invalid object *c in push() -------------------------------------+------------------------------------- Reporter: varosi | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Profiling | Version: 8.4.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): Well, somewhat :) But it still has several bulky dependencies, such as `vector`, `linear`, `dimensional`, and `JuicyPixels`. I suspect there's a small kernel of code that's causing this panic, but I don't know how to sort through all of the scaffolding in place to find it at present. Since you know this codebase far better than I do, any useless code you can remove ("useless" meaning "I can still trigger the panic without it") would be of invaluable help here. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14947#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14947: internal error: Invalid object *c in push() -------------------------------------+------------------------------------- Reporter: varosi | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Profiling | Version: 8.4.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by varosi): I'll try to remove some dependencies, but vector, linear and dimensional are core parts of the project and cannot be removed easily without rewriting everything. btw, on GHC 8.2.2 (master branch) there is no problem. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14947#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14947: internal error: Invalid object *c in push() -------------------------------------+------------------------------------- Reporter: varosi | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Profiling | Version: 8.4.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * cc: bgamari (added) Comment: While I'm no closer to minimizing the program, I believe I've found the commit that caused this: 4bfff7a507b5807736e9c6ce9814a9cfa60faeff (`rts: Don't default to single capability when profiled`). Ben, do you have any idea what might be happening here? I don't know how to interpret this error message. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14947#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14947: internal error: Invalid object *c in push() -------------------------------------+------------------------------------- Reporter: varosi | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Profiling | Version: 8.4.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): As an experiment, I build GHC against that commit using this patch: {{{#!diff diff --git a/rts/RetainerProfile.c b/rts/RetainerProfile.c index 7a9b9cc..c6eff0a 100644 --- a/rts/RetainerProfile.c +++ b/rts/RetainerProfile.c @@ -442,6 +442,7 @@ push( StgClosure *c, retainer c_child_r, StgClosure **first_child ) { stackElement se; bdescr *nbd; // Next Block Descriptor + char *barf_me; #if defined(DEBUG_RETAINER) // debugBelch("push(): stackTop = 0x%x, currentStackBoundary = 0x%x\n", stackTop, currentStack @@ -633,7 +634,8 @@ push( StgClosure *c, retainer c_child_r, StgClosure **first_child ) case IND: case INVALID_OBJECT: default: - barf("Invalid object *c in push()"); + asprintf(&barf_me, "Invalid object *c in push(): %d", get_itbl(c)->type); + barf(barf_me); return; } }}} And this is what I received after running `cgraytrace-exe` built with this patched GHC: {{{ Rendering to sample.png... cgraytrace-exe: internal error: Invalid object *c in push(): 37 (GHC version 8.5.20171211 for x86_64_unknown_linux) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} It looks like 37 [http://git.haskell.org/ghc.git/blob/affdea82bb70e5a912b679a169c6e9a230e4c93e... corresponds to] the `BLOCKING_QUEUE` closure type. `push()` does not have a case in its giant `switch` statement for `BLOCKING_QUEUE`, which at least explains why it falls through. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14947#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14947: internal error: Invalid object *c in push()
-------------------------------------+-------------------------------------
Reporter: varosi | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Profiling | Version: 8.4.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: Runtime crash | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#14947: internal error: Invalid object *c in push() -------------------------------------+------------------------------------- Reporter: varosi | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.4.2 Component: Profiling | Version: 8.4.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * priority: normal => high * milestone: => 8.4.2 Comment: Since this is a regression from 8.2, I'm opting to change the milestone and priority. Do change if you feel this isn't warranted. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14947#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14947: internal error: Invalid object *c in push()
-------------------------------------+-------------------------------------
Reporter: varosi | Owner: (none)
Type: bug | Status: new
Priority: high | Milestone: 8.4.2
Component: Profiling | Version: 8.4.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: Runtime crash | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#14947: internal error: Invalid object *c in push() -------------------------------------+------------------------------------- Reporter: varosi | Owner: (none) Type: bug | Status: merge Priority: high | Milestone: 8.4.2 Component: Profiling | Version: 8.4.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => merge -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14947#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14947: internal error: Invalid object *c in push() -------------------------------------+------------------------------------- Reporter: varosi | Owner: (none) Type: bug | Status: closed Priority: high | Milestone: 8.4.2 Component: Profiling | Version: 8.4.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged with 0ec1bd64b3317febe8c018041f538f1c83135e6c. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14947#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC