[GHC] #14987: Memory usage exploding for complex pattern matching

#14987: Memory usage exploding for complex pattern matching -------------------------------------+------------------------------------- Reporter: vmiraldo | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.4.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Compile-time Unknown/Multiple | crash or panic Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- It seems like complex pattern matching is consuming a prohibitive amount of memory. From a discussion in ghc-devs, [https://mail.haskell.org/pipermail/ghc-devs/2018-March/015538.html], the exhaustiveness checker could be the culprit. We have tried with 7.10.3, 8.0.2, 8.4.1 and ghc-HEAD. They show similar results. The "-fmax-pmchecker-iterations=0" option seems to help slightly. Bigger cases will run out of memory even with the option enabled. I'm attaching a "minimal" example to help diagnosing. The majority of the code has been generated by Template Haskell. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14987 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14987: Memory usage exploding for complex pattern matching -------------------------------------+------------------------------------- Reporter: vmiraldo | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.4.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by vmiraldo): * Attachment "Minimal.hs" added. Self-contained repro for the bug. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14987 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14987: Memory usage exploding for complex pattern matching
-------------------------------------+-------------------------------------
Reporter: vmiraldo | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.4.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Compile-time | Unknown/Multiple
crash or panic | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#14987: Memory usage exploding for complex pattern matching -------------------------------------+------------------------------------- Reporter: vmiraldo | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.4.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): The patch that triggered this has been reverted. However, this is just a workaround; ultimately we will want to apply this patch again as it fixed #14838. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14987#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14987: Memory usage exploding for complex pattern matching -------------------------------------+------------------------------------- Reporter: vmiraldo | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.4.1 Resolution: | Keywords: | PatternMatchWarnings Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * keywords: => PatternMatchWarnings -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14987#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC