[GHC] #11123: Arm: checkProddableBlock: invalid fixup in runtime linke

#11123: Arm: checkProddableBlock: invalid fixup in runtime linke --------------------------------+---------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Keywords: | Operating System: Unknown/Multiple Architecture: arm | Type of failure: Building GHC failed Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: --------------------------------+---------------------------------------- Just started getting this in the last week or two, but only just now got a chance to investigate more fully. Any use of GHCi or TH will result in an error like: {{{ ghc-stage2: internal error: checkProddableBlock: invalid fixup in runtime linker: 0x41380050 (GHC version 7.11.20151122 for arm_unknown_linux) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug Aborted }}} As a consequence, there are now over 500 failing tests on Arm. I thought this may have been a consequence of all the recent work on `rts/Linker.c` so I checked out git commit 20e30d5f3d932d63933 (the one just before the dreaded commit 04e8366608fee4f which seemed to kick off a bunch of heavy rework in this file) but that revision causes another, even more mysterious linking failure. From what I have seen, this only affects 32 bit Arm. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11123 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11123: Arm: checkProddableBlock: invalid fixup in runtime linker ----------------------------------------+----------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: arm Type of failure: Building GHC failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------------+----------------------------- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11123#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11123: Arm: checkProddableBlock: invalid fixup in runtime linker ----------------------------------------+----------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: arm Type of failure: Building GHC failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------------+----------------------------- Comment (by erikd): The error occurs even with `inplace/bin/ghc-stage2 --interactive`. Running as `inplace/bin/ghc-stage2 +RTS -Dl -RTS --interactive` it finishes off with: {{{ addOTabName(GLOB): 0xb6c7cba0 /home/erikd/Git/ghc-upstream/libraries/ghc- prim/ dist-install/build/HSghc-prim-0.5.0.0.o hs_word2float64 addSection: (nil)-0x19d3e1 (size 1692641), kind 3 addSection: (nil)-0x92 (size 146), kind 3 loadOc: done. resolveObjs: start relocations for section 1 using symtab 15 and strtab 16 Rel entry 0 is raw( 0x1c 0x5c962b)lookupSymbol: looking up stg_upd_frame_info lookupSymbol: value of stg_upd_frame_info is 0x1efba00 `stg_upd_frame_info' resolves to 0x1efba00 Reloc: P = 0xb6c02050 S = 0x1efba00 A = 0xe3002000 ghc-stage2: internal error: checkProddableBlock: (called from line 5064) invalid fixup in runtime linker: 0xb6c02050 (GHC version 7.11.20151124 for arm_unknown_linux) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug Aborted }}} At first I thought a `start` value of `nil` (as is being passed to `addSection` was a problem, but that happens on x86_64 as well, without a problem. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11123#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11123: Arm: checkProddableBlock: invalid fixup in runtime linker ----------------------------------------+----------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: arm Type of failure: Building GHC failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------------+----------------------------- Comment (by erikd): From IRC: {{{ <olsner> erikd: re your linker issue, perhaps getSectionKind_ELF fails to recognize that section as proddable - the printouts mention sections of kind 3 (afaict that's "other"), and "other" sections aren't marked as proddable in ocGetNames_ELF }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11123#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11123: Arm: checkProddableBlock: invalid fixup in runtime linker ----------------------------------------+----------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: arm Type of failure: Building GHC failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------------+----------------------------- Comment (by hsyl20): Isn't it fixed with Phab:D1470? In master, the proddable block is wrong when we copy the section: {{{ 4799: addProddableBlock(oc, ehdrC + offset, size); }}} should be {{{ 4799: addProddableBlock(oc, start, size); }}} Maybe this would be enough to solve the issue. (If it does, I don't see why we only have it on ARM though). As for "other" sections (cf comment:3), they are skipped during the relocation, so I guess the failing relocation is not for the 2 sections we see in the last part of the log in comment:2. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11123#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11123: Arm: checkProddableBlock: invalid fixup in runtime linker ----------------------------------------+----------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: arm Type of failure: Building GHC failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------------+----------------------------- Comment (by erikd): I just applied Phab:D1470 and built it on my Arm board. I am no longger getting a problem with `checkProddableBlock` but I am getting a large amount of errors like: {{{ ghc-stage2: Symbol `exp' requires Thumb linkage which is not currently supported. ghc-stage2: Symbol `log' requires Thumb linkage which is not currently supported. ghc-stage2: Symbol `sin' requires Thumb linkage which is not currently supported. }}} for symbols in libc. This is completely un-related to Phab:D1470. It looks like the libc on this machine switched from Arm linkage to Thumb linkage during a recent upgrade. @bgamari any clues? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11123#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11123: Arm: checkProddableBlock: invalid fixup in runtime linker ----------------------------------------+----------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: arm Type of failure: Building GHC failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------------+----------------------------- Comment (by erikd): Disassembling libm using `objdump -D /lib/arm-linux- gnueabihf/libm-2.19.so` shows that the `sin` function is indeed Thumb code (indicated by instruction offsets that are not a multiple of 2): {{{ 00015850 <sin>: 15850: b570 push {r4, r5, r6, lr} 15852: ed2d 8b0e vpush {d8-d14} 15856: b08a sub sp, #40 ; 0x28 15858: eeb0 8b40 vmov.f64 d8, d0 1585c: ac01 add r4, sp, #4 1585e: 4620 mov r0, r4 15860: f7f0 fd48 bl 62f4 <feholdexcept> ... }}} This problem is encountered when ghci loads a Haskell module which calls maths functions in `libm`. {{{ Loading package ghc-prim-0.5.0.0 ... linking ... ghc-stage2: Symbol `__aeabi_idiv' requires Thumb linkage which is not currently supported. }}} However on IRC, @rwbarton suggests: {{{ .... the rts linker should use its own copy of sin to satisfy a use in a .o file }}} so maybe this is still a bug in Phab:D1470. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11123#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11123: Arm: checkProddableBlock: invalid fixup in runtime linker ----------------------------------------+----------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: arm Type of failure: Building GHC failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------------+----------------------------- Comment (by bgamari): I think the solution here is to reenable Thumb linkage and fix up any issues that we reveal. I'm working on this currently. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11123#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11123: Arm: checkProddableBlock: invalid fixup in runtime linker ----------------------------------------+----------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: arm Type of failure: Building GHC failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------------+----------------------------- Comment (by bgamari): erikd, I believe this has been resolved. Perhaps you could verify this? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11123#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11123: Arm: checkProddableBlock: invalid fixup in runtime linker ----------------------------------------+------------------------------ Reporter: erikd | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: arm Type of failure: Building GHC failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------------+------------------------------ Changes (by bgamari): * status: new => closed * resolution: => fixed Comment: I'm going to close this under the assumption that it was fixed in fixing Thumb linkage. Re-open if not. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11123#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC