[GHC] #14708: GHC panics when linking with an archive and using an annotation

#14708: GHC panics when linking with an archive and using an annotation -------------------------------------+------------------------------------- Reporter: tchajed | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Keywords: | Operating System: Unknown/Multiple Architecture: x86_64 | Type of failure: Compile-time (amd64) | crash or panic Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- GHC panics when compiling code with an annotation and linking with an archive (a `.a` file). I think this is the same as #9438, but I have a really simple test case consisting of the following two files: {{{#!c // add.c int add2(int x, int y) { return x + y; } }}} {{{#!hs -- app.hs {-# ANN module () #-} main :: IO () main = return () }}} First I make an archive: {{{ $ gcc -c add.c -o add.o $ ar libadd.a add.o }}} And then the following fails: {{{ $ ghc -ladd -L. app.hs [1 of 1] Compiling Main ( app.hs, app.o ) ghc: panic! (the 'impossible' happened) (GHC version 8.2.2 for x86_64-apple-darwin): Loading archives not supported Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug make: *** [app] Error 1 }}} The attached tar.gz has these source files and a Makefile to run the above. I've tested it on OS X 10.11 and Linux, both with GHC 8.2.2, and the behavior is the same. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14708 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14708: GHC panics when linking with an archive and using an annotation -------------------------------------+------------------------------------- Reporter: tchajed | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by tchajed): * Attachment "ghc-archive-panic.tar.gz" added. Test case to reproduce panic -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14708 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14708: GHC panics when linking with an archive and using an annotation -------------------------------------+------------------------------------- Reporter: tchajed | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: #9438 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * related: => #9438 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14708#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14708: GHC panics when linking with an archive and using an annotation -------------------------------------+------------------------------------- Reporter: tchajed | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: #9438 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => closed * resolution: => duplicate Comment: Note that the `ANN` is not critical to reproduce this bug. You can just as well remove it and instead load `app.hs` with `ghci` to trigger the bug as well: {{{ $ ghci -ladd -L. app.hs GHCi, version 8.4.1: http://www.haskell.org/ghc/ :? for help ghc: panic! (the 'impossible' happened) (GHC version 8.4.1 for x86_64-unknown-linux): Loading archives not supported Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} In other words, the key sticking point is not the use of `ANN`, but rather loading archives in interpreted code in general. Therefore, this is a duplicate of #9438, so closing. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14708#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14708: GHC panics when linking with an archive and using an annotation
-------------------------------------+-------------------------------------
Reporter: tchajed | Owner: (none)
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Compiler | Version: 8.2.2
Resolution: duplicate | Keywords:
Operating System: Unknown/Multiple | Architecture: x86_64
Type of failure: Compile-time | (amd64)
crash or panic | Test Case:
Blocked By: | Blocking:
Related Tickets: #9438 | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari
participants (1)
-
GHC