[Issue 17650] [REG v2.075.0 b1-b4] std.getopt range violation
https://issues.dlang.org/show_bug.cgi?id=17650 --- Comment #14 from github-bugzi...@puremagic.com --- Commits pushed to dmd-cxx at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/296184f5419e1a7f8748688606950e747338f8f1 Fix issue 17650: std.getopt range violation when option value is a hyphen. https://github.com/dlang/phobos/commit/603e406b60cedd199b7bb2b6f9167438ec452307 Merge pull request #5612 from jondegenhardt/issue-17650-getopt-range-violation https://github.com/dlang/phobos/commit/7a0ff521f296fef66455a84f11864b9cb046c43a Fix issue 17650: std.getopt range violation when option value is a hyphen. --
[Issue 17650] [REG v2.075.0 b1-b4] std.getopt range violation
https://issues.dlang.org/show_bug.cgi?id=17650 --- Comment #13 from github-bugzi...@puremagic.com --- Commits pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/296184f5419e1a7f8748688606950e747338f8f1 Fix issue 17650: std.getopt range violation when option value is a hyphen. https://github.com/dlang/phobos/commit/603e406b60cedd199b7bb2b6f9167438ec452307 Merge pull request #5612 from jondegenhardt/issue-17650-getopt-range-violation --
[Issue 17650] [REG v2.075.0 b1-b4] std.getopt range violation
https://issues.dlang.org/show_bug.cgi?id=17650 --- Comment #12 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/7a0ff521f296fef66455a84f11864b9cb046c43a Fix issue 17650: std.getopt range violation when option value is a hyphen. --
[Issue 17650] [REG v2.075.0 b1-b4] std.getopt range violation
https://issues.dlang.org/show_bug.cgi?id=17650 --- Comment #11 from github-bugzi...@puremagic.com --- Commit pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/7a0ff521f296fef66455a84f11864b9cb046c43a Fix issue 17650: std.getopt range violation when option value is a hyphen. --
[Issue 17650] [REG v2.075.0 b1-b4] std.getopt range violation
https://issues.dlang.org/show_bug.cgi?id=17650 --- Comment #10 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/296184f5419e1a7f8748688606950e747338f8f1 Fix issue 17650: std.getopt range violation when option value is a hyphen. https://github.com/dlang/phobos/commit/603e406b60cedd199b7bb2b6f9167438ec452307 Merge pull request #5612 from jondegenhardt/issue-17650-getopt-range-violation Issue 17650: std.getopt range violation when option value is a hyphen merged-on-behalf-of: Andrei Alexandrescu --
[Issue 17650] [REG v2.075.0 b1-b4] std.getopt range violation
https://issues.dlang.org/show_bug.cgi?id=17650 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --
[Issue 17650] [REG v2.075.0 b1-b4] std.getopt range violation
https://issues.dlang.org/show_bug.cgi?id=17650 --- Comment #9 from Jon Degenhardt --- https://github.com/dlang/phobos/pull/5612 --
[Issue 17650] [REG v2.075.0 b1-b4] std.getopt range violation
https://issues.dlang.org/show_bug.cgi?id=17650 --- Comment #8 from Jon Degenhardt --- I'm preparing a PR to fix the underlying issue. A concern for the general release is that a single hyphen is often used to represent standard input in command line args. e.g. $ cat file.txt | my_d_program --file - > out.txt This will trigger the bounds check error if my_d_program is compiled in safe mode. --
[Issue 17650] [REG v2.075.0 b1-b4] std.getopt range violation
https://issues.dlang.org/show_bug.cgi?id=17650 --- Comment #7 from Jon Degenhardt --- (In reply to ZombineDev from comment #6) > The error doesn't make sense to me. @safe adds bounds checks where there are > none only when building with -release. I.e. if we're not building with > -release, there shouldn't be any change in behavior - bounds checking should > already be present (-boundscheck defaults to 'on' in that case). Am I > missing something? There was already an existing range violation, one that didn't have a unit test in the std.getopt module. Adding @safe to the function turned on bounds checking in debug mode. I had a unit test in my own code (not std.geopt) that triggered the out-of-bounds case. This unit test didn't get run until I actually ran my own unit tests with the new code. The out-of-bounds case occurs when there is an command line argument that is a single dash. e.g. $ myprogram -x a # okay $ myprogram -x - # out-of-bounds In the single dash case there's an attempt to access one character past it. Kind of understandable there wasn't a unit test for this originally. If you want to see the sequence that led to adding @safe read https://github.com/dlang/phobos/pull/5347. --
[Issue 17650] [REG v2.075.0 b1-b4] std.getopt range violation
https://issues.dlang.org/show_bug.cgi?id=17650 ZombineDev changed: What|Removed |Added CC||petar.p.ki...@gmail.com --- Comment #6 from ZombineDev --- The error doesn't make sense to me. @safe adds bounds checks where there are none only when building with -release. I.e. if we're not building with -release, there shouldn't be any change in behavior - bounds checking should already be present (-boundscheck defaults to 'on' in that case). Am I missing something? --
[Issue 17650] [REG v2.075.0 b1-b4] std.getopt range violation
https://issues.dlang.org/show_bug.cgi?id=17650 --- Comment #5 from Jon Degenhardt --- Wow. So I introduced this, initiated by trying add new unit tests. And my own unit tests caught it, but unfortunately, not the unit tests I added to Phobos. How ironic. Thanks for investigating Vladimir. --
[Issue 17650] [REG v2.075.0 b1-b4] std.getopt range violation
https://issues.dlang.org/show_bug.cgi?id=17650 --- Comment #4 from Vladimir Panteleev --- Actually, I believe we do count a breakage as a regression if something breaks for the end-user, regardless of what is going on under the hood. E.g. it's possible that for supported architectures, the range violation was completely benign. --
[Issue 17650] [REG v2.075.0 b1-b4] std.getopt range violation
https://issues.dlang.org/show_bug.cgi?id=17650 --- Comment #3 from Vladimir Panteleev --- Interesting - looking at the PR, this doesn't really seem like a regression, rather that the addition of the @safe attribute exposed an out-of-bounds array access that was always there. Feel free to reclassify, Jon. --
[Issue 17650] [REG v2.075.0 b1-b4] std.getopt range violation
https://issues.dlang.org/show_bug.cgi?id=17650 --- Comment #2 from Vladimir Panteleev --- Introduced in https://github.com/dlang/phobos/pull/5351 --
[Issue 17650] [REG v2.075.0 b1-b4] std.getopt range violation
https://issues.dlang.org/show_bug.cgi?id=17650 Martin Nowak changed: What|Removed |Added CC||c...@dawg.eu --- Comment #1 from Martin Nowak --- We'll address this with 2.075.1 to not delay the release even further. --
[Issue 17650] [REG v2.075.0 b1-b4] std.getopt range violation
https://issues.dlang.org/show_bug.cgi?id=17650 Jon Degenhardt changed: What|Removed |Added Severity|enhancement |regression --