[GHC] #15904: hp2ps fail with parse error when the command args contains double quotes
GHC
ghc-devs at haskell.org
Thu Nov 22 18:46:16 UTC 2018
#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
More information about the ghc-tickets
mailing list