[GHC] #12562: GHC panic on rebuild (idInfo r_XsTP)

#12562: GHC panic on rebuild (idInfo r_XsTP) -------------------------------------+------------------------------------- Reporter: cocreature | 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: -------------------------------------+------------------------------------- First of all let me apologize for the terrible testcase. I tried to find a smaller one (and am still trying) but haven’t managed to do so. The good news is that at least for me it’s reproducible === Steps to reproduce === {{{ git clone 'git@github.com:bscarlet/llvm-general.git' -b llvm-3.8 cd llvm-general cabal new-build llvm-general curl -s https://gist.githubusercontent.com/cocreature/c6807d7906756a2d58b8fe774141bf...
out.patch git apply out.patch cabal new-build llvm-general }}}
The patch just adds a newline somewhere to create a rebuild. I’ve seen this panic for completely different changes (all in this project) so I don’t think the change matters. I’ve also seen this panic with stack, cabal new-build and cabal build (using sandboxes). === Output === {{{ In order, the following will be built (use -v for more details): llvm-general-3.8.0.0 Preprocessing library llvm-general-3.8.0.0... [84 of 92] Compiling LLVM.General.Internal.Module ( src/LLVM/General/Internal/Module.hs, /home/moritz/tmp/llvm-general/dist- newstyle/build/llvm-general-3.8.0.0/build/LLVM/General/Internal/Module.o ) [85 of 92] Compiling LLVM.General.Module ( src/LLVM/General/Module.hs, /home/moritz/tmp/llvm-general/dist-newstyle/build/llvm- general-3.8.0.0/build/LLVM/General/Module.o ) [LLVM.General.Internal.Module changed] [89 of 92] Compiling LLVM.General.Internal.PassManager ( src/LLVM/General/Internal/PassManager.hs, /home/moritz/tmp/llvm-general /dist-newstyle/build/llvm- general-3.8.0.0/build/LLVM/General/Internal/PassManager.o ) [TH] ghc: panic! (the 'impossible' happened) (GHC version 8.0.1 for x86_64-unknown-linux): idInfo r_XsTP Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} === Comments === In this case this can be resolved by running cabal new-build again. However I’ve also had cases where this didn’t fix it and I had to blow away dist-newstyle. I haven’t yet managed to find a reproducible testcase for the latter. Matthew Pickering mentioned that he encountered this (or a similar) bug while building GHC. I tried core-lint but that didn’t help. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12562 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12562: GHC panic on rebuild (idInfo r_XsTP) -------------------------------------+------------------------------------- Reporter: cocreature | 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: | -------------------------------------+------------------------------------- Changes (by cocreature): * Attachment "out.log" added. Build log with -v3 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12562 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12562: GHC panic on rebuild (idInfo r_XsTP) -------------------------------------+------------------------------------- Reporter: cocreature | 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 cocreature): Switching back and forth between applying and reverting the patch causes the same panic each time (that’s a lot faster than rebuilding completely each time). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12562#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12562: GHC panic on rebuild (idInfo r_XsTP) -------------------------------------+------------------------------------- Reporter: cocreature | 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: | -------------------------------------+------------------------------------- Description changed by cocreature: @@ -8,1 +8,2 @@ - git clone 'git@github.com:bscarlet/llvm-general.git' -b llvm-3.8 + -- Install llvm-3.8 + git clone 'https://github.com/bscarlet/llvm-general.git' -b llvm-3.8 New description: First of all let me apologize for the terrible testcase. I tried to find a smaller one (and am still trying) but haven’t managed to do so. The good news is that at least for me it’s reproducible === Steps to reproduce === {{{ -- Install llvm-3.8 git clone 'https://github.com/bscarlet/llvm-general.git' -b llvm-3.8 cd llvm-general cabal new-build llvm-general curl -s https://gist.githubusercontent.com/cocreature/c6807d7906756a2d58b8fe774141bf...
out.patch git apply out.patch cabal new-build llvm-general }}}
The patch just adds a newline somewhere to create a rebuild. I’ve seen this panic for completely different changes (all in this project) so I don’t think the change matters. I’ve also seen this panic with stack, cabal new-build and cabal build (using sandboxes). === Output === {{{ In order, the following will be built (use -v for more details): llvm-general-3.8.0.0 Preprocessing library llvm-general-3.8.0.0... [84 of 92] Compiling LLVM.General.Internal.Module ( src/LLVM/General/Internal/Module.hs, /home/moritz/tmp/llvm-general/dist- newstyle/build/llvm-general-3.8.0.0/build/LLVM/General/Internal/Module.o ) [85 of 92] Compiling LLVM.General.Module ( src/LLVM/General/Module.hs, /home/moritz/tmp/llvm-general/dist-newstyle/build/llvm- general-3.8.0.0/build/LLVM/General/Module.o ) [LLVM.General.Internal.Module changed] [89 of 92] Compiling LLVM.General.Internal.PassManager ( src/LLVM/General/Internal/PassManager.hs, /home/moritz/tmp/llvm-general /dist-newstyle/build/llvm- general-3.8.0.0/build/LLVM/General/Internal/PassManager.o ) [TH] ghc: panic! (the 'impossible' happened) (GHC version 8.0.1 for x86_64-unknown-linux): idInfo r_XsTP Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} === Comments === In this case this can be resolved by running cabal new-build again. However I’ve also had cases where this didn’t fix it and I had to blow away dist-newstyle. I haven’t yet managed to find a reproducible testcase for the latter. Matthew Pickering mentioned that he encountered this (or a similar) bug while building GHC. I tried core-lint but that didn’t help. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12562#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12562: GHC panic on rebuild (idInfo r_XsTP) -------------------------------------+------------------------------------- Reporter: cocreature | Owner: cocreature 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: | -------------------------------------+------------------------------------- Changes (by cocreature): * owner: => cocreature Comment: I am making progress in isolating the bug and hope to have a much smaller testcase in the next few days. In the mean time I’m assigning this issue to myself so that other people don’t waste their time on that ugly testcase. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12562#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12562: GHC panic on rebuild (idInfo r_XsTP) -------------------------------------+------------------------------------- Reporter: cocreature | Owner: cocreature 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): Thanks. I did try the above but failed with {{{ setup: The program 'llvm-config' version ==3.8.* is required but the version found at /usr/bin/llvm-config is version 2.9 }}} So I can't reproduce without updgrading my Unix box, which I don't own. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12562#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12562: GHC panic on rebuild (idInfo r_XsTP) -------------------------------------+------------------------------------- Reporter: cocreature | 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: | -------------------------------------+------------------------------------- Changes (by cocreature): * owner: cocreature => @@ -1,4 +1,0 @@ - First of all let me apologize for the terrible testcase. I tried to find a - smaller one (and am still trying) but haven’t managed to do so. The good - news is that at least for me it’s reproducible - @@ -8,2 +4,1 @@ - -- Install llvm-3.8 - git clone 'https://github.com/bscarlet/llvm-general.git' -b llvm-3.8 + git clone 'https://github.com/cocreature/llvm-general.git' -b ghc-panic New description: === Steps to reproduce === {{{ git clone 'https://github.com/cocreature/llvm-general.git' -b ghc-panic cd llvm-general cabal new-build llvm-general curl -s https://gist.githubusercontent.com/cocreature/c6807d7906756a2d58b8fe774141bf...
out.patch git apply out.patch cabal new-build llvm-general }}}
The patch just adds a newline somewhere to create a rebuild. I’ve seen this panic for completely different changes (all in this project) so I don’t think the change matters. I’ve also seen this panic with stack, cabal new-build and cabal build (using sandboxes). === Output === {{{ In order, the following will be built (use -v for more details): llvm-general-3.8.0.0 Preprocessing library llvm-general-3.8.0.0... [84 of 92] Compiling LLVM.General.Internal.Module ( src/LLVM/General/Internal/Module.hs, /home/moritz/tmp/llvm-general/dist- newstyle/build/llvm-general-3.8.0.0/build/LLVM/General/Internal/Module.o ) [85 of 92] Compiling LLVM.General.Module ( src/LLVM/General/Module.hs, /home/moritz/tmp/llvm-general/dist-newstyle/build/llvm- general-3.8.0.0/build/LLVM/General/Module.o ) [LLVM.General.Internal.Module changed] [89 of 92] Compiling LLVM.General.Internal.PassManager ( src/LLVM/General/Internal/PassManager.hs, /home/moritz/tmp/llvm-general /dist-newstyle/build/llvm- general-3.8.0.0/build/LLVM/General/Internal/PassManager.o ) [TH] ghc: panic! (the 'impossible' happened) (GHC version 8.0.1 for x86_64-unknown-linux): idInfo r_XsTP Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} === Comments === In this case this can be resolved by running cabal new-build again. However I’ve also had cases where this didn’t fix it and I had to blow away dist-newstyle. I haven’t yet managed to find a reproducible testcase for the latter. Matthew Pickering mentioned that he encountered this (or a similar) bug while building GHC. I tried core-lint but that didn’t help. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12562#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12562: GHC panic on rebuild (idInfo r_XsTP) -------------------------------------+------------------------------------- Reporter: cocreature | 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 cocreature): I’ve managed to make the testcase smaller and most importantly reduce the dependency on LLVM, so it should be a lot easier to build it on various platforms. I’ve updated the instructions in the issue description. The project is still not exactly small but when I tried reducing it the panic went away. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12562#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12562: GHC panic on rebuild (idInfo r_XsTP) -------------------------------------+------------------------------------- Reporter: cocreature | 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): Thanks. But the issue description looks unchanged. What are the new instructions? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12562#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12562: GHC panic on rebuild (idInfo r_XsTP) -------------------------------------+------------------------------------- Reporter: cocreature | 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 mpickering): The instructions in the ticket are the right ones. I managed to reproduce the issue and there is no dependency on llvm. It looked like the problem was somewhere in `CorePrep` but this isn't an informed opinion, just by looking at the output of `-v5`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12562#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12562: GHC panic on rebuild (idInfo r_XsTP) -------------------------------------+------------------------------------- Reporter: cocreature | 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): But instructions look the same. Perhpas you mean `llvm-general` no longer depends on llvm, despite its name? So the instructions are unchanged but `llvm-general.git` has changed? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12562#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12562: GHC panic on rebuild (idInfo r_XsTP) -------------------------------------+------------------------------------- Reporter: cocreature | 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 mpickering): Yes that's right. Moritz reduced the testcase and changed the URL of the repository you need to clone. If you look at the commit history of the branch it now points to, there are a lot of commits removing code. https://github.com/cocreature/llvm-general/commits/ghc-panic -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12562#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12562: GHC panic on rebuild (idInfo r_XsTP) -------------------------------------+------------------------------------- Reporter: cocreature | 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 cocreature): The only changes I made to the instructions are changing the url and the branch which now point to the one linked by mpickering where I tried to remove as much code as possible and stub things with undefined while still being able to reproduce this. I also removed the requirement to install LLVM from the instructions since this is no longer necessary. Also it is now only a single cabal project so it is easy to just use a normal `cabal build` rather than `cabal new-build` and you can reproduce the issue that way too (I tried this). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12562#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12562: GHC panic on rebuild (idInfo r_XsTP) -------------------------------------+------------------------------------- Reporter: cocreature | 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): Thank you so much for making a reproducible test case -- I know it takes work to do that. There was a real bug, involving accidental name capture in the worker/wrapper pass. It only occurred under very obscure circumstances, which is why it's so hard to reproduce. Patch coming. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12562#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12562: GHC panic on rebuild (idInfo r_XsTP)
-------------------------------------+-------------------------------------
Reporter: cocreature | 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 Simon Peyton Jones

#12562: GHC panic on rebuild (idInfo r_XsTP) -------------------------------------+------------------------------------- Reporter: cocreature | Owner: Type: bug | Status: merge 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: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => merge Comment: Nailed it at last. Thank you for taking so much trouble to making a repro case. Merge to 8.0 if poss. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12562#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12562: GHC panic on rebuild (idInfo r_XsTP) -------------------------------------+------------------------------------- Reporter: cocreature | Owner: Type: bug | Status: merge 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 cocreature): Thank you for fixing it! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12562#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12562: GHC panic on rebuild (idInfo r_XsTP) -------------------------------------+------------------------------------- Reporter: cocreature | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 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): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed * milestone: => 8.0.2 Comment: Merged to `ghc-8.0` as 8ab454d9a39655d34664be6e65a67e1697dc17bf. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12562#comment:16 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC