[GHC] #8603: GHC crashes on some code using StateT monad transformer

#8603: GHC crashes on some code using StateT monad transformer -------------------------------------+------------------------------------- Reporter: person1729 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 7.6.3 checker) | Operating System: MacOS X Keywords: | Type of failure: Compile-time Architecture: x86_64 (amd64) | crash Difficulty: Unknown | Test Case: Attached Blocked By: | Blocking: Related Tickets: | -------------------------------------+------------------------------------- GHC version 7.6.3 on Mac OS X 10.9 crashes with the following message when compiling the attached file: {{{ ghc -c -v3 -dcore-lint DiscreteRandomVariableST.hs }}} {{{ Glasgow Haskell Compiler, Version 7.6.3, stage 2 booted by GHC version 7.4.2 Using binary package database: /Library/Frameworks/GHC.framework/Versions/7.6.3-x86_64/usr/lib/ghc-7.6.3/package.conf.d/package.cache Using binary package database: /Users/***/.ghc/x86_64-darwin-7.6.3/package.conf.d/package.cache hiding package binary-0.5.1.1 to avoid conflict with later version binary-0.7.1.0 hiding package Cabal-1.16.0 to avoid conflict with later version Cabal-1.18.1.2 wired-in package ghc-prim mapped to ghc- prim-0.3.0.0-d5221a8c8a269b66ab9a07bdc23317dd wired-in package integer-gmp mapped to integer- gmp-0.5.0.0-2f15426f5b53fe4c6490832f9b20d8d7 wired-in package base mapped to base-4.6.0.1-6c351d70a24d3e96f315cba68f3acf57 wired-in package rts mapped to builtin_rts wired-in package template-haskell mapped to template- haskell-2.8.0.0-c2c1b21dbbb37ace4b7dc26c966ec664 wired-in package dph-seq not found. wired-in package dph-par not found. Hsc static flags: -static Created temporary directory: /var/folders/dg/lby0mtps13l9g0lry_dhsv1c0000gn/T/ghc13041_0 *** C pre-processor: '/sw/bin/gcc-4' '-E' '-undef' '-traditional' '-m64' '-fno-stack-protector' '-m64' '-I' '/Library/Frameworks/GHC.framework/Versions/7.6.3-x86_64/usr/lib/ghc-7.6.3/base-4.6.0.1/include' '-I' '/Library/Frameworks/GHC.framework/Versions/7.6.3-x86_64/usr/lib/ghc-7.6.3/include' '-D__GLASGOW_HASKELL__=706' '-Ddarwin_BUILD_OS=1' '-Dx86_64_BUILD_ARCH=1' '-Ddarwin_HOST_OS=1' '-Dx86_64_HOST_ARCH=1' '-U __PIC__' '-D__PIC__' '-x' 'c' 'DiscreteRandomVariableST.hs' '-o' '/var/folders/dg/lby0mtps13l9g0lry_dhsv1c0000gn/T/ghc13041_0/ghc13041_0.hscpp' *** Checking old interface for main:DiscreteRandomVariableST: *** Parser: *** Renamer/typechecker: DiscreteRandomVariableST.hs:186:17: Couldn't match kind `* -> *' with `*' Expected type: [t1] -> StateT s RV t0 Actual type: [t1] -> StateT s RV t0 Kind incompatibility when matching types: [t_t14] :: * -> * [t1] :: * The function `lift'*** Deleting temp files: Deleting: /var/folders/dg/lby0mtps13l9g0lry_dhsv1c0000gn/T/ghc13041_0/ghc13041_0.s /var/folders/dg/lby0mtps13l9g0lry_dhsv1c0000gn/T/ghc13041_0/ghc13041_0.hscpp Warning: deleting non-existent /var/folders/dg/lby0mtps13l9g0lry_dhsv1c0000gn/T/ghc13041_0/ghc13041_0.s *** Deleting temp dirs: Deleting: /var/folders/dg/lby0mtps13l9g0lry_dhsv1c0000gn/T/ghc13041_0 ghc: panic! (the 'impossible' happened) (GHC version 7.6.3 for x86_64-apple-darwin): kindFunResult ghc-prim:GHC.Prim.*{(w) tc 34d} Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug}}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8603 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8603: GHC crashes on some code using StateT monad transformer
--------------------------------------------+------------------------------
Reporter: person1729 | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler (Type checker) | Version: 7.6.3
Resolution: | Keywords:
Operating System: MacOS X | Architecture: x86_64
Type of failure: Compile-time crash | (amd64)
Test Case: Attached | Difficulty: Unknown
Blocking: | Blocked By:
| Related Tickets:
--------------------------------------------+------------------------------
Comment (by Simon Peyton Jones

#8603: GHC crashes on some code using StateT monad transformer
--------------------------------------------+------------------------------
Reporter: person1729 | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler (Type checker) | Version: 7.6.3
Resolution: | Keywords:
Operating System: MacOS X | Architecture: x86_64
Type of failure: Compile-time crash | (amd64)
Test Case: Attached | Difficulty: Unknown
Blocking: | Blocked By:
| Related Tickets:
--------------------------------------------+------------------------------
Comment (by Simon Peyton Jones

#8603: GHC crashes on some code using StateT monad transformer ------------------------------------------------+-------------------------- Reporter: person1729 | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler (Type checker) | Version: 7.6.3 Resolution: fixed | Keywords: Operating System: MacOS X | Architecture: x86_64 Type of failure: Compile-time crash | (amd64) Test Case: typecheck/should_fail/T8603 | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: ------------------------------------------------+-------------------------- Changes (by simonpj): * status: new => closed * testcase: Attached => typecheck/should_fail/T8603 * resolution: => fixed Comment: Thanks for identifying this bug! Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8603#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8603: GHC crashes on some code using StateT monad transformer ------------------------------------------------+-------------------------- Reporter: person1729 | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler (Type checker) | Version: 7.6.3 Resolution: fixed | Keywords: Operating System: MacOS X | Architecture: x86_64 Type of failure: Compile-time crash | (amd64) Test Case: typecheck/should_fail/T8603 | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: ------------------------------------------------+-------------------------- Comment (by monoidal): I don't understand completely what's going on here, but in your program `lift uniform [1,2,3]` should be `lift (uniform [1,2,3])`. This makes it compile under GHC 7.6. (I thought this error had long already been fixed in 7.7. Strange.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8603#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8603: GHC crashes on some code using StateT monad transformer ------------------------------------------------+-------------------------- Reporter: person1729 | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler (Type checker) | Version: 7.6.3 Resolution: fixed | Keywords: Operating System: MacOS X | Architecture: x86_64 Type of failure: Compile-time crash | (amd64) Test Case: typecheck/should_fail/T8603 | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: ------------------------------------------------+-------------------------- Comment (by simonpj): The point is that a type-incorrect program made GHC crash. That shouldn't happen, and that's what I fixed. Making the program itself right is another matter, as you point out. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8603#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8603: GHC crashes on some code using StateT monad transformer ------------------------------------------------+-------------------------- Reporter: person1729 | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler (Type checker) | Version: 7.6.3 Resolution: fixed | Keywords: Operating System: MacOS X | Architecture: x86_64 Type of failure: Compile-time crash | (amd64) Test Case: typecheck/should_fail/T8603 | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: ------------------------------------------------+-------------------------- Comment (by monoidal): What confuses me is that before the commit 7.7 already did not crash for this program. I checked that a6f6169a9939525c859b274955e8606d6080100f (commit just before yours) and HEAD give the same error message. Was the commit just internal refactoring, or has it visible consequences? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8603#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8603: GHC crashes on some code using StateT monad transformer ------------------------------------------------+-------------------------- Reporter: person1729 | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler (Type checker) | Version: 7.6.3 Resolution: fixed | Keywords: Operating System: MacOS X | Architecture: x86_64 Type of failure: Compile-time crash | (amd64) Test Case: typecheck/should_fail/T8603 | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: ------------------------------------------------+-------------------------- Comment (by simonpj): Well that is puzzling. I was sure I saw HEAD crash with `kindFunResult` panic. Anyway, regardless the refactoring is a good thing, I think. There really was a bug before. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8603#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC