[GHC] #8236: Assertion failure of MarkWeak

#8236: Assertion failure of MarkWeak ------------------------------------+------------------------------------- Reporter: kazu-yamamoto | Owner: Type: bug | Status: new Priority: high | Milestone: 7.8.1 Component: Runtime System | Version: 7.7 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: Runtime crash Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- Running a web server compiled with GHC head specifying "-debug" got the following error: {{{ mighty-20130905: internal error: ASSERTION FAILED: file rts/sm/MarkWeak.c, line 371 (GHC version 7.7.20130901 for i386_unknown_linux) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} Here is Akio's guess: I wonder if this issue could have been introduced by the commit: https://github.com/ghc/ghc/commit/6770663f764db76dbb7138ccb3aea0527d194151 It looks like after the commit, addCFinalizerToWeak# can call into the GC with the closure lock held. This means the info pointer points to stg_WHITEHOLE_info, breaking the asserted invariant. I haven't done any testing to confirm this, however. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8236 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8236: Assertion failure of MarkWeak -------------------------------------+------------------------------------ Reporter: kazu-yamamoto | Owner: Type: bug | Status: new Priority: high | Milestone: 7.8.1 Component: Runtime System | Version: 7.7 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): It's probably not a real problem. But if you could find out the closure type in the event that the assertion fails that would help - either run gdb on the core dump, or change the assertion to print out the closure type. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8236#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8236: Assertion failure of MarkWeak -------------------------------------+------------------------------------ Reporter: kazu-yamamoto | Owner: Type: bug | Status: new Priority: high | Milestone: 7.8.1 Component: Runtime System | Version: 7.7 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 akio): I attached a file that I think reproduces this problem. If I compile it like {{{ ghc-stage1 weak-assertion.hs -threaded -O2 }}} and run it, it doesn't terminate (but it should). If I add {{{-threaded}}}, it shows the same assertion failure as the original problem: {{{ (GHC version 7.7.20130906 for x86_64_unknown_linux) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8236#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8236: Assertion failure of MarkWeak -------------------------------------+------------------------------------ Reporter: kazu-yamamoto | Owner: Type: bug | Status: new Priority: high | Milestone: 7.8.1 Component: Runtime System | Version: 7.7 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 akio): With my test case above, the bug actually affects the bahavior, probably because {{{evacuate()}}} goes into an infinite loop when a closure incorrectly gets the type {{{WHITEHOLE}}}. I'm preparing a patch. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8236#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8236: Assertion failure of MarkWeak -------------------------------------+------------------------------------ Reporter: kazu-yamamoto | Owner: Type: bug | Status: new Priority: high | Milestone: 7.8.1 Component: Runtime System | Version: 7.7 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 kazu-yamamoto): Even 6770663f764db76dbb7138ccb3aea0527d194151 is reverted, a web server (Mighty) got the same error. Probably, we have two problems, week reference and another thing. I will try to get the type of closure. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8236#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8236: Assertion failure of MarkWeak -------------------------------------+------------------------------------ Reporter: kazu-yamamoto | Owner: Type: bug | Status: new Priority: high | Milestone: 7.8.1 Component: Runtime System | Version: 7.7 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 akio): OK, I created #8242 for my case. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8236#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8236: Assertion failure of MarkWeak -------------------------------------+------------------------------------ Reporter: kazu-yamamoto | Owner: Type: bug | Status: new Priority: high | Milestone: 7.8.1 Component: Runtime System | Version: 7.7 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 kazu-yamamoto): My previous comment was not correct. Please forget. Now I applied Akio's patch to GHC and compiled Mighty and run it with -N3 in the real world. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8236#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8236: Assertion failure of MarkWeak -------------------------------------+------------------------------------ Reporter: kazu-yamamoto | Owner: Type: bug | Status: new Priority: high | Milestone: 7.8.1 Component: Runtime System | Version: 7.7 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): So do we believe this bug is addressed by the fix in #8242? It certainly looks like it to me. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8236#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8236: Assertion failure of MarkWeak -------------------------------------+------------------------------------ Reporter: kazu-yamamoto | Owner: Type: bug | Status: new Priority: high | Milestone: 7.8.1 Component: Runtime System | Version: 7.7 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 kazu-yamamoto): Mighty is still running. I would like to watch Mighty for two more days to close this ticket. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8236#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8236: Assertion failure of MarkWeak -------------------------------------+------------------------------------ Reporter: kazu-yamamoto | Owner: Type: bug | Status: closed Priority: high | Milestone: 7.8.1 Component: Runtime System | Version: 7.7 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 kazu-yamamoto): * status: new => closed * resolution: => fixed Comment: Happily, Mighty is still running. Great. Let's close this ticket. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8236#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC