[GHC] #7588: GHC HEAD built with LLVM on Mac OS X miscompiles RTS: SIGSEGV in stg_PAP_apply

#7588: GHC HEAD built with LLVM on Mac OS X miscompiles RTS: SIGSEGV in stg_PAP_apply --------------------------+------------------------------------------------- Reporter: thoughtpolice | Owner: Type: bug | Status: new Priority: normal | Component: Compiler (LLVM) Version: 7.7 | Keywords: sigsegv Os: MacOS X | Architecture: Unknown/Multiple Failure: Runtime crash | Blockedby: 7571, 7580 Blocking: | Related: --------------------------+------------------------------------------------- After fixing #7571 and #7580, with those two patches, I now get a working stage1 compiler that can produce binaries using the LLVM backend. But all of them segfault: {{{ $ cat no-op.hs main = return () $ ~/code/haskell/ghc/inplace/bin/ghc-stage1 -fforce-recomp -fllvm no-op.hs [1 of 1] Compiling Main ( no-op.hs, no-op.o ) Linking no-op ... $ ./no-op [1] 12434 segmentation fault ./no-op $ }}} This looks like an error in stg_PAP_apply: {{{ gdb -q ./no-op ⏎ Reading symbols for shared libraries .... done (gdb) r Starting program: /Users/a/t/no-op Reading symbols for shared libraries +++............................. done Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: 13 at address: 0x0000000000000000 0x00000001002917d4 in stg_PAP_apply () (gdb) }}} I imagine this is due to some miscompilation of ```rts/Apply.cmm``` using LLVM. I'll rebuild the stage1 compiler with debugging support for sanity, and also enable the debug RTS in the test, and report back soon. (I imagine this failure is certainly possible *because* of my patches in the other tickets, although my intuition tells me those are strictly correctness fixes and something else is afoot here.) -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7588 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7588: GHC HEAD built with LLVM on Mac OS X miscompiles RTS: SIGSEGV in stg_PAP_apply --------------------------+------------------------------------------------- Reporter: thoughtpolice | Owner: Type: bug | Status: new Priority: normal | Component: Compiler (LLVM) Version: 7.7 | Keywords: sigsegv Os: MacOS X | Architecture: Unknown/Multiple Failure: Runtime crash | Blockedby: 7571, 7580 Blocking: | Related: --------------------------+------------------------------------------------- Comment(by thoughtpolice): The stage1 compiler and RTS were both compiled with LLVM 3.2, btw. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7588#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7588: GHC HEAD built with LLVM on Mac OS X miscompiles RTS: SIGSEGV in stg_PAP_apply --------------------------+------------------------------------------------- Reporter: thoughtpolice | Owner: Type: bug | Status: new Priority: normal | Component: Compiler (LLVM) Version: 7.7 | Keywords: sigsegv Os: MacOS X | Architecture: Unknown/Multiple Failure: Runtime crash | Blockedby: 7571, 7580 Blocking: | Related: --------------------------+------------------------------------------------- Comment(by dterei): Yes, when this occurs it has always been due to a miscompilation of a handwritten cmm file. Apply.cmm or Update.cmm are usual culprits. You could also check that the mangler is still working fine, that may be another issue. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7588#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7588: GHC HEAD built with LLVM on Mac OS X miscompiles RTS: SIGSEGV in stg_PAP_apply --------------------------+------------------------------------------------- Reporter: thoughtpolice | Owner: Type: bug | Status: new Priority: normal | Component: Compiler (LLVM) Version: 7.7 | Keywords: sigsegv Os: MacOS X | Architecture: Unknown/Multiple Failure: Runtime crash | Blockedby: 7571, 7580 Blocking: | Related: --------------------------+------------------------------------------------- Comment(by thoughtpolice): Great, thanks for the reaffirmation, David. I'll look into it later tonight and investigate further. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7588#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7588: GHC HEAD built with LLVM on Mac OS X miscompiles RTS: SIGSEGV in stg_PAP_apply --------------------------+------------------------------------------------- Reporter: thoughtpolice | Owner: Type: bug | Status: infoneeded Priority: normal | Component: Compiler (LLVM) Version: 7.7 | Keywords: sigsegv Os: MacOS X | Architecture: Unknown/Multiple Failure: Runtime crash | Blockedby: 7571, 7580 Blocking: 7590 | Related: --------------------------+------------------------------------------------- Changes (by dterei): * status: new => infoneeded Comment: Austin, can you confirm if this occurs still with HEAD? -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7588#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7588: GHC HEAD built with LLVM on Mac OS X miscompiles RTS: SIGSEGV in stg_PAP_apply --------------------------+------------------------------------------------- Reporter: thoughtpolice | Owner: Type: bug | Status: infoneeded Priority: normal | Component: Compiler (LLVM) Version: 7.7 | Keywords: sigsegv Os: MacOS X | Architecture: Unknown/Multiple Failure: Runtime crash | Blockedby: 7571, 7580 Blocking: 7590 | Related: --------------------------+------------------------------------------------- Comment(by thoughtpolice): Yes, I saw your patches go by. Thanks a lot! I'll ```./validate``` with the latest HEAD and see how far I get. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7588#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7588: GHC HEAD built with LLVM on Mac OS X miscompiles RTS: SIGSEGV in stg_PAP_apply ---------------------------------+------------------------------------------ Reporter: thoughtpolice | Owner: Type: bug | Status: closed Priority: normal | Component: Compiler (LLVM) Version: 7.7 | Resolution: fixed Keywords: sigsegv | Os: MacOS X Architecture: Unknown/Multiple | Failure: Runtime crash Blockedby: 7571, 7580 | Blocking: 7590 Related: | ---------------------------------+------------------------------------------ Changes (by thoughtpolice): * status: infoneeded => closed * resolution: => fixed Comment: I just ran validate on the latest copy of HEAD. This is fixed and the stage2 compiler is running the testsuite now. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7588#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC