[GHC] #14291: Tests tend to fail in the ext-interp way when split sections is enabled

GHC ghc-devs at haskell.org
Thu Oct 5 14:21:09 UTC 2017


#14291: Tests tend to fail in the ext-interp way when split sections is enabled
-------------------------------------+-------------------------------------
        Reporter:  bgamari           |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.4.1
       Component:  Compiler          |              Version:  8.2.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:  13716
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by bgamari):

 Indeed there is some weird stuff that happens before we leave
 `base_GHCziException_zdfShowErrorCallzuzdcshowsPrec_info`:

 We encounter this instruction sequence,
 {{{
 0x00000000415cbdf8 ? mov    0xf(%rbx),%rsi
 0x00000000415cbdfc ? mov    0x7(%rbx),%r14
 0x00000000415cbe00 ? add    $0x8,%rbp
 0x00000000415cbe04 ? jmpq   0x415cbd00
 }}}
 Where
 {{{
 >>> ghc symbol 0x415cbd00
 152 bytes into
 base_GHCziException_zdfExceptionSomeExceptionzuzdctoException_info (starts
 at 0x415cbc68)
 }}}
 There are a few things that are odd about this:
 1. we are jumping into the middle of a procedure
 2. the procedure seems to have nothing to do with showing an `ErrorCall`
 The Haskell this is derived from is,
 {{{#!hs
 instance Show ErrorCall where
   showsPrec _ (ErrorCallWithLocation err "") = showString err
   showsPrec _ (ErrorCallWithLocation err loc) = showString (err ++ '\n' :
 loc)
 }}}
 And the assembler that GHC produces for this particular block is,
 {{{
 block_c4mu_info:
 _c4mu:
         movq 15(%rbx),%rsi
         movq 7(%rbx),%r14
         addq $8,%rbp
         jmp GHC.Exception.$w$cshowsPrec1_info
         .size GHC.Exception.$fShowErrorCall_$cshowsPrec_info,
 .-GHC.Exception.$fShowErrorCall_$cshowsPrec_info
 }}}
 Strangely enough I can't find `GHC.Exception.$w$cshowsPrec1_info` in the
 RTS symbol table.

 According to `objdump` the relocation of the `jmp` looks like,
 {{{
   1eedc4:       e9 00 00 00 00          jmpq   1eedc9 <c4so_info+0x11>
                         1eedc5: R_X86_64_PC32
 base_GHCziException_zdwzdcshowsPrec1_info-0x4
 }}}

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


More information about the ghc-tickets mailing list