#13100 closed bug (fixed)

Instability in 8.0.2 on 32-bit Windows

Reported by: bgamari Owned by:
Priority: normal Milestone: 8.0.3
Component: Compiler Version: 8.0.2
Keywords: Cc: Phyx-
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash or panic Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

The 32-bit Windows build usually segfaults when building Haddock.

A bisection reveals,

$ git bisect log
git bisect start
# good: [4986837f8168cacf95c24fecc84d7b36c47f3c11] rules/build-prog: Ensure programs depend upon their transitive deps
git bisect good 4986837f8168cacf95c24fecc84d7b36c47f3c11
# bad: [fb0f4cf66f3fc7590821e6688440bf86c25aced1] Install toplevel handler inside fork.
git bisect bad fb0f4cf66f3fc7590821e6688440bf86c25aced1
# good: [2086d86674324c0f5f21e23acbe26f4517843f57] Fix Windows build after Ticky changes
git bisect good 2086d86674324c0f5f21e23acbe26f4517843f57
# good: [8f8f0b62ec106b0d503240c4cb7510a7cb4ddbb6] Fix Windows build after Ticky changes
git bisect good 8f8f0b62ec106b0d503240c4cb7510a7cb4ddbb6
# good: [b688f0056a1694bb0db3ca2b84ab5505ba9947d7] Fix handling of package-db entries in .ghc.environment files, etc.
git bisect good b688f0056a1694bb0db3ca2b84ab5505ba9947d7
# good: [b688f0056a1694bb0db3ca2b84ab5505ba9947d7] Fix handling of package-db entries in .ghc.environment files, etc.
git bisect good b688f0056a1694bb0db3ca2b84ab5505ba9947d7
# good: [c904258319b8eb6e47ba727c667bca765537802b] runghc: use executeFile to run ghc process on POSIX
git bisect good c904258319b8eb6e47ba727c667bca765537802b
# good: [c904258319b8eb6e47ba727c667bca765537802b] runghc: use executeFile to run ghc process on POSIX
git bisect good c904258319b8eb6e47ba727c667bca765537802b
# good: [28c62bb588f7026d9985afe235cbeec5e3fd9a76] Fix Trac #12797: approximateWC
git bisect good 28c62bb588f7026d9985afe235cbeec5e3fd9a76
# bad: [6bee8644d959ec77745d835c8c4453f2147bd8d7] rts: Fix build when linked with gold
git bisect bad 6bee8644d959ec77745d835c8c4453f2147bd8d7
# good: [60c299a2278c351abed1ea51a1c2ee5459033fa9] Pass --no-pie to GCC
git bisect good 60c299a2278c351abed1ea51a1c2ee5459033fa9
# bad: [cca8ceec97d6b8b031dec837825b97609dd7288f] Read parentheses better
git bisect bad cca8ceec97d6b8b031dec837825b97609dd7288f
# bad: [fefe02c0324a25a52455a61f7f6e48be6d82d1ab] Pass -no-pie to GCC
git bisect bad fefe02c0324a25a52455a61f7f6e48be6d82d1ab
# good: [3da461d9ddc8ff6fe14ee9572b617d8e3753de2e] Revert "Pass --no-pie to GCC"
git bisect good 3da461d9ddc8ff6fe14ee9572b617d8e3753de2e
# first bad commit: [fefe02c0324a25a52455a61f7f6e48be6d82d1ab] Pass -no-pie to GCC

Change History (11)

comment:1 Changed 11 months ago by Phyx-

Cc: Phyx- added; Phyx removed

comment:2 Changed 11 months ago by bgamari

Indeed it seems that fefe02c0324a25a52455a61f7f6e48be6d82d1ab is the culprit.

comment:3 Changed 11 months ago by bgamari

Phyx noted that the patch inadvertently removes a linker flag on Windows,

  • compiler/main/SysTools.hs

    diff --git a/compiler/main/SysTools.hs b/compiler/main/SysTools.hs
    index 236bcfd..1ab5b13 100644 (file)
    a b getLinkerInfo' dflags = do 
    858860                     -- Note [Windows stack usage]
    859861                     -- Force static linking of libGCC
    860862                     -- Note [Windows static libGCC]
    861                    , "-Xlinker", "--stack=0x800000,0x800000", "-static-libgcc" ]
     863                   , "-static-libgcc" ]
    862864               _ -> do
    863865                 -- In practice, we use the compiler as the linker here. Pass
    864866                 -- -Wl,--version to get linker version info.

I'm going to try reverting this bit.

comment:4 Changed 11 months ago by bgamari

Indeed reverting the hunk mentioned in comment:3 seems to have fixed things.

Last edited 11 months ago by bgamari (previous) (diff)

comment:5 Changed 11 months ago by bgamari

For the record, this -Xlinker change was likely introduced due to a conflict with 7b211b4e5a38efca437d76ea442495370da7cc9a while backporting the -fPIE patch. See #8870 and #12186 for the reason behind the -Xlinker flag.

Last edited 11 months ago by bgamari (previous) (diff)

comment:6 Changed 11 months ago by Phyx-

I think you mean f0af58df4b5d5ace750e7d7a91ad471284c1b429 The commit you quoted merely touched the same line.

comment:7 Changed 11 months ago by bgamari

I had meant that the commit I cited was the cause of the conflict. f0af58df4b5d5ace750e7d7a91ad471284c1b429 is indeed the original patch introducing the -Xlinker flag.

comment:8 Changed 11 months ago by Phyx-

Ah, sorry, misread :)

comment:9 Changed 11 months ago by bgamari

Milestone: 8.0.28.0.3
Version: 8.0.18.0.2

comment:10 Changed 11 months ago by awson

#13108 could help, perhaps.

comment:11 Changed 11 months ago by bgamari

Resolution: fixed
Status: newclosed

The 8.0.2 Windows builds were released with an unfortunate ad-hoc patch (b0dccaccb304541e7f56d702bfbf65e18b98c05d) reverting the inadvertent change. The patch is present in the ghc-8.0 branch so this should be fixed in a future 8.0.3 release.

Note: See TracTickets for help on using tickets.