[GHC] #8935: Obscure linker bug leads to crash in GHCi

GHC ghc-devs at haskell.org
Tue May 6 19:51:21 UTC 2014


#8935: Obscure linker bug leads to crash in GHCi
-------------------------------------+------------------------------------
        Reporter:  simonmar          |            Owner:  simonmar
            Type:  bug               |           Status:  new
        Priority:  high              |        Milestone:  7.8.3
       Component:  Runtime System    |          Version:  7.8.1-rc2
      Resolution:                    |         Keywords:
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  GHCi crash        |       Difficulty:  Rocket Science
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:
-------------------------------------+------------------------------------

Comment (by trommler):

 Validating on x86_64 Linux:
 {{{
 Unexpected failures:
    codeGen/should_run  cgrun051 [bad exit code] (normal)
    ffi/should_compile  cc004 [stderr mismatch] (normal)
    ffi/should_run      T2276_ghci [bad stdout or stderr] (ghci)
    ghci/scripts        T8696 [bad stderr] (ghci)
    perf/compiler       T3064 [stat not good enough] (normal)
    perf/compiler       T6048 [stat not good enough] (optasm)
 }}}

 So two dynamic linking related test failures: T2276_ghci and T8696.

 T2276_ghci:
 {{{
 =====> T2276_ghci(ghci) 3154 of 3962 [0, 0, 0]
 cd ./ffi/should_run && $MAKE -s --no-print-directory T2276_ghci_setup

 T2276_ghci_c.c:4:1:
      warning: ‘stdcall’ attribute ignored [-Wattributes]
      {
      ^
 cd ./ffi/should_run && '/local/home/peter/ghc-validate/inplace/bin/ghc-
 stage2' -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-
 package-db -rtsopts -fno-ghci-history T2276_ghci.hs --interactive -v0
 -ignore-dot-ghci +RTS -I0.1 -RTS -fobject-code T2276_ghci_c.o
 <T2276_ghci.genscript 1>T2276_ghci.interp.stdout
 2>T2276_ghci.interp.stderr
 Actual stderr output differs from expected:
 --- /dev/null   2014-05-06 16:04:29.720620754 +0200
 +++ ./ffi/should_run/T2276_ghci.run.stderr      2014-05-06
 21:35:41.193750997 +0200
 @@ -0,0 +1,6 @@
 +ghc-stage2: panic! (the 'impossible' happened)
 +  (GHC version 7.9.20140506 for x86_64-unknown-linux):
 +       Loading temp shared object failed: /tmp/ghc18005_0/ghc18005_5.so:
 undefined symbol: test
 +
 }}}
 The warning about `stdcall` is strange.

 and T8696:
 {{{
 =====> T8696(ghci) 3619 of 3962 [0, 0, 0]
 cd ./ghci/scripts && HC='/local/home/peter/ghc-validate/inplace/bin/ghc-
 stage2' HC_OPTS='-dcore-lint -dcmm-lint -dno-debug-output -no-user-
 package-db -rtsopts -fno-ghci-history ' '/local/home/peter/ghc-
 validate/inplace/bin/ghc-stage2' --interactive -v0 -ignore-dot-ghci
 -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-db -rtsopts
 -fno-ghci-history     <T8696.script >T8696.run.stdout 2>T8696.run.stderr
 Actual stderr output differs from expected:
 --- /dev/null   2014-05-06 16:04:29.720620754 +0200
 +++ ./ghci/scripts/T8696.run.stderr     2014-05-06 21:37:54.034299041
 +0200
 @@ -0,0 +1,6 @@
 +ghc-stage2: panic! (the 'impossible' happened)
 +  (GHC version 7.9.20140506 for x86_64-unknown-linux):
 +       Loading temp shared object failed: /tmp/ghc18096_0/ghc18096_4.so:
 undefined symbol: T8696A_a_closure
 +
 }}}

 The performance tests pass when I run them from the command line (I
 validated with `CPUS=4`) and I seem to remember that `cgrun051` exit code
 was discussed on `ghc-devs` recently. I have no idea what to make of
 `cc004` and the warning about `stdcall` calling convention not implemented
 on my platform.

 And last but not least:
 {{{ghc -e 'System.Environment.getEnvironment'}}} does not segfault but
 prints the actual environment.

 I'll prepare a patch and attach it to the ticket.

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


More information about the ghc-tickets mailing list