[GHC] #10174: AArch64 : ghc-stage2 segfaults compiling libraries/parallel
#10174: AArch64 : ghc-stage2 segfaults compiling libraries/parallel -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.11 Keywords: | Operating System: Unknown/Multiple Architecture: aarch64 | Type of failure: Building GHC Test Case: | failed Blocking: | Blocked By: Differential Revisions: | Related Tickets: -------------------------------------+------------------------------------- Compiling git HEAD (e02ef0e6d4eefa5f0) on AArch64 hardware using ghc-7.6.3 from Debian as the bootstrap compiler. LLVM is version 3.6. It fails with: {{{ "inplace/bin/ghc-stage2" -hisuf hi -osuf o -hcsuf hc -static -H64m -O0 -fllvm \ -this-package-key paral_2NTMt5X9WUG6LNupBFIZti -hide-all-packages -i \ -ilibraries/parallel/. -ilibraries/parallel/dist-install/build \ -ilibraries/parallel/dist-install/build/autogen \ -Ilibraries/parallel/dist-install/build \ -Ilibraries/parallel/dist-install/build/autogen -Ilibraries/parallel/. \ -optP-include -optPlibraries/parallel/dist- install/build/autogen/cabal_macros.h \ -package-key array_BLJREAlFJ4zJ2kSDphVieY -package-key base_8gvrDSBdaidLA14EDtK6ja \ -package-key conta_1uqbEcrmZiO1C91Z8ePoyI -package-key deeps_Bw45clVBNVT4S1LLyUOPfh \ -Wall -feager-blackholing -XHaskell2010 -O -fllvm -no-user-package- db -rtsopts \ -odir libraries/parallel/dist-install/build \ -hidir libraries/parallel/dist-install/build \ -stubdir libraries/parallel/dist-install/build \ -dynamic-too -c libraries/parallel/./Control/Parallel/Strategies.hs \ -o libraries/parallel/dist- install/build/Control/Parallel/Strategies.o \ -dyno libraries/parallel/dist- install/build/Control/Parallel/Strategies.dyn_o libraries/parallel/ghc.mk:5: recipe for target 'libraries/parallel/dist-install/build/Control/Parallel/Strategies.o' failed make[1]: *** [libraries/parallel/dist- install/build/Control/Parallel/Strategies.o] Segmentation fault }}} It seems that `inplace/lib/bin/ghc-stage1` (which is working fine) is statically linked to all the Haskell libraries where as `inplace/lib/bin /ghc-stage2` is dynamically linked which would explain why stage1 works fine and stage2 segfaults. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10174> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10174: AArch64 : ghc-stage2 segfaults compiling libraries/parallel ----------------------------------------+---------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: aarch64 Type of failure: Building GHC failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: ----------------------------------------+---------------------------------- Comment (by erikd): Running the above `ghc-stage2` command under gdb and grabbing the backtrace results in: {{{ Program received signal SIGSEGV, Segmentation fault. 0x00290108d000a388 in ?? () (gdb) bt X0 0x00290108d000a388 in ?? () X1 0x0000000002b7b940 in StgRun (f=<optimized out>, f@entry=0x2b8a788 <stg_returnToStackTop$def>, basereg=<optimized out>) at rts/StgCRun.c:81 X2 0x0000000002b7e114 in schedule (initialCapability=initialCapability@entry=0x3975a40 <MainCapability>, task=task@entry=0x39a7470) at rts/Schedule.c:463 X3 0x0000000002b7ef5c in scheduleWaitThread (tso=0x7fb7c0b388, ret=ret@entry=0x0, pcap=pcap@entry=0x7ffffff4d8) at rts/Schedule.c:2380 X4 0x0000000002b75698 in rts_evalLazyIO (cap=cap@entry=0x7ffffff4d8, p=p@entry=0x2f79bc0 <ZCMain_main_closure>, ret=ret@entry=0x0) at rts/RtsAPI.c:500 X5 0x0000000002b80428 in hs_main (argc=49, argv=0x7ffffff688, main_closure=0x2f79bc0 <ZCMain_main_closure>, rts_config=...) at rts/RtsMain.c:64 X6 0x000000000042ea9c in main () }}} which suggests something going awry in `StgRun`. In addition, running the above command under gdb showed that 3 extra threads were being started whereas, if `ghc-stage2` is replaced with `ghc- stage1` and run, only a single thread (the initial host thread) is started. This on the other hand suggests a threading problem. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10174#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10174: AArch64 : ghc-stage2 segfaults compiling libraries/parallel ----------------------------------------+---------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: aarch64 Type of failure: Building GHC failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: ----------------------------------------+---------------------------------- Comment (by erikd): Compiling with `BuildFlavour` of `quick-llvm` but with the addition of `DYNAMIC_BY_DEFAULT` and `DYNAMIC_GHC_PROGRAMS` being set to `NO` so this is not a problem with the dynamic linker. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10174#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10174: AArch64 : ghc-stage2 segfaults compiling libraries/parallel ----------------------------------------+---------------------------------- Reporter: erikd | Owner: erikd Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: aarch64 Type of failure: Building GHC failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: ----------------------------------------+---------------------------------- Changes (by erikd): * owner: => erikd Comment: Currently `ghc-stage2` segfaults when compiling the file `libraries/parallel/Control/Parallel/Strategies.hs`. However, following programs not only compile but also run correctly when compiled with the `-threaded` flag: * Simple "hello world" program. * Simple program that uses `forkIO` to create a couple of threads and `threadDelay` to exercise the threading before printing something and exiting. This means I cannot find any small clean test case and will have to debug GHC itself. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10174#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10174: AArch64 : ghc-stage2 segfaults compiling libraries/parallel ----------------------------------------+---------------------------------- Reporter: erikd | Owner: erikd Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: aarch64 Type of failure: Building GHC failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: ----------------------------------------+---------------------------------- Comment (by rwbarton): It could be a problem with GC then, I remember some crashes with dll-split that were not reproduceable with "hello world" and the reason was that GC never ran in the latter. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10174#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10174: AArch64 : ghc-stage2 segfaults compiling libraries/parallel ----------------------------------------+---------------------------------- Reporter: erikd | Owner: erikd Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: aarch64 Type of failure: Building GHC failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: ----------------------------------------+---------------------------------- Comment (by erikd): This is very strange! The failures I was getting was with `BuildFlavour = quick-llvm` but when I changed that to `BuildFlavour = perf-llvm` it build to completion. Currently rebuilding with `quick-llvm` to make sure that's what it is and not the couple of patches I just pulled. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10174#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10174: AArch64 : ghc-stage2 segfaults compiling libraries/parallel ----------------------------------------+---------------------------------- Reporter: erikd | Owner: erikd Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: aarch64 Type of failure: Building GHC failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: ----------------------------------------+---------------------------------- Comment (by erikd): Confirmed. On Arm64, building as `quick-llvm` results in a `ghc-stage2` that segfaults building `libraries/parallel` but building `perf-llvm` works fine. On amd64, both `quick-llvm` and `perf-llvm` work fine. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10174#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10174: AArch64 : ghc-stage2 segfaults compiling libraries/parallel ----------------------------------------+------------------------------- Reporter: erikd | Owner: erikd Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: aarch64 Type of failure: Building GHC failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------------+------------------------------- Changes (by bgamari): * milestone: 8.0.1 => 8.2.1 Comment: Bumping to 8.2. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10174#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10174: AArch64 : ghc-stage2 segfaults compiling libraries/parallel ----------------------------------------+------------------------------- Reporter: erikd | Owner: erikd Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: aarch64 Type of failure: Building GHC failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------------+------------------------------- Changes (by bgamari): * milestone: 8.2.1 => Comment: De-milestoning due to lack of progress. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10174#comment:9> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC