[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 <ben@…>): In [changeset:"f03f0d61bebe287e0df0254c175eb2f183d697aa/ghc" f03f0d61/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="f03f0d61bebe287e0df0254c175eb2f183d697aa" testsuite: Add test for #15053 Reviewers: Phyx Reviewed By: Phyx Subscribers: Phyx, rwbarton, thomie, carter GHC Trac Issues: #15053 Differential Revision: https://phabricator.haskell.org/D4883 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15053#comment:3> 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: 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 <krz.gogolewski@…>): In [changeset:"df363a646b66f4dd13d63ec70f18e427cabc8878/ghc" df363a6/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="df363a646b66f4dd13d63ec70f18e427cabc8878" Compiler panic on invalid syntax (unterminated pragma) Summary: After a parse error in OPTIONS_GHC issue an error message instead of a compiler panic. Test Plan: make test TEST=T15053 Reviewers: Phyx, thomie, bgamari, monoidal, osa1 Reviewed By: Phyx, monoidal, osa1 Subscribers: tdammers, osa1, rwbarton, carter GHC Trac Issues: #15053 Differential Revision: https://phabricator.haskell.org/D5093 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15053#comment:7> 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: 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