[GHC] #9839: RTS options parser silently accepts invalid flags
#9839: RTS options parser silently accepts invalid flags -------------------------------------+------------------------------------- Reporter: adamgundry | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: Component: Runtime System | Version: 7.8.3 Keywords: | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Unknown | Type of failure: Incorrect Blocked By: | result at runtime Related Tickets: #4243 | Test Case: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- RTS options that do not take arguments (such as `-T`) silently ignore anything that comes afterwards. For example, `+RTS -T,-s` or `+RTS -T-s` turns on collection of GC statistics (`-T`) but does not print out a summary (`-s`). Instead, this should produce an error message. Otherwise, users may mistakenly think that options have been applied. (This has just bitten us in a production system.) -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9839> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9839: RTS options parser silently accepts invalid flags -------------------------------------+------------------------------------- Reporter: adamgundry | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: Component: Runtime | Version: 7.8.3 System | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: Incorrect | Related Tickets: #4243 result at runtime | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by MikolajKonarski): * cc: MikolajKonarski (added) -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9839#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9839: RTS options parser silently accepts invalid flags -------------------------------------+------------------------------------- Reporter: adamgundry | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Runtime System | Version: 7.8.3 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: #4243 | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * keywords: => newcomer * owner: simonmar => Comment: The file to change is: `rts/RtsFlags.c`. Not difficult. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9839#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9839: RTS options parser silently accepts invalid flags -------------------------------------+------------------------------------- Reporter: adamgundry | Owner: carlostome Type: bug | Status: new Priority: normal | Milestone: Component: Runtime System | Version: 7.8.3 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: #4243 | Differential Revisions: -------------------------------------+------------------------------------- Changes (by carlostome): * owner: => carlostome -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9839#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9839: RTS options parser silently accepts invalid flags -------------------------------------+------------------------------------- Reporter: adamgundry | Owner: carlostome Type: bug | Status: patch Priority: normal | Milestone: Component: Runtime System | Version: 7.8.3 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: #4243 | Differential Revisions: Phab:D748 -------------------------------------+------------------------------------- Changes (by carlostome): * status: new => patch * differential: => Phab:D748 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9839#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9839: RTS options parser silently accepts invalid flags -------------------------------------+------------------------------------- Reporter: adamgundry | Owner: carlostome Type: bug | Status: patch Priority: normal | Milestone: Component: Runtime System | Version: 7.8.3 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: #4243 | Differential Revisions: Phab:D748 -------------------------------------+------------------------------------- Comment (by Thomas Miedema <thomasmiedema@…>): In [changeset:"a20cc3d00c4ca0753fcdcb16199f173b3af44fe4/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="a20cc3d00c4ca0753fcdcb16199f173b3af44fe4" rts: check arguments to flags that don't have any There were some flags of the RTS that when given an argument (which they don't have) were not firing an error. e.g -Targument when the flag -T has no argument. Now this is an error and affects the following flags: -B -w -T -Z -P -Pa -c -t Signed-off-by: Carlos Tomé <carlostome1990@gmail.com> Reviewed By: austin, thomie, hvr Differential Revision: https://phabricator.haskell.org/D748 GHC Trac Issues: #9839 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9839#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9839: RTS options parser silently accepts invalid flags -------------------------------------+------------------------------------- Reporter: adamgundry | Owner: carlostome Type: bug | Status: closed Priority: normal | Milestone: Component: Runtime System | Version: 7.8.3 Resolution: fixed | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: #4243 | Differential Revisions: Phab:D748 -------------------------------------+------------------------------------- Changes (by thomie): * status: patch => closed * resolution: => fixed Comment: Thanks Carlos! The only thing not handled by this patch is checking that arguments that are supposed to be numeric, are actually numeric. Currently `atof` is called on them, which accepts pretty much anything. Maybe a fix for this can be part of #4243. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9839#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9839: RTS options parser silently accepts invalid flags -------------------------------------+------------------------------------- Reporter: adamgundry | Owner: Type: bug | Status: new Priority: high | Milestone: 7.12.1 Component: Runtime System | Version: 7.8.3 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: #4243 | Differential Revisions: Phab:D748 -------------------------------------+------------------------------------- Changes (by thomie): * owner: carlostome => * priority: normal => high * status: closed => new * resolution: fixed => * milestone: => 7.12.1 Comment: This patch broke `+RTS -xc`, and probably also `+RTS -xt`. Running `make TEST=cgrun057` with a profiling compiler results in: "flag -x given an argument when none was expected: -xc" Carlos: could you try fixing it? -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9839#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9839: RTS options parser silently accepts invalid flags -------------------------------------+------------------------------------- Reporter: adamgundry | Owner: Type: bug | Status: new Priority: highest | Milestone: 7.12.1 Component: Runtime System | Version: 7.8.3 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: #4243 | Differential Revisions: Phab:D748 -------------------------------------+------------------------------------- Changes (by simonmar): * priority: high => highest Comment: Must fix before 7.12.1 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9839#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9839: RTS options parser silently accepts invalid flags -------------------------------------+------------------------------------- Reporter: adamgundry | Owner: nkartashov Type: bug | Status: new Priority: highest | Milestone: 7.12.1 Component: Runtime System | Version: 7.8.3 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: #4243 | Differential Revisions: Phab:D748 -------------------------------------+------------------------------------- Changes (by nkartashov): * owner: => nkartashov -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9839#comment:9> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9839: RTS options parser silently accepts invalid flags -------------------------------------+------------------------------------- Reporter: adamgundry | Owner: nkartashov Type: bug | Status: new Priority: highest | Milestone: 7.12.1 Component: Runtime System | Version: 7.8.3 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: #4243 | Differential Revisions: Phab:D1039 -------------------------------------+------------------------------------- Changes (by nkartashov): * differential: Phab:D748 => Phab:D1039 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9839#comment:10> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9839: RTS options parser silently accepts invalid flags -------------------------------------+------------------------------------- Reporter: adamgundry | Owner: nkartashov Type: bug | Status: new Priority: highest | Milestone: 7.12.1 Component: Runtime System | Version: 7.8.3 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: #4243 | Differential Revisions: Phab:D1039 -------------------------------------+------------------------------------- Comment (by Thomas Miedema <thomasmiedema@…>): In [changeset:"75de6131efc780dbdba30fa3fc48c16231ab66a9/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="75de6131efc780dbdba30fa3fc48c16231ab66a9" rts: fix incorrect checking start for -x arguments (#9839) After previous fix, flag combinations such as -xt and -xc resulted in an error due to the fact that the checking started from index 2, which was always 'x' in that case. Now they are correctly processed. Differential Revision: https://phabricator.haskell.org/D1039 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9839#comment:11> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9839: RTS options parser silently accepts invalid flags -------------------------------------+------------------------------------- Reporter: adamgundry | Owner: nkartashov Type: bug | Status: closed Priority: highest | Milestone: 7.12.1 Component: Runtime System | Version: 7.8.3 Resolution: fixed | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: #4243 | Differential Revisions: Phab:D748, | Phab:D1039 -------------------------------------+------------------------------------- Changes (by thomie): * status: new => closed * differential: Phab:D1039 => Phab:D748, Phab:D1039 * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9839#comment:12> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC