[GHC] #15904: hp2ps fail with parse error when the command args contains double quotes
#15904: hp2ps fail with parse error when the command args contains double quotes -------------------------------------+------------------------------------- Reporter: watashi | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.8.1 Component: Profiling | Version: 8.7 Keywords: hp2ps | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- {{{ watashi % cat test.hs main = pure () watashi % ghc -prof -rtsopts test.hs watashi % ./test '{"e": 2.72, "pi": 3.14}' +RTS -h watashi % hp2ps test.hp hp2ps: test.hp, line 1: integer must follow identifier }}} Manually open `test.hp` and remove the `"`s in `JOB` will mitigate the problem. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15904> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15904: hp2ps fail with parse error when the command args contains double quotes -------------------------------------+------------------------------------- Reporter: watashi | Owner: watashi Type: bug | Status: new Priority: normal | Milestone: 8.8.1 Component: Profiling | Version: 8.7 Resolution: | Keywords: hp2ps Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by watashi): * owner: (none) => watashi -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15904#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15904: hp2ps fail with parse error when the command args contains double quotes -------------------------------------+------------------------------------- Reporter: watashi | Owner: watashi Type: bug | Status: new Priority: normal | Milestone: 8.8.1 Component: Profiling | Version: 8.7 Resolution: | Keywords: hp2ps Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5346 Wiki Page: | -------------------------------------+------------------------------------- Changes (by watashi): * differential: => Phab:D5346 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15904#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15904: hp2ps fail with parse error when the command args contains double quotes -------------------------------------+------------------------------------- Reporter: watashi | Owner: watashi Type: bug | Status: new Priority: normal | Milestone: 8.8.1 Component: Profiling | Version: 8.7 Resolution: | Keywords: hp2ps Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5346 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"390df8b51b917fb6409cbde8e73fe838d61d8832/ghc" 390df8b/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="390df8b51b917fb6409cbde8e73fe838d61d8832" Fix uninformative hp2ps error when the cmdline contains double quotes The format of hp file didn't allow double quotes inside strings, and under prof build, we include args in JOB, which may have double quotes. When this happens, the error message is confusing to the user. This can also happen under normal build if the executable name contains double quite, which is unlikely though. We fix this issue by introducing escaping for double quotes inside a string by repeating it twice. We also fix a buffer overflow bug when the length of the string happen to be multiple of 5000. Test Plan: new tests, which used to fail with error message: ``` hp2ps: "T15904".hp, line 2: integer must follow identifier ``` use new ghc and hp2ps to profile a simple program. Reviewers: simonmar, bgamari, erikd Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #15904 Differential Revision: https://phabricator.haskell.org/D5346 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15904#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15904: hp2ps fail with parse error when the command args contains double quotes -------------------------------------+------------------------------------- Reporter: watashi | Owner: watashi Type: bug | Status: closed Priority: normal | Milestone: 8.8.1 Component: Profiling | Version: 8.7 Resolution: fixed | Keywords: hp2ps Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5346 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15904#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15904: hp2ps fail with parse error when the command args contains double quotes -------------------------------------+------------------------------------- Reporter: watashi | Owner: watashi Type: bug | Status: closed Priority: normal | Milestone: 8.8.1 Component: Profiling | Version: 8.7 Resolution: fixed | Keywords: hp2ps Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5346 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"0136906c9e69b02cd1ffe2704fa5d737d8c4cfaf/ghc" 0136906/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="0136906c9e69b02cd1ffe2704fa5d737d8c4cfaf" Fix uninformative hp2ps error when the cmdline contains double quotes Reapply D5346 with fix incompatible shell quoting in tests. It seems like `$'string'` is not recognized under all test environments, so let's avoid it in tests. Test Plan: ``` hp2ps: "T15904".hp, line 2: integer must follow identifier ``` use new ghc and hp2ps to profile a simple program. Reviewers: simonmar, bgamari, erikd, tdammers Reviewed By: bgamari Subscribers: tdammers, carter, rwbarton GHC Trac Issues: #15904 Differential Revision: https://phabricator.haskell.org/D5388 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15904#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC