[GHC] #10549: floatExpr tick break<2>

#10549: floatExpr tick break<2> -------------------------------------+------------------------------------- Reporter: | Owner: NeilMitchell | Status: new Type: bug | Milestone: Priority: normal | Version: 7.11 Component: Compiler | Operating System: Unknown/Multiple Keywords: | Type of failure: None/Unknown Architecture: | Blocked By: Unknown/Multiple | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- When running the Shake test suite against GHC HEAD I get: {{{ ghc: panic! (the 'impossible' happened) (GHC version 7.11.20150615 for x86_64-unknown-linux): floatExpr tick break<2>() }}} Full log at https://travis-ci.org/ndmitchell/shake/jobs/67636563. The command line that produced it is: {{{ runhaskell -ignore-package=hashmap -ioutput/docs/ -isrc output/docs/Main.hs }}} If this seems like a legitimate bug that you don't already know about and are interested in tracking down, I'll try and grab the output/docs directory (it's on a remote machine I don't have access to on a different OS with a compiler I don't have installed, so it's not trivial to find it, but should be possible). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10549 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10549: floatExpr tick break<2> -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by simonpj): * cc: scpmw (added) Comment: Sounds like one for Peter Wortmann. Peter, can you help? Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10549#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10549: floatExpr tick break<2> -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by scpmw): This looks almost exactly like #10052. The gist of the discussion was that it is undefined to try to run optimisation passes such as `FloatIn` on a program with breakpoints. So the question here is why `runhaskell` ends up running optimisations, especially after Austin's fix... -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10549#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10549: floatExpr tick break<2> -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by simonpj): Can't we at least give a more civilised error message like "Attempting to run FloatIn on a program with breakpoints"? And where are the breakpoints in the example? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10549#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10549: floatExpr tick break<2> -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by NeilMitchell): From what I can see, it looks like Austin's changes and all of #10052 was all in by 20150615, suggesting the bug is something different? I'm not deliberately doing anything with breakpoints, but it does have plenty of generated code (I convert the Haddock code snippets into code and try and type check them with some dummy definitions and the real Shake code). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10549#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10549: floatExpr tick break<2> -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.3 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * priority: normal => high * version: 7.11 => 7.10.2 * milestone: => 7.10.3 Comment: Here is a test to reproduce the problem with ghci. {{{ {-# OPTIONS_GHC -O2 #-} module T10549 where import qualified Data.ByteString.Internal as Internal import System.IO.Unsafe (unsafePerformIO) import Data.Word (Word8) import Foreign.Ptr (Ptr) import Foreign.Storable (peek) type S = Ptr Word8 chr :: S -> Char chr x = Internal.w2c $ unsafePerformIO $ peek x }}} Running `ghc-7.10.1 --interactive T10549.hs` results in: {{{ GHCi, version 7.10.1: http://www.haskell.org/ghc/ :? for help T10549.hs:1:16: Warning: -O conflicts with --interactive; -O ignored [1 of 1] Compiling T10549 ( T10549.hs, interpreted ) Ok, modules loaded: T10549. }}} Running `ghc-7.10.2 --interactive T10549.hs` results in: {{{ GHCi, version 7.10.2: http://www.haskell.org/ghc/ :? for help [1 of 1] Compiling T10549 ( T10549.hs, interpreted ) ghc: panic! (the 'impossible' happened) (GHC version 7.10.2 for x86_64-unknown-linux): floatExpr tick break<3>() }}} So somehow the `OPTIONS_GHC -O2` in the file doesn't get ignored (it does when given on the command line). To reproduce the problem with the Shake sources (version 0.15.4), run `ghci src/Development/Ninja/Lexer.hs -isrc`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10549#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10549: floatExpr tick break<2> -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: bgamari Type: bug | Status: new Priority: high | Milestone: 7.10.3 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by bgamari): * owner: => bgamari -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10549#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10549: floatExpr tick break<2> -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: bgamari Type: bug | Status: new Priority: high | Milestone: 7.10.3 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by bgamari): Austin's previous fix, 46edc43cbe011978d903dd0b5f0ffc62c602fbaa, is the first bad commit here. It seems the commit forgot to treat the case of `-O` coming from `OPTIONS_GHC`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10549#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10549: floatExpr tick break<2> -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: bgamari Type: bug | Status: new Priority: high | Milestone: 7.10.3 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by thomie): See also the questions I raised about that patch in https://phabricator.haskell.org/D727. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10549#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10549: floatExpr tick break<2> -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: bgamari Type: bug | Status: patch Priority: high | Milestone: 7.10.3 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: T10549 Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1128 -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => patch * testcase: => T10549 * differential: => Phab:D1128 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10549#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10549: floatExpr tick break<2>
-------------------------------------+-------------------------------------
Reporter: NeilMitchell | Owner: bgamari
Type: bug | Status: patch
Priority: high | Milestone: 7.10.3
Component: Compiler | Version: 7.10.2
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case: T10549
Blocked By: | Blocking:
Related Tickets: | Differential Revisions: Phab:D1128
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#10549: floatExpr tick break<2> -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: bgamari Type: bug | Status: closed Priority: high | Milestone: 7.10.3 Component: Compiler | Version: 7.10.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: T10549 Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1128 -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10549#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10549: floatExpr tick break<2> -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: bgamari Type: bug | Status: merge Priority: high | Milestone: 7.10.3 Component: Compiler | Version: 7.10.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: T10549 Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1128 -------------------------------------+------------------------------------- Changes (by bgamari): * status: closed => merge -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10549#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10549: floatExpr tick break<2> -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: bgamari Type: bug | Status: merge Priority: high | Milestone: 7.10.3 Component: Compiler | Version: 7.10.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: T10549 Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1128 -------------------------------------+------------------------------------- Comment (by nomeata): As Debian is moving to GHC-7.10, this is affecting us. So if someone would do the merge (which is not automatic) soon, that would be appreciated, as we would include that patch in our 7.10.2 package. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10549#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10549: floatExpr tick break<2> -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: bgamari Type: bug | Status: closed Priority: high | Milestone: 7.10.3 Component: Compiler | Version: 7.10.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: T10549 Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1128 -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed Comment: nomeata, your wish is my command. I've merged this with 5af80e79b0b679565ffcfae8ed34188561ef1452 and 75fd8747c128c3f946769510ce8cfe089821116d. Sorry about the two commits; I pushed a bit before noticing some testsuite failures. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10549#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10549: floatExpr tick break<2> -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: bgamari Type: bug | Status: closed Priority: high | Milestone: 7.10.3 Component: Compiler | Version: 7.10.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: T10549 Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1128 -------------------------------------+------------------------------------- Comment (by nomeata): Thanks! Debian upload on its way. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10549#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10549: floatExpr tick break<2> -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: bgamari Type: bug | Status: closed Priority: high | Milestone: 7.10.3 Component: Compiler | Version: 7.10.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: T10549 Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1128 -------------------------------------+------------------------------------- Comment (by NeilMitchell): I ran into this again and reduced it to something fairly different, and quite a lot simpler. You may want to incorporate the new example as an additional test case: {{{ {-# OPTIONS_GHC -O #-} module Main(main) where import GHC.Exts main = print 1 go (Ptr a) = a }}} Note the revised test case only requires GHC, not ByteString etc. With GHC 7.10.2, running runhaskell over it gives: {{{ ghc: panic! (the 'impossible' happened) (GHC version 7.10.2 for i386-unknown-mingw32): floatExpr tick break<1>() }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10549#comment:16 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10549: floatExpr tick break<2>
-------------------------------------+-------------------------------------
Reporter: NeilMitchell | Owner: bgamari
Type: bug | Status: closed
Priority: high | Milestone: 7.10.3
Component: Compiler | Version: 7.10.2
Resolution: fixed | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case: T10549
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D1128
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#10549: floatExpr tick break<2> -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: bgamari Type: bug | Status: closed Priority: high | Milestone: 7.10.3 Component: Compiler | Version: 7.10.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | T10549,T10549a Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1128 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * testcase: T10549 => T10549,T10549a -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10549#comment:18 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC