[GHC] #15053: Compiler panic on invalid syntax (unterminated pragma)

#15053: Compiler panic on invalid syntax (unterminated pragma) -------------------------------------+------------------------------------- Reporter: AndreasK | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 (Parser) | 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: -------------------------------------+------------------------------------- The following minimal example causes a compiler panic. {{{ {-# OPTIONS_GHC -O1 } " #-} }}} {{{ ghc-stage2.exe: panic! (the 'impossible' happened) (GHC version 8.5.20180413 for x86_64-unknown-mingw32): getOptions'.parseToks: Couldn't read "\r\n\"\r\n " as String Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} Happens in HEAD and 8.2.2 at least. Double quotes seem to confuse the parser. Also panics if there are two doublequotes. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15053 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15053: Compiler panic on invalid syntax (unterminated pragma) -------------------------------------+------------------------------------- Reporter: AndreasK | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 (Parser) | 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): Phab:D4883 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * differential: => Phab:D4883 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15053#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15053: Compiler panic on invalid syntax (unterminated pragma) -------------------------------------+------------------------------------- Reporter: AndreasK | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 (Parser) | 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): Phab:D4883 Wiki Page: | -------------------------------------+------------------------------------- Comment (by osa1): This is easy to fix, we just need to decide on an error message. If current message is fine that we could just throw an exception instead of panicking. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15053#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15053: Compiler panic on invalid syntax (unterminated pragma)
-------------------------------------+-------------------------------------
Reporter: AndreasK | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone: 8.6.1
Component: Compiler | Version: 8.2.2
(Parser) |
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): Phab:D4883
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#15053: Compiler panic on invalid syntax (unterminated pragma) -------------------------------------+------------------------------------- Reporter: AndreasK | Owner: RolandSenn Type: bug | Status: new Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.2.2 (Parser) | 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): Phab:D4883 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RolandSenn): * owner: (none) => RolandSenn Comment: I'll work on this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15053#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15053: Compiler panic on invalid syntax (unterminated pragma) -------------------------------------+------------------------------------- Reporter: AndreasK | Owner: RolandSenn Type: bug | Status: patch Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.2.2 (Parser) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Compile-time | Test Case: make test crash or panic | TEST=T15053 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4883 Wiki Page: | Phab:D5093 -------------------------------------+------------------------------------- Changes (by RolandSenn): * status: new => patch * testcase: => make test TEST=T15053 * differential: Phab:D4883 => Phab:D4883 Phab:D5093 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15053#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15053: Compiler panic on invalid syntax (unterminated pragma)
-------------------------------------+-------------------------------------
Reporter: AndreasK | Owner: RolandSenn
Type: bug | Status: patch
Priority: normal | Milestone: 8.8.1
Component: Compiler | Version: 8.2.2
(Parser) |
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: Compile-time | Test Case: make test
crash or panic | TEST=T15053
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D4883
Wiki Page: | Phab:D5093
-------------------------------------+-------------------------------------
Comment (by Krzysztof Gogolewski

#15053: Compiler panic on invalid syntax (unterminated pragma) -------------------------------------+------------------------------------- Reporter: AndreasK | Owner: RolandSenn Type: bug | Status: merge Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.2.2 (Parser) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Compile-time | Test Case: make test crash or panic | TEST=T15053 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4883 Wiki Page: | Phab:D5093 -------------------------------------+------------------------------------- Changes (by monoidal): * status: patch => merge -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15053#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15053: Compiler panic on invalid syntax (unterminated pragma) -------------------------------------+------------------------------------- Reporter: AndreasK | Owner: RolandSenn Type: bug | Status: closed Priority: normal | Milestone: 8.6.2 Component: Compiler | Version: 8.2.2 (Parser) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Compile-time | Test Case: make test crash or panic | TEST=T15053 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4883 Wiki Page: | Phab:D5093 -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged to `ghc-8.6` with 523047768913836177f49768d1070996ebabf242. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15053#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC