Commit ca8b666
committed
fix(console): seven doors reject invalid arguments (#2166)
#2165 pinned all of this as behaviour it deliberately did not change, because
".NET's answer for it is recollection rather than measurement". /rv supplies the
measurement, and it CORRECTS THE FRAMING on the most important row.
THE CURSOR BOUND IS NOT A BELIEF ABOUT A PLATFORM LAYER. .NET validates a cursor
coordinate in Console.cs ITSELF, before dispatch:
// Basic argument validation. The PAL implementation may provide further validation.
if (left < 0 || left >= short.MaxValue)
throw new ArgumentOutOfRangeException(nameof(left), left, SR.ArgumentOutOfRange_ConsoleBufferBoundaries);
-- Console.cs:550-559
so it applies on every platform, and the comparison is `>=`: 32766 is the last
accepted column and 32767 is the FIRST REJECTED one. That off-by-one is the easy
mistake and both sides of it are pinned.
THE OTHER SIX ARE A DIFFERENT CASE, AND THE DIFFERENCE IS STATED RATHER THAN
GLOSSED. .NET's UNIX pal throws PlatformNotSupportedException for every one of them
-- CursorSize's setter (ConsolePal.Unix.cs:193-197), SetWindowSize (:387-394),
SetWindowPosition (:744-747), SetBufferSize (:727-730), the buffer setters
(:305-315) and MoveBufferArea (:717-725). So on this port's runtime platform .NET
states NO RANGE for them at all.
The ranges adopted are .NET's WINDOWS pal's, because they are the only ones .NET
defines. Copying the Unix answer would REMOVE A FEATURE THIS PORT OFFERS rather
than repair one -- SetWindowSize and SetWindowPosition really do emit xterm escape
sequences here -- which is the wrong direction for a validation ticket.
WHAT IS DELIBERATELY NOT REPRODUCED. Several of those Windows checks are
buffer-relative: SetBufferSize's lower bound is the current window's right edge,
SetWindowPosition's upper bound is the buffer width, MoveBufferArea's bounds are the
buffer's dimensions. This port has no buffer geometry to compare against, so it
enforces the half of each check that needs none -- the sign and the short.MaxValue
ceiling. That is a subset of .NET's rejection, never a superset: nothing .NET
accepts is refused here.
Every rejection carries .NET's parameter name, the offending value as the actual
value, and .NET's exact resource text (ConsoleBufferBoundaries, CursorSize,
ConsoleWindowPos, ConsoleBufferLessThanWindowSize). This is what #2163 and #2164
could not do: their exception TYPES were probe-verified and their TEXTS were not,
and the ticket recorded that the texts rode along on this one. A rejected CursorSize
is not stored, so a caller reads back its previous value rather than the invalid one.
Six mutations caught: the cursor ceiling becomes inclusive; the cursor size upper
bound is dropped; store the cursor size before validating; MoveBufferArea checks
only its first argument; SetWindowSize accepts zero; the buffer extent lower bound
becomes 0. Two of those were invalid as first written -- one a no-op, one rejected
by -Werror -- and a third was MASKED, because changing only SetWindowSize's width
check left height rejecting (0,0) anyway. All three were reformulated rather than
counted as passes.
ALSO REPAIRED: a flake this session introduced. #2105's unpaired-rename test assumed
the two events share one inotify batch; it passed three times in isolation and then
FAILED inside this ticket's gate run, where the machine is busy enough to split the
batch. It now counts only deliveries arriving AFTER the stop, which is the property
under test and cannot fail when the batch splits. A test that is intermittently
green is not evidence (#2352).
Three pins inverted in place, three cases replacing three, so the count does not
move. Downstream: neither cna nor mobile-eggbert calls any of these doors -- zero
sites in both.
Gate: 17,323 run, 17,323 passed, 0 failed, 0 skipped across 38 executables, GREEN,
confirmed by two consecutive full runs.
docs/Migration-ConsoleArgumentDomains.md1 parent 997dd22 commit ca8b666
6 files changed
Lines changed: 361 additions & 47 deletions
File tree
- docs
- modules
- console
- include/System
- tests/System
- io/tests/System/IO
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
395 | 449 | | |
396 | 450 | | |
397 | 451 | | |
398 | 452 | | |
399 | | - | |
400 | | - | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
401 | 456 | | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
407 | 463 | | |
408 | 464 | | |
409 | 465 | | |
410 | 466 | | |
411 | | - | |
412 | | - | |
| 467 | + | |
| 468 | + | |
413 | 469 | | |
414 | 470 | | |
415 | 471 | | |
| |||
477 | 533 | | |
478 | 534 | | |
479 | 535 | | |
480 | | - | |
481 | | - | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
482 | 559 | | |
483 | 560 | | |
484 | 561 | | |
| |||
536 | 613 | | |
537 | 614 | | |
538 | 615 | | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
539 | 621 | | |
540 | 622 | | |
541 | 623 | | |
| |||
546 | 628 | | |
547 | 629 | | |
548 | 630 | | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
549 | 643 | | |
550 | 644 | | |
551 | 645 | | |
| |||
569 | 663 | | |
570 | 664 | | |
571 | 665 | | |
572 | | - | |
| 666 | + | |
573 | 667 | | |
574 | 668 | | |
575 | 669 | | |
576 | 670 | | |
577 | | - | |
| 671 | + | |
578 | 672 | | |
579 | 673 | | |
580 | 674 | | |
581 | 675 | | |
582 | 676 | | |
583 | 677 | | |
584 | | - | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
585 | 682 | | |
586 | 683 | | |
587 | 684 | | |
588 | 685 | | |
589 | 686 | | |
590 | 687 | | |
591 | 688 | | |
592 | | - | |
593 | | - | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
594 | 695 | | |
595 | 696 | | |
596 | 697 | | |
| |||
602 | 703 | | |
603 | 704 | | |
604 | 705 | | |
605 | | - | |
606 | | - | |
| 706 | + | |
607 | 707 | | |
608 | 708 | | |
609 | 709 | | |
| |||
0 commit comments