[GHC] #15529: runtime bug when profiling retainers

#15529: runtime bug when profiling retainers -------------------------------------+------------------------------------- Reporter: flip101 | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 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: -------------------------------------+------------------------------------- I have this project https://github.com/flip111/ghc-runtime-bug1 When i execute the following commands: {{{ stack clean stack build stack build --ghc-options '-j4 -O0 -rtsopts=all -fprof-auto -fprof-auto- calls -fprof-cafs' --executable-profiling stack exec vfix -- +RTS -hr -sstderr }}} After the compilation messages i get the following error: {{{ vfix: internal error: Invalid object *c in pop() (GHC version 8.4.3 for x86_64_unknown_linux) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug Command terminated by signal 6 }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15529 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15529: runtime bug when profiling retainers -------------------------------------+------------------------------------- Reporter: flip101 | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 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 RyanGlScott): Ugh, we really ought to be printing ought what closure types are tripping up these RTS panics. I've submitted Phab:D5072 to do so for `pop()` at least. With a version of GHC built with Phab:D5072 applied, if I try running `vfix +RTS -hr -sstderr`, then I get the following information: {{{ vfix: internal error: Invalid object *c in pop(): 62 (GHC version 8.7.20180816 for x86_64_unknown_linux) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug Aborted (core dumped) }}} It looks like closure type 62 [http://git.haskell.org/ghc.git/blob/5238f204482ac7f05f4e2d2e92576288cc00d42d... corresponds to] `SMALL_MUT_ARR_PTRS_FROZEN_CLEAN`. Any ideas there? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15529#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15529: runtime bug when profiling retainers -------------------------------------+------------------------------------- Reporter: flip101 | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 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 bgamari): Patch coming. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15529#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15529: runtime bug when profiling retainers -------------------------------------+------------------------------------- Reporter: flip101 | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5075 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => patch * differential: => Phab:D5075 Comment: I believe this should do it. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15529#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15529: runtime bug when profiling retainers
-------------------------------------+-------------------------------------
Reporter: flip101 | Owner: (none)
Type: bug | Status: patch
Priority: normal | Milestone: 8.6.1
Component: Compiler | Version: 8.4.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D5075
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#15529: runtime bug when profiling retainers -------------------------------------+------------------------------------- Reporter: flip101 | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5075 Wiki Page: | -------------------------------------+------------------------------------- Comment (by monoidal): I've tried reducing the program so that we could add a testcase. However, the result still has 4 dependencies and it's very fragile. It converts a list to hashset and back; it has a function that ignores its argument; it uses verboseCheckWith with a property that is const True. If any of those are simplified, the panic disappears. I don't see a way to add a sensible test case based on it. For the record, the reduced program is below (needs QuickCheck, text, quickcheck-instances, unordered-containers). {{{ #!hs {-# OPTIONS -Wall #-} module Main (main) where import qualified Data.HashSet as HS import qualified Data.Text.Lazy as T import Test.QuickCheck import Test.QuickCheck.Instances () data T = Ter T.Text [T.Text] deriving (Show) letters :: HS.HashSet Char letters = HS.fromList ['a'..'z'] arbitraryT :: () -> Gen T arbitraryT _ = do a <- elements (HS.toList letters) b <- arbitrary return $ Ter (T.singleton a) b data GroupTemplateDeclaration = GTD T T deriving (Show) instance Arbitrary GroupTemplateDeclaration where arbitrary = do a <- arbitraryT () b <- arbitraryT () return $ GTD a b qcr :: (GroupTemplateDeclaration -> Bool) -> IO () qcr prop = verboseCheckWith (stdArgs { chatty = False }) (property . prop) main :: IO () main = qcr (const True) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15529#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15529: runtime bug when profiling retainers
-------------------------------------+-------------------------------------
Reporter: flip101 | Owner: (none)
Type: bug | Status: patch
Priority: normal | Milestone: 8.6.1
Component: Compiler | Version: 8.4.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D5075
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Krzysztof Gogolewski

#15529: runtime bug when profiling retainers -------------------------------------+------------------------------------- Reporter: flip101 | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5075 Wiki Page: | -------------------------------------+------------------------------------- Changes (by monoidal): * status: patch => merge -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15529#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15529: runtime bug when profiling retainers -------------------------------------+------------------------------------- Reporter: flip101 | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5075 Wiki Page: | -------------------------------------+------------------------------------- Comment (by flip101): The merge does this mean this bug is fixed and closed? I want to remove the repository with my code, i guess it's ok because monoidal was able to find a reduced test case. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15529#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15529: runtime bug when profiling retainers -------------------------------------+------------------------------------- Reporter: flip101 | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5075 Wiki Page: | -------------------------------------+------------------------------------- Comment (by osa1): Yes, this was fixed in master and the patch will be merged to 8.6.1 branch. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15529#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15529: runtime bug when profiling retainers -------------------------------------+------------------------------------- Reporter: flip101 | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5075 Wiki Page: | -------------------------------------+------------------------------------- Comment (by flip101): Thank you for the fix, i will test it soon :) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15529#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15529: runtime bug when profiling retainers -------------------------------------+------------------------------------- Reporter: flip101 | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5075 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged with 76a233143f1ec940f342ce3ce3afaf306923b392. I'm going to close assuming this is fixed. flip101, do let us know if you can still reproduce it. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15529#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15529: runtime bug when profiling retainers -------------------------------------+------------------------------------- Reporter: flip101 | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5075 Wiki Page: | -------------------------------------+------------------------------------- Comment (by flip101): I tried the ghc-8.6 branch but i get build errors. Now it's becomming too difficult to check this for me, i will wait until it lands in stack nightly or if anyone can help. {{{#!bash # # install ghc # sudo apt install git autoconf automake libtool make gcc g++ libgmp-dev ncurses-dev libtinfo-dev python3 xz-utils clang-5.0 clang-6.0 llvm-5.0 llvm-6.0 mkdir ghc-8.6-install git clone --single-branch --branch ghc-8.6 --recursive git://git.haskell.org/ghc.git ghc-8.6 cd ghc-8.6 ./boot PATH=~/.stack/programs/x86_64-linux/ghc-8.4.3/bin:$PATH /usr/bin/time ./configure --prefix=~/haskell/forks/ghc-8.6-install /usr/bin/time make -j3 /usr/bin/time make test THREADS=3 /usr/bin/time make make install # # build project # cd ~/haskell/myproject # version check PATH=~/haskell/forks/ghc-8.6-install/bin:$PATH stack exec ghc --skip-ghc- check --system-ghc --allow-different-user -- --version PATH=~/haskell/forks/ghc-8.6-install/bin:$PATH stack clean --skip-ghc- check --system-ghc --allow-different-user # step with error PATH=~/haskell/forks/ghc-8.6-install/bin:$PATH stack build -j2 --skip-ghc- check --system-ghc --allow-different-user # not-completed steps: PATH=~/haskell/forks/ghc-8.6-install/bin:$PATH stack build -j2 --skip-ghc- check --system-ghc --allow-different-user --ghc-options '-O0 -rtsopts=all -fprof-auto -fprof-auto-calls -fprof-cafs' --executable-profiling PATH=~/haskell/forks/ghc-8.6-install/bin:$PATH stack exec vfix --skip-ghc- check --system-ghc --allow-different-user -- +RTS -hr -sstderr }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15529#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15529: runtime bug when profiling retainers -------------------------------------+------------------------------------- Reporter: flip101 | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5075 Wiki Page: | -------------------------------------+------------------------------------- Changes (by flip101): * Attachment "build cabal error.txt" added. Error building my project with 8.6 branch of ghc -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15529 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15529: runtime bug when profiling retainers -------------------------------------+------------------------------------- Reporter: flip101 | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5075 Wiki Page: | -------------------------------------+------------------------------------- Comment (by MikolajKonarski): User plea: could you milestone this to 8.4.5 once such milestone exists? Ömer says this should be rather safe to merge and possibly it's the last bit needed for my code to retainer and biographical profile correctly (I'm stuck at 8.4 due to Windows Vista compatibility, ghcjs compatiblity and a couple of other packages that haven't yet caught up with 8.6). Thank you! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15529#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15529: runtime bug when profiling retainers -------------------------------------+------------------------------------- Reporter: flip101 | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.4.5 Component: Compiler | Version: 8.4.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5075 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 8.6.1 => 8.4.5 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15529#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15529: runtime bug when profiling retainers -------------------------------------+------------------------------------- Reporter: flip101 | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: 8.4.5 Component: Compiler | Version: 8.4.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5075 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: closed => merge -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15529#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15529: runtime bug when profiling retainers -------------------------------------+------------------------------------- Reporter: flip101 | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: 8.6.3 Component: Compiler | Version: 8.4.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5075 Wiki Page: | -------------------------------------+------------------------------------- Changes (by osa1): * milestone: 8.4.5 => 8.6.3 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15529#comment:16 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15529: runtime bug when profiling retainers -------------------------------------+------------------------------------- Reporter: flip101 | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: 8.6.3 Component: Compiler | Version: 8.4.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5075 Wiki Page: | -------------------------------------+------------------------------------- Comment (by monoidal): osa1: This was already merged to 8.6, does this mean we don't pursue [comment:13 comment:13]? If so, the ticket can be closed. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15529#comment:17 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15529: runtime bug when profiling retainers -------------------------------------+------------------------------------- Reporter: flip101 | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: 8.6.3 Component: Compiler | Version: 8.4.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5075 Wiki Page: | -------------------------------------+------------------------------------- Comment (by osa1): There won't be an 8.4.5 so if this is already merged to 8.6.3 then we can close this. Can anyone confirm that this is merged to 8.6.3 branch and close this? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15529#comment:18 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15529: runtime bug when profiling retainers -------------------------------------+------------------------------------- Reporter: flip101 | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: 8.6.3 Component: Compiler | Version: 8.4.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5075 Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): I'm not sure what you mean by "8.6.3 branch". There's only a `ghc-8.6` branch, and two tagged released (`ghc-8.6.1-release` and `ghc-8.6.2-release`) based on it. If there is an upcoming 8.6.3 release, then presumably it will use the latest commit in the `ghc-8.6` branch, which does contain the commit in question. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15529#comment:19 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15529: runtime bug when profiling retainers -------------------------------------+------------------------------------- Reporter: flip101 | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.3 Component: Compiler | Version: 8.4.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5075 Wiki Page: | -------------------------------------+------------------------------------- Changes (by monoidal): * status: merge => closed Comment: The commit 76a233143 is in `ghc-8.6.1-release` branch, so I'm closing the ticket. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15529#comment:20 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC