Opened 18 months ago

Closed 5 months ago

#8877 closed bug (fixed)

"if this code is reached, the program will abort" in unregisterised build

Reported by: nomeata Owned by:
Priority: normal Milestone: 7.10.1
Component: Compiler Version: 7.8.1-rc2
Keywords: Cc: ptrommler@…, slyfox
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Runtime crash Test Case:
Blocked By: Blocking:
Related Tickets: #8857 Differential Revisions:

Description

Hi,

sparc, when built with dynamic libraries, fails with a segmentation fault: https://buildd.debian.org/status/fetch.php?pkg=ghc&arch=sparc&ver=7.8.20140228-1&stamp=1393975264

Possible cause indicated by

"inplace/bin/ghc-stage1" -static  -H32m -O -lffi -optl-pthread -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -package-name rts -optc-DNOSMP -dcmm-lint      -i -irts -irts/dist/build -irts/dist/build/autogen -Irts/dist/build -Irts/dist/build/autogen           -O2    -c rts/Apply.cmm -o rts/dist/build/Apply.o
/tmp/ghc14927_0/ghc14927_2.hc: In function 'stg_PAP_entry':

/tmp/ghc14927_0/ghc14927_2.hc:101:30:
     warning: function called through a non-compatible type [enabled by default]

/tmp/ghc14927_0/ghc14927_2.hc:101:30:
     note: if this code is reached, the program will abort

It works without shared libraries (see #8857)

Change History (2)

comment:1 Changed 18 months ago by trommler

  • Architecture changed from sparc to Unknown/Multiple
  • Cc ptrommler@… added
  • Summary changed from "if this code is reached, the program will abort" in sparc to "if this code is reached, the program will abort" in unregisterised build
  • Version changed from 7.6.3 to 7.8.1-rc2

I see the same on powerpc64 with dynamic libraries enabled: https://build.opensuse.org/package/live_build_log/home:ptrommler/ghc/openSUSE_Factory_PowerPC_standard/ppc64

Changing architecture accordingly.

comment:2 Changed 5 months ago by thomie

  • Cc slyfox added
  • Milestone set to 7.10.1
  • Resolution set to fixed
  • Status changed from new to closed

This should be fixed, thanks to the following commits:

In commit 78863edbb0751f5c9694ea10c6132a87cfd0ee10:

Author: Sergei Trofimovich <>
Date:   Wed Aug 27 22:20:33 2014 +0300

    Revert "disable shared libs on sparc (linux/solaris) (fixes #8857)"
    
    This reverts commit 623883f1ed0ee11cc925c4590fb09565403fd231.
    
    The commit a93ab43ab5f40cadbedea2f6342b93c245e91434
        driver: pass '-fPIC' option to assembler as well
    fixes shared libraries on sparc at least on linux.
    
    Properly fixes Issue #8857
    
    Signed-off-by: Sergei Trofimovich <[email protected]>

In commit fa31e8f4a0f853848d96549a429083941877bf8d:

Author: Sergei Trofimovich <>
Date:   Sun Dec 14 14:30:12 2014 +0000

    powerpc: fix and enable shared libraries by default on linux
    
    Summary:
    And fix things all the way down to it. Namely:
        - remove 'r30' from free registers, it's an .LCTOC1 register
          for gcc. generated .plt stubs expect it to be initialised.
        - fix PicBase computation, which originally forgot to use 'tmp'
          reg in 'initializePicBase_ppc.fetchPC'
        - mark 'ForeighTarget's as implicitly using 'PicBase' register
          (see comment for details)
        - add 64-bit MO_Sub and test on alloclimit3/4 regtests
        - fix dynamic label offsets to match with .LCTOC1 offset
    
    Signed-off-by: Sergei Trofimovich <[email protected]>
    
    Test Plan: validate passes equal amount of vanilla/dyn tests
    
    Reviewers: simonmar, erikd, austin
    
    Reviewed By: erikd, austin
    
    Subscribers: carter, thomie
    
    Differential Revision: https://phabricator.haskell.org/D560
    
    GHC Trac Issues: #8024, #9831
Note: See TracTickets for help on using tickets.