[GHC] #11784: panic "hscCmmFile: no_mod" with `-v2 and above

#11784: panic "hscCmmFile: no_mod" with `-v2 and above -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Compile-time Unknown/Multiple | crash Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Initailly found this on powerpc when debugging #11773, but it also happens on x86_64. The command line: {{{ inplace/bin/ghc-stage1 -static -H64m -O0 -Wall -v2 -Iincludes \ -Iincludes/dist -Iincludes/dist-derivedconstants/header \ -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build \ -DCOMPILING_RTS -this-unit-id rts -optc-DNOSMP -dcmm-lint -i -irts \ -irts/dist/build -irts/dist/build/autogen -Irts/dist/build \ -Irts/dist/build/autogen -O2 -Wnoncanonical-monad-instances -c\ rts/StgStartup.cmm -o rts/dist/build/StgStartup.o }}} panics with a message: {{{ ghc-stage1: panic! (the 'impossible' happened) (GHC version 8.1.20160402 for powerpc-unknown-linux): hscCmmFile: no_mod }}} The only thing that was added to the command line that is different from the normal build command is the `-v2`. This is caused by the code (in compiler/main/HscMain.hs): {{{ no_mod = panic "hscCmmFile: no_mod" }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11784 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11784: panic "hscCmmFile: no_mod" with `-v2 and above -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: high | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * priority: normal => high Comment: This is a regression from 7.10.3. To reproduce, create an empty file called `Test.cmm`. Then run: {{{ $ ghc-8.0.1 -c -dcmm-lint Test.cmm -v2 ... ghc: panic! (the 'impossible' happened) (GHC version 8.0.0.20160511 for x86_64-unknown-linux): hscCmmFile: no_mod }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11784#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11784: panic "hscCmmFile: no_mod" with `-v2 and above -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: high | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): This is really quite a bad bug sine it hinders one's the ability to debug the compiler. We should really make sure this is fixed for 8.2. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11784#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11784: panic "hscCmmFile: no_mod" with `-v2 and above -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: high | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): The problem here is that `hscCompileCmmFile` needs a `Module` to give to `CodeOutput.codeOutput`. The downstream uses of this `Module` are, * `outputForeignStubs`: needs a string to form the stem of the stub filename * `PIC.howToAccessLabel`: calls `CLabel.labelDynamic`, which, * then wants to compare it against another `Module` taken from a `HpcTicksLabel` * and uses it to call `Packages.isDllName` Given that `PIC.howToAccessLabel` hasn't blowing up due to the bottoming `Module`s we give it for C-- files, I suppose it should be safe for `hscCompileCmmFile` to simply make up a module name to give to the backend. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11784#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11784: panic "hscCmmFile: no_mod" with `-v2 and above -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: patch Priority: high | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2864 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => patch * differential: => Phab:D2864 Comment: Here's a patch that carries out the proposal in comment:3. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11784#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11784: panic "hscCmmFile: no_mod" with `-v2 and above
-------------------------------------+-------------------------------------
Reporter: erikd | Owner:
Type: bug | Status: patch
Priority: high | Milestone: 8.2.1
Component: Compiler | Version: 8.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Compile-time | Unknown/Multiple
crash | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D2864
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#11784: panic "hscCmmFile: no_mod" with `-v2 and above -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: closed Priority: high | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2864 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed Comment: Done! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11784#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC