
#11340: linker_unload test fails on ARM -------------------------------------+------------------------------ Reporter: bgamari | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: arm Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------ Comment (by bgamari): Well, the good news is that I realized the source of the trouble. The bad news is I don't really know what to do about it. This test loads and unloads an object file dozens of times in succession. On ARM the linker builds a set of "symbol extras" which we use to relocate jumps which, * overflow the branch instructions' immediate field width (the ARM `b` and `bl` instructions are PC-relative with a signed 24-bit range) * require Thumb/ARM switch As it turns out, every time we load/unload the symbol extras region gets a bit farther away from the code we are loading. After 85 or so iterations the gap grows large enough that we can't jump from the code to the symbol extra (in particular it seems like the unlucky call is to `foreignExportStablePtr`). This is an unfortunate state of affairs. It would help if we were a bit more thorough in cleaning up while unloading. It used to be that we didn't unload code at all when "unloading" (see #8039) but this has since been fixed. Perhaps we still aren't letting go of symbol extras? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11340#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler