
#15105: `typecheckModule` from GHC API crashes on MacOS for files with TH ----------------------------------+---------------------------------------- Reporter: harpocrates | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.6.3 Component: GHC API | Version: 8.4.2 Resolution: | Keywords: Operating System: MacOS X | Architecture: Unknown/Multiple Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------+---------------------------------------- Comment (by bgamari): I have been looking into this with Dario Bertini at Munihac. It appears that `___gmp_rands` is a "common" symbol. With linker debugging enabled I see the following output, {{{ relocateSection: making jump island for ___stack_chk_guard, extern = 1, X86_64_RELOC_GOT lookupSymbol: looking up ___stack_chk_guard lookupSymbol: symbol not found lookupSymbol: looking up ___stack_chk_guard with dlsym relocateSection: looked up ___stack_chk_guard, external X86_64_RELOC_GOT or X86_64_RELOC_GOT_LOAD : addr = 0x7fffabebd070 relocateSection: value = 0x10e3e1d50 relocateSection: relocation 8481 : type = 3 : address = 283153 : symbolnum = 4303 : pcrel = 1 : length = 2 : extern = 1 : type = 3 relocateSection: length = 2, thing = 0, baseValue = 0x10e3125f5 relocateSection: making jump island for ___gmp_rands, extern = 1, X86_64_RELOC_GOT lookupSymbol: looking up ___gmp_rands lookupSymbol: symbol not found lookupSymbol: looking up ___gmp_rands with dlsym relocateSection: looked up ___gmp_rands, external X86_64_RELOC_GOT or X86_64_RELOC_GOT_LOAD : addr = 0x0 ghc-stage2: lookupSymbol failed in relocateSection (RELOC_GOT) /Users/berdario/Projects/ghc/libraries/integer-gmp/dist-install/build /HSinteger-gmp-1.0.2.0.o: unknown symbol `___gmp_rands' removeLibrarySearchPath: ptr = `0x0' }}} In principle common symbols do appear to be handled by `ocGetNames_MachO`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15105#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler