[GHC] #12558: GHCi Segmentation fault/access violation in generated code

#12558: GHCi Segmentation fault/access violation in generated code ------------------------------+------------------------------- Reporter: lazac | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.0.1 Keywords: | Operating System: Windows Architecture: x86 | Type of failure: GHCi crash Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: ------------------------------+------------------------------- GHCi crashes with the error message `Segmentation fault/access violation in generated code`. The problem arises when trying to use the [https://github.com/haskell-tools/haskell-tools Haskell Tools project] from GHCi. The program can be successfully compiled with the ghc compiler. The cause of this behavior is that there are elements thats type is computed by a type family application. When I changed the representation to eliminate these, the problem was gone. I can turn the problem on and off only by adding an import or removing it. To solve the problem simply comment out the modules that use the information with the complex calculated type, as done in the attached diff. To try out use a minimal program: {{{#!hs module Main where import Language.Haskell.Tools.Refactor main = demoRefactor "" "." "A" }}} Execute the `ghci -package ghc -isrc\ast;src\ast-ghc;sr c\ast-trf;src\ast-ppr;src\ast-gen;src\refactor;src Main` command from the project root. That will search for a simple `A.hs` file in the working directory. A minimalistic module is enough to trigger the problem: {{{#!hs module A where }}} PS: I tried to create a smaller example, but the problem just appears and disappears without "reason" when I try to modify the code. (For example importing a module that is not actually used.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12558 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12558: GHCi Segmentation fault/access violation in generated code -------------------------------+----------------------------- Reporter: lazac | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.0.1 Resolution: | Keywords: Operating System: Windows | Architecture: x86 Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------+----------------------------- Changes (by lazac): * Attachment "ghci" added. A diff for the Haskell Tools project that hides the problem -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12558 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12558: GHCi Segmentation fault/access violation in generated code -------------------------------+----------------------------- Reporter: lazac | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.0.1 Resolution: | Keywords: Operating System: Windows | Architecture: x86 Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------+----------------------------- Comment (by Phyx-): Hi, Thanks for the report. I have completely missed this. Unfortunately this repro is way way to large. I'm even having trouble reproducing it from the released `8.0.1` due to all the dependencies required for that package. Does your project contain any C sources? Can you try and make a repo with a smaller dependency chain? one without the need of `old-time` would be especially great since there are a few issues compiling that and GHC 8. Likely the segfault is coming from one of your dependencies. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12558#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12558: GHCi Segmentation fault/access violation in generated code -------------------------------+----------------------------- Reporter: lazac | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.0.1 Resolution: | Keywords: Operating System: Windows | Architecture: x86 Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------+----------------------------- Changes (by Phyx-): * cc: Phyx- (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12558#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12558: GHCi Segmentation fault/access violation in generated code -------------------------------+---------------------------------- Reporter: lazac | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: Component: GHCi | Version: 8.0.1 Resolution: | Keywords: Operating System: Windows | Architecture: x86 Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------+---------------------------------- Changes (by Phyx-): * status: new => infoneeded -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12558#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12558: GHCi Segmentation fault/access violation in generated code -------------------------------+------------------------------ Reporter: lazac | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: GHCi | Version: 8.0.1 Resolution: invalid | Keywords: Operating System: Windows | Architecture: x86 Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------+------------------------------ Changes (by Phyx-): * status: infoneeded => closed * resolution: => invalid Comment: No information was provided in 2 months. If you're still having the problem and have a small repo, please re-open the ticket. It's worth nothing that several linker related segfaults were fixed for GHC 8.0.2. So that's worth trying. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12558#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC