[GHC] #8974: 64 bit windows executable built with ghc-7.9.20140405+LLVM segfaults

GHC ghc-devs at haskell.org
Thu Apr 10 10:59:16 UTC 2014


#8974: 64 bit windows executable built with ghc-7.9.20140405+LLVM segfaults
------------------------------------+----------------------------------
        Reporter:  awson            |            Owner:
            Type:  bug              |           Status:  new
        Priority:  high             |        Milestone:  7.8.2
       Component:  Compiler (LLVM)  |          Version:  7.9
      Resolution:                   |         Keywords:
Operating System:  Windows          |     Architecture:  x86_64 (amd64)
 Type of failure:  Runtime crash    |       Difficulty:  Unknown
       Test Case:                   |       Blocked By:
        Blocking:                   |  Related Tickets:
------------------------------------+----------------------------------

Comment (by awson):

 I've decided to investigate things further. After firing GDB I've seen a
 painfully familiar picture of what I saw at #8834.

 Looking into LLVM codegen code i see
 [http://git.haskell.org/ghc.git/blob/HEAD:/compiler/llvmGen/LlvmCodeGen/CodeGen.hs#l1566
 ... For Caller save registers across C calls the saving and restoring of
 them is done by the Cmm code generator, using Cmm local vars. So to stop
 LLVM saving them as well (and saving all of them since it thinks they're
 always live, we trash them just before the call by assigning the 'undef'
 value to them. The ones we need are restored from the Cmm local var and
 the ones we don't need are fine to be trashed.]

 But recent #8834 saga teach us that after
 [http://git.haskell.org/ghc.git/blobdiff/66aa489fcbfca30dc3c3b553fce4f1e4debfb7c1..ad15c2b4bd37082ce989268b3d2f86a2cd34386a:/compiler/cmm/CmmSink.hs]
 this already is not the case. And after this
 [http://git.haskell.org/ghc.git/commitdiff/c4eeacdfdf4578eb6e75bbf2e067bfe70ec94ab0
 NCG became responsible for saving registers across the C call].

 It looks LLVM backend still does not take this into account.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8974#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list