
#13501: TH segmentation fault on Linux when calling function from another package -------------------------------------+------------------------------------- Reporter: jmaki | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Thanks for the repro! There is definitely something fishy here. GDB says, {{{ Thread 1 received signal SIGSEGV, Segmentation fault. 0x00007f631235ed30 in base_GHCziBase_return_info () from /opt/exp/ghc/roots/master/lib/ghc-8.3.20170329/bin/../base-4.10.0.0/libHSbase-4.10.0.0-ghc8.3.20170329.so (rr) bt #0 0x00007f631235ed30 in base_GHCziBase_return_info () from /opt/exp/ghc/roots/master/lib/ghc-8.3.20170329/bin/../base-4.10.0.0/libHSbase-4.10.0.0-ghc8.3.20170329.so #1 0x0000000000000000 in ?? () (rr) }}} passing `+RTS -Dl` we get the following forboding warnings, {{{ ... Rel entry 4 is raw( 0x54 0x160000000b (nil)) lookupSymbol: looking up stg_ap_p_info lookupSymbol: value of stg_ap_p_info is 0x7f63112740c8 `stg_ap_p_info' resolves to 0x7f63112740c8 Reloc: P = 0x401311ec S = 0x7f63112740c8 A = (nil) Rel entry 5 is raw( 0x5c 0x170000000b 0x1) lookupSymbol: looking up ghczmprim_GHCziTypes_ZMZN_closure lookupSymbol: symbol not found `ghczmprim_GHCziTypes_ZMZN_closure' resolves to 0x7f6311b41d50 Reloc: P = 0x401311f4 S = 0x7f6311b41d50 A = 0x1 Rel entry 6 is raw( 0x65 0x1800000002 0xfffffffffffffffc) lookupSymbol: looking up base_GHCziBase_return_info lookupSymbol: symbol not found `base_GHCziBase_return_info' resolves to 0x7f631235ed10 Reloc: P = 0x401311fd S = 0x7f631235ed10 A = 0xfffffffffffffffc relocations for section 3 using symtab 11 Rel entry 0 is raw( (nil) 0xe00000001 (nil)) lookupSymbol: looking up ghczmprim_GHCziTypes_TrNameS_con_info lookupSymbol: symbol not found `ghczmprim_GHCziTypes_TrNameS_con_info' resolves to 0x7f63118655c0 Reloc: P = 0x40131208 S = 0x7f63118655c0 A = (nil) ... }}} Looking at the `libHSbase` archive, we see, {{{ $ objdump -x /opt/exp/ghc/roots/master/lib/ghc-8.3.20170329/base-4.10.0.0/libHSbase-4.10.0.0.a | less ... SYMBOL TABLE: ... 0000000000000000 *UND* 0000000000000000 base_GHCziBase_return_info }}} Very interesting. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13501#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler