Repository navigation
WIP: util-linux family oracle audit W7 — cal/col/column/hexdump/rev/logger/whereis/getopt/more/look/kill/renice/tzset/getconf (Refs #1462) - #1468
Merged
Conversation
…Refs #1462) look: exit 1 when no match is printed (util-linux look.c:196) and report open failures as 'look: <file>: <reason>' (look.c:155,164). renice: success line is '<pid> (process ID) old priority <o>, new priority <n>' (renice.c:115); missing priority/operands report 'not enough arguments' and an invalid priority gains the try-help line (renice.c:175,181). getconf: no variable without -a is a usage error instead of a free-form summary; -a prints bare 'NAME value' lines; two operands are the glibc pathconf form (PATH_VAR PATH) with existence check; unknown variables report 'Unrecognized variable' as typed. Golden cases: look 03/04, getconf 01, renice 01/02.
util-linux getopt.c processes its own options sequentially, so 'getopt -s bogus -T' dies on the bad shell (exit 2) instead of answering the -T probe (exit 4). A raw_args prescan now validates each -s value when met and returns the -T verdict when met. -h/--help and -V/--version were missing (getopt.c:376-390). Golden cases: getopt 01/02.
Most LOGGER_OPTIONS were silent no-ops. Now implemented per util-linux logger.c: -f reads the file (one entry per line, -e skips empty lines); stdin is logged per line, not concatenated; --prio-prefix honors a leading <pri> per line; the default tag is the login name (logger.c main), not the literal 'logger'; -p is validated against the facility/severity tables with the oracle's 'unknown facility/priority name' diagnostics (logger.c:230,236); -i embeds the pid in the tag; -S truncates; --no-act suppresses the sink writes; -n/-P/-T/-d actually send (RFC3164 by default, --rfc5424 for the 5424 header) over UDP/TCP via winsock, with the oracle's failure exits (logger.c:312,329); a failed event-log write now fails the command. --sd-id/--sd-param and -u (unix socket) remain unimplemented and are recorded in the audit report.
…1462) whereis.c parses argv by hand; the set-based binding got all of it wrong: -B/-M/-S now walk ctx.raw_args and consume every following token as a directory until an option token, REPLACING the category defaults (free_dirlist+construct), and -B/-M/-S without -f fails with 'whereis: option -f is missing' (whereis.c:671). -b/-m/-s build the cumulative per-name mask with the oracle's reset rule. -l prints one 'bin:/man:/src: <dir>' line per directory (list_dirlist). -u follows the code, not the man page: a name prints only when its total entry count is not exactly one. -g (previously a hidden no-op) enumerates entries and glob-matches them. Names are canonicalized to basenames like lookup() does. -h/-V print and exit.
Oracle: util-linux 2.39.3 misc-utils/cal.c. The old face knew only -m and bare [month] year operands. Now: optstring "13mjn:sSywYvc:Vh" (cal.c:373) minus -w/-v/-c/--color/--reform/--iso (documented as not implemented) -- -1/-3/-s/-m (last -s/-m wins)/-j (day width 4, month width 27; cal.c:393, DOY_MONTH_WIDTH), -n NUM, -S span (monthly() starts num_months/2 back, cal.c:1000-1012), -y/-Y (year family: gutter 3, cal.c:567; -Y keeps full titles, no year banner), -V/-h. Operand grammar per cal.c:467-530: lone month name or [day] month year, month names = full or locale abbreviation, case-insensitive (monthname_to_number); error shapes: strtos32_or_err quoted-arg parse errors, 'illegal month value: use 1-12', 'illegal day value: use 1-31' / 'use 1-<days in month>', 'illegal year value: use positive integer', 'bad usage' + try-help for >3 operands. Month blocks: 8 lines always, gutter 2 monthly / 3 year family, months_in_row 3 (cal.c:177,579). Finisher adjudication of the staged work left by the interrupted run: structure and layout verified against the oracle as sound; three error-shape fixes applied on top (quoted-arg parse errors for -n/day/year, first-digit month dispatch per cal.c:486) and two differential cases added for them (09/10). Cases: tests/differential/corpus/cal/03..10 (03 -3 span, 04 -j, 05 month name, 06 illegal month, 07 -m -n 2, 08 -y, 09 bad -n, 10 junk-suffixed month).
Oracle: util-linux 2.39.3 text-utils/col.c. The old face was a
plain line vector with overwrite: no half-line model, no default
space->tab compression, -x misunderstood as tab expansion, \v
inverted, -l default 128, no long options, operands ignored.
Now col.c's model end to end: positions counted in half lines
(NL +2, col.c:428; VT/ESC-7 -2, ESC-8 -1, ESC-9 +1, col.c:411-450),
storage row rounds up when -f is absent (update_cur_line,
col.c:470-474), rows render with stable column sort, overstrike
groups joined by backspaces (or last-char-only under -b,
col.c:282-286), gaps compressed to tabs by default
(col.c:293-306,649; -x disables, -h/-x mutually exclusive per
optutils), SO/SI charset state carried per character
(col.c:312-317), blank separation re-emitted by the flush_blanks
arithmetic including the trailing max_line reconciliation
(col.c:203-228,709-715) and the empty-input early exit
(col.c:699-703). -l NUM is strtou32_or_err-shaped ('bad -l
argument', col.c:565) with default 32 lines; operands are
'bad usage' + try-help (col.c:583-586). Version/help/bad -l and
the -h/-x exclusion are decided in argv order by a raw_args
prescan, since getopt_long permutes and decides sequentially.
Cases: tests/differential/corpus/col/01..11 (plain, overstrike,
-b, default tab compression, -x, VT overstrike, -f half line,
rounded half line, bad usage, bad -l, -h -x exclusion).
Oracle: util-linux 2.39.3 text-utils/column.c (+ libsmartcols
print.c / lib/jsonwrt.c for the table renderer). The old face
cat'd its input in the default mode (column.c:556 in the old
numbering) and bound -x/-e/-E/-N to invented options.
Default mode is now FILLCOLS with the exact pitch/tab arithmetic
of columnate_fillcols/fillrows (column.c:669-745): entries keep
leading whitespace, whitespace-only lines drop unless -L,
maxlength >= termwidth degrades to SIMPLE (column.c:973-977).
-x is --fillrows; -c/--output-width (and deprecated --columns)
is validated in argv order ('invalid columns argument',
'unlimited' = 0), as are -l ('invalid columns limit argument',
zero rejected) and the exclusive groups {C,N} {J,x} {t,x}.
Table mode binds -t/-N/-C/-O/-E/-d/-e/-m/-H/-R/-T/-W/-l/-n/-o
to the oracle meanings; splitting follows local_wcstok
(greedy '\t ' by default, per-character with empty cells kept
under -s; -l keeps the rest of the line in the last cell). The
first data row is no longer consumed as JSON keys: -J requires
-N/-C (column.c:962-965), names and the table name are
lowercased, empty/missing cells print null, and the byte layout
follows jsonwrt (3-space indents, '},{' row joins). Cells are
no longer truncated unless -T (or a noextreme column) gives up
width in the shrink pass. --table-* without a table is the
oracle errx (column.c:955-960); --tree without --tree-id and
--tree-parent likewise (column.c:947-953). Missing files warn
'column: <file>: No such file or directory' and exit 1 after
the rest; a directory is the fatal 'read failed' path.
Cases: tests/differential/corpus/column/01..17.
…t 64, -l conversions Refs #1462 Per util-linux misc-utils/kill.c (2.39.3): - exit status is now 0 / 1 / KILL_EXIT_SOMEOK 64 for all-ok / all-failed / partial (kill.c:553-558); process_command returns the status instead of a bool. - non-numeric operands are process names resolved over the process list, restricted to the caller's own processes unless -a/--all (kill.c:510-541); unmatched names report 'cannot find process' (kill.c:540) and count as failed operands. - -p/--pid prints pids without signaling, --verbose prints 'sending signal N to pid M' before each signal (kill_verbose, kill.c:430-439); --pid with an explicit signal is the oracle's mutual-exclusion error (kill.c:314). - failure diagnostics take the warn shape 'sending signal to <arg> failed: <strerror>' (kill.c:453) with ESRCH/EPERM tails; missing operands report 'not enough arguments' (kill.c:384). - -l conversion prints the signal name in both directions (print_signal_name, kill.c:106-121) with arg_to_signum maskbit exit-status handling, so -l 129 prints HUP (kill.c:176-191); failures read 'unknown signal: %s' (kill.c:290), extra conversion arguments 'too many arguments' (kill.c:286), and bad -s names go through err_nosig (kill.c:169-174). - help text: SIGINT is graceful alongside SIGTERM, matching the action mapping. 12 differential cases under tests/differential/corpus/kill/.
…aw %s/%c Refs #1462 Per util-linux hexdump (2.39.3 sources): - partial blocks are blank-padded to the full row width in the 2-byte modes (bpad, hexdump-display.c:215-233) and the row's last trailing space is suppressed (nospace, hexdump-parse.c:474): -x/-d/-o rows are 71 columns, default rows 47, full or partial. The -x unit pin that asserted a 72-wide row and the two pins that asserted unpadded partial rows are corrected to the oracle shape. - the -o unit is ' %06o ' (8 wide, hexdump.c -o fs); it rendered 9-wide units and 80-column rows. - -n/-s parse through strtosize semantics (base-0 numbers, size suffixes, fractions) with the oracle's error text 'failed to parse length/offset' (strutils.c parse_size, strtosize_or_err). - the format engine accepts %_c (the escaped-character conversion of the oracle's own -c format string) and pads character, string and escaped conversions to their field width; %c writes the raw byte and %s writes raw bytes up to the first NUL instead of '.'-masking non-printing bytes. - -f files follow addfile: only blank lines and lines whose first non-space character is '#' are skipped (no trailing comments), and the open failure reads 'can\'t read <file>: ...' (hexdump-parse.c:77-96). - a missing input file reports unquoted 'hexdump: <file>: No such file or directory' (hexdump-display.c next()). New unit tests for the -o row, %_c, %s NUL stop, raw %c, hex and suffix -n values, octal -s, and the -n parse error; 12 differential cases under tests/differential/corpus/hexdump/.
Refs #1462 rev's open failure quoted the filename; the oracle warn shape is unquoted (util-linux rev.c:165), matching the hexdump/more wording pass. rev otherwise re-verified against rev.c: UTF-8-unit reversal, -0/--zero records, unterminated final record, framework-provided --help/--version. more re-verified against text-utils/more.c (2.39.3): the directory banner (more.c:467) and 'cannot open' wording (more.c:459) are byte-identical to the oracle, non-tty mode applies -s and the +NUM/+/pattern starts like the oracle's shared line machinery, and exit status aggregates per-file failures. No more code changes. 7 more cases + 5 rev cases under tests/differential/corpus/.
…g, size default Refs #1462 Per util-linux misc-utils/logger.c (2.39.3): - remote delivery now defaults to the RFC 5424 protocol, as the oracle documents ('the syslog protocol (the default for remote)'); --rfc3164 is actually read now and selects the BSD format. Previously --rfc3164 was declared but never read and remote defaulted to 3164. - --msgid, --sd-id and --sd-param fill the RFC 5424 MSGID and structured-data header fields; a --sd-param before any --sd-id and a repeated --sd-id are the oracle's hard errors (logger.c:590-612). - --octet-counting switches TCP framing to the RFC 6587 length prefix (logger.c:448-479); without it TCP keeps newline framing. - the message size defaults to 1024 (logger.c:1121) instead of unlimited; --size parses strtosize-style values with the oracle's 'failed to parse size' error (logger.c:1208). - -u/--socket and --journald are declared and explicitly refused: they address Unix syslog facilities with no Windows counterpart, where the command previously rejected them as unknown options and could not state the reason.
Refs #1462 The inherited whereis commit assigned path::u8string() (std::u8string in C++20) to std::string, which MSVC rejects (C2440) — the branch's CI builds failed on both architectures at this line. Convert via wstring_to_utf8 like the other directory-walking commands.
This was referenced Oct 31, 2026
Refs #1462 Adjudication of corpus/getconf/01 (baseline EXIT_DIFF on PR #1468): glibc getconf reports an unknown variable as "getconf: Unrecognized variable \x60NOSUCHVAR'" and exits 2 (reproduced against the local glibc 2.39 binary). The applet printed ASCII quotes and exited 1, in both the variable-list path and the two-operand pathconf path. Align both: backtick/apostrophe quoting, exit status 2.
Refs #1462 Adjudication of corpus/renice/02 (baseline OUT_DIFF on PR #1468): util-linux renice.c tests argc < 2 ("not enough arguments", renice.c:171) before it strtol-parses the priority ("invalid priority", renice.c:181), so a lone 'renice abc' reports not-enough-arguments. The applet parsed first and reported invalid-priority. Move the no-operands check ahead of the parse; verified against the system renice for 'abc', 'abc 123', '5', '-n abc', '-n abc 123'.
Refs #1462 Adjudication of corpus/whereis/02 and /03 (baseline OUT_DIFF on PR #1468): whereis.c stores every dirlist entry canonicalized (whereis.c:254, ls->path = canonicalize_path(dir)), so hits print as absolute paths even for relative -B/-M/-S directories; the applet joined and printed the operand spelling verbatim ('d1/thing'). Canonicalize the bin/man/src lists after assembly (realpath semantics with canonicalize_path's fall-back-to-input on failure, lib/canonicalize.c), which also aligns the -l listing.
…ed line Refs #1462 Adjudication of corpus/col/06, /07, /08 (baseline OUT_DIFF on PR #1468), verified byte-for-byte against col.c built from the util-linux 2.39.3 audit tree: - The half-line triggers are the control bytes 007/010/011, not the ASCII digits: col.c:80-82 defines RLF as '\a', RHLF as BS, FHLF as TAB (the ESC-7/8/9 notation names control bytes). The applet keyed on '7'/'8'/'9' and the 07/08 cases fed ESC-'9'; both are corrected (ESC followed by a digit is an unknown escape, swallowed whole). New case 12 pins the digit form. All col cases plus RHLF/RLF/no-trailing-newline probes now match the oracle binary exactly. - EOF flush: col.c:705 flushes through the last buffered line (main walks ctl.l to the list end); the applet flushed only through the last stored row, so after a VT backup the rows below the store point (case 06's 'two') were silently dropped. Flush all buffered rows and compute trailing blanks from the last buffered line.
…tract Refs #1462 Adjudication of corpus/more/01-05 (baseline OUT_DIFF x4 + EXIT_DIFF on PR #1468), oracle behavior reproduced locally from util-linux more 2.39.3. In the harness topology (stdin and stdout both redirected) GNU more degenerates by design: - main()'s stdin preamble consumes the redirected stdin, then forces print_banner and clears first_file (more.c:2121-2123): every file operand prints the 14-colon separator banner, and +NUM/+/PATTERN positioning is dropped for the run; - display_file() raw-copies with copy_file() when stdout is not a tty (more.c:1936-1937), so -s squeezing never applies; - checkf() only warns on an unopenable file (more.c:459) and the process leaves through more_exit() = EXIT_SUCCESS (more.c:789): missing files exit 0. The applet's non-interactive path implemented the documented pager semantics instead (no banner, squeeze/positioning applied, exit 1 on missing files). Rewrite that branch to the more.c contract; when stdin is a console, positioning is honored by copying raw bytes from the positioned line. The interactive branch no longer propagates per-file failures into the exit status either (same more_exit rule).
Refs #1462 Adjudication of corpus/hexdump/09 and /12 (baseline OUT_DIFF on PR #1468), verified against hexdump built from the util-linux 2.39.3 audit tree: - strtosize_or_err reports through err() (lib/strutils.c), so a bad -n/-s value reads "failed to parse length: 'bogus': Invalid argument" — the applet dropped the errno text. parse_size_value now reports the errno string (EINVAL for structural errors, ERANGE for range errors, mirroring parse_size) and both call sites append it. - When every file argument fails to open, get() adds the summary "hexdump: all input file arguments failed" (hexdump-display.c:366); the applet printed only the per-file warnings. Track attempted/failed operands in read_stream and emit the summary when all failed.
Refs #1462 Adjudication of corpus/cal/03-10 (baseline OUT/EXIT_DIFF on PR #1468): the CI oracle for cal is BSD ncal, not util-linux cal (same root cause as the already-whitelisted 01/02). ncal pads month rows to 22 columns with trailing spaces where the applet prints the util-linux 20-column layout (03/04/05/08); ncal rejects bad months, unknown -n and operand overflow via errx(EX_USAGE) = exit 64 where util-linux cal.c exits 1 (06/09/10); and ncal's -m consumes a month argument where util-linux -m is --monday (07). Evidence from FreeBSD ncal.c (optstring, parsemonth, usage via EX_USAGE). Cases stay valid against a util-linux cal; the applet is not changed.
…te-match Refs #1462 Follow-up to the whereis canonicalization fix (17bb53f), verified in differential run 41218315534 (oracle green): every other adjudicated family flipped (cal KNOWN_DIFF via whitelist, col/getconf/renice/more/hexdump PASS), but whereis 02/03 remain OUT_DIFF for a harness-topology reason, not a product divergence. Both sides now canonicalize dirlists (whereis.c:254), yet the oracle prints its own mktemp sandbox root in POSIX form while the subject prints the parallel sandbox in Windows UNC form, and runner.sh's normalize_output performs no path-prefix masking (CR strip + dd mask only). Corpus path cases pass elsewhere precisely because they print relative paths. Whitelist both as environment artifacts with the mechanism recorded; the product fix stands on the whereis.c contract.
Refs #1462 The branch added 84 case files over the recorded baseline (the full W7 corpus plus col/12 from the adjudication addendum) without registering them, so compare-baseline failed every run with 'new case' errors regardless of verdicts. Register them surgically with their buckets from the adjudicated run 41218945020 (oracle job green): the fixed families PASS, cal 03-10 and whereis 02/03 are KNOWN_DIFF per whitelist.txt, and the kill set is recorded at its shadow buckets (OUT_DIFF/EXIT_DIFF, explained by #1478 - registering the bucket does not bless the diff, it makes any future worsening or improvement visible). All 321 pre-existing entries are byte-preserved.
… (Refs #1462) Adjudication of the 6 ctest failures on this branch, all TEST-wrong (the product matches misc-utils/kill.c in util-linux 2.39.3): - -lHUP / -l SIGHUP / -lRTMIN+1: the -l arm (kill.c:281-296) resolves via arg_to_signum and prints through print_signal_name (kill.c:106-121), so a name argument prints its canonical NAME ("HUP", "RT1"), never its number. The number-for-name expectation is procps kill semantics. Tests renamed to *_to_canonical_name_*. - -s 999: err_nosig (kill.c:169-174, called at kill.c:330) prints "unknown signal %s; valid signals:" + table, not "invalid signal" (that errx at kill.c:378 serves -<sig> style arguments only). - no operands: parse_arguments ends errx("not enough arguments") (kill.c:383-384). - kill abc: a non-numeric operand is a process NAME; the operand loop (kill.c:502-541) falls back to a /proc name lookup and warns cannot find process "%s". No "invalid PID" diagnostic exists for this shape; test renamed accordingly.
Adjudication of the 10 ctest failures on this branch, all TEST-wrong: the tests were written for a model where a redirected stdout means "no banner, display options applied". util-linux more.c (text-utils/more.c, 2.39.3) says otherwise for the harness environment (stdin redirected): - main() consumes the redirected stdin preamble first, then forces print_banner and clears first_file (more.c:2110-2123), so every file operand gets the colon separator banner (more.c:1918-1934) even when it is the only file. The product gates the banner on exactly this condition (src/commands/more.cpp, stdin_redirected). - With stdout redirected the body is copy_file(), a raw byte copy (more.c:1881-1888, 1936-1937): -s squeeze lives only in screen() (more.c:1830) and does not apply. - +NUM/+/PATTERN positioning belongs to the FIRST displayed input (more.c:1899-1907); redirected stdin consumes it, so file operands are copied whole. - A missing file only warns in checkf (more.c:459) and more_exit _exit(EXIT_SUCCESS) unconditionally (more.c:789): exit is 0. Expectations rewritten to banner + raw content; the missing-file test now pins exit 0 and the checkf warning.
…(Refs #1462) TEST-wrong: for a bare year operand, misc-utils/cal.c sets header_year (cal.c:572) and cal_output_header prints the year once as a standalone heading with bare month names (cal.c:777-790). The "January 2026" form is the single-month case (cal.c:791) and the BSD ncal year layout -- the differential line already whitelists ncal for cal; the unit pin must follow util-linux cal.c.
…1462) TEST-wrong: glibc 2.39 getconf -a (the recorded oracle for this applet) prints 320 flat "NAME value" lines with no headings -- reproduced locally against glibc 2.39. The "System configuration" expectation encoded the old product's invented section title. Pin PATH_MAX and PAGESIZE membership instead.
TEST-wrong: misc-utils/look.c reports an unopenable dictionary with err(EXIT_FAILURE, "%s", file) (look.c:154-155) -- operand spelling as typed plus the strerror text, no "cannot open" wording, no quotes. The product already prints exactly that.
…Refs #1462) TEST-wrong: sys-utils/renice.c checks the argument count before parsing (renice.c:173-176): warnx("not enough arguments") + try-help, exit 1. No "missing process ID" diagnostic exists. The product already prints the oracle form.
Adjudication of the 5 ctest failures on this branch, all
TEST-wrong (text-utils/column.c, util-linux 2.39.3):
- --json bare: errx requires --table-columns/--table-column for
--json (column.c:957-958); the positive JSON pin now passes -N,
and a new pin covers the bare--json rejection.
- CRLF in table mode: read_input truncates only at '\n'
(column.c:615-618) and the default input separator is "\t "
(column.c:841), so a trailing CR stays in the last cell. Test
renamed keeps_*, pin now asserts the CR is retained.
- Missing operand: warn("%s", name) + skip, eval += failure
(column.c:966-972) -- "column: <name>: <strerror>", not the
invented cannot-open/for-reading wording.
- Directory operand: fopen succeeds on the oracle and the read
fails -- err("read failed") (column.c:608-611).
- New-layout options: -x is no_argument (column.c:799) and -E
requires an argument (column.c:813); the old argv made "1,2" a
file operand and "-t" the -E argument. Rewritten with valid
-t/-N/-E shapes.
TEST-wrong (this test was added by the audit itself; its pad count was miscalculated). Per text-utils/hexdump-display.c, each missing 2-byte unit of a partial block is bpad()'d to "%4s " (bpad at :215-240, F_BPAD print at :123-125) = 5 spaces, with the last rep's separator suppressed via nospace (:269-279). Six units missing after "0064": 1 (its own separator) + 5x5 + 4 = 30. The product emits exactly 30; fix the expectation.
# Conflicts: # tests/differential/baseline.json
caomengxuan666
marked this pull request as ready for review
October 31, 2026 21:02
This was referenced Nov 1, 2026
caomengxuan666
added a commit
that referenced
this pull request
Nov 1, 2026
…ine half) The GNU master differential gate has been red on main since 2026-10-29: the audit waves landed corpus cases whose product behavior was never matched, and the merge of #1468 (audit-w7-util-linux) recorded them as OUT_DIFF/EXIT_DIFF in baseline.json without whitelisting or fixing - the runner's zero-unexplained-diff rule then fails every run. All 23 cases adjudicated against the pinned oracle (GNU_BIN=/usr/bin, Ubuntu 24.04, coreutils 9.4, /usr/bin/kill = procps-ng 4.0.4): Product fixes (22 cases): - kill (11): /usr/bin/kill is procps-ng 4.0.4, not util-linux/uutils kill. Rewritten to the procps contract: -l NAME prints the NUMBER and -l NUM (1..31) the NAME; 0/32+/unknown names warn 'unknown signal name X' on stderr at exit 0; -l converts only its first operand; Linux ABI table (USR1=10, no RTMIN); no-args and unknown options (-p, -n, ...) print the procps usage block at exit 1; operands are PIDs only ('failed to parse argument: X'); delivery errors read 'kill: (PID): <errno>' with ESRCH before EINVAL; exit 0/1. New opt.cppm policy allow_unknown_long_options_as_positionals so kill can deliver its own option diagnostic. kill unit tests moved to the same contract. - date (3): %+ passes through literally (no local %c-with-zone expansion); -I argmatch list order hours,minutes,date,seconds,ns; -r FILE error uses quotef (quote only when needed, so plain names print unquoted). - env (1): '=x' empty-name assignments are accepted like glibc putenv does (child blocks drop them - CreateProcessW rejects empty-name entries, documented divergence); case reshaped to 'env -i =x' since a full env dump can never byte-match through interop. - printenv (2): cases looked up LC_ALL, which the WSL-side launch never delivers to the Windows subject; the runner now exports WINUX_DIFFVAR to both sides (WSLENV no-flag = verbatim) and the cases use it. - nice (1): invalid adjustment prints one line (no Try tail). - pathchk (1): route system-category error codes through the shared Win32->POSIX mapping so ENOTDIR reads 'Not a directory'. - stty (1): the recover form is exactly 36 fields (GNU termios shape); stty -g emits 36 to keep the round-trip, so the 10-field case is 'invalid argument' before -F is opened. - timeout (1): missing operand prints only the Try line (GNU has no message there), exit 125. - regressions/70: passes with the ordered env entries fix from #1352. Whitelist (1): - mktemp/05: mkstemp names are random by contract; the shape is pinned natively by the unit tests. baseline.json: the 12 entries recorded OUT_DIFF/EXIT_DIFF for these cases are re-recorded PASS (ratchet tightened; nothing else touched - the 116 never-recorded and 18 mismatched entries stay for #1462/#1483). Verified locally (Ubuntu-GitLab WSL, coreutils 9.4, WINUXCMD_BIN= build-vs): full corpus 642 cases -> 598 PASS / 35 KNOWN_DIFF / 5 SKIP / 4 EXIT_DIFF, where the four (diff3/25, install/02, locate/01, locate/02) are local host-allowlist noise (this machine resolves the allowlisted host binaries into the local Niubash install; CI resolves Git-for-Windows ones and records them PASS). Unit tests for the touched commands: 260/260.
caomengxuan666
added a commit
that referenced
this pull request
Nov 1, 2026
…ine half) (#1494) * fix(differential): adjudicate the 23 gate-blocking cases (#1486 baseline half) The GNU master differential gate has been red on main since 2026-10-29: the audit waves landed corpus cases whose product behavior was never matched, and the merge of #1468 (audit-w7-util-linux) recorded them as OUT_DIFF/EXIT_DIFF in baseline.json without whitelisting or fixing - the runner's zero-unexplained-diff rule then fails every run. All 23 cases adjudicated against the pinned oracle (GNU_BIN=/usr/bin, Ubuntu 24.04, coreutils 9.4, /usr/bin/kill = procps-ng 4.0.4): Product fixes (22 cases): - kill (11): /usr/bin/kill is procps-ng 4.0.4, not util-linux/uutils kill. Rewritten to the procps contract: -l NAME prints the NUMBER and -l NUM (1..31) the NAME; 0/32+/unknown names warn 'unknown signal name X' on stderr at exit 0; -l converts only its first operand; Linux ABI table (USR1=10, no RTMIN); no-args and unknown options (-p, -n, ...) print the procps usage block at exit 1; operands are PIDs only ('failed to parse argument: X'); delivery errors read 'kill: (PID): <errno>' with ESRCH before EINVAL; exit 0/1. New opt.cppm policy allow_unknown_long_options_as_positionals so kill can deliver its own option diagnostic. kill unit tests moved to the same contract. - date (3): %+ passes through literally (no local %c-with-zone expansion); -I argmatch list order hours,minutes,date,seconds,ns; -r FILE error uses quotef (quote only when needed, so plain names print unquoted). - env (1): '=x' empty-name assignments are accepted like glibc putenv does (child blocks drop them - CreateProcessW rejects empty-name entries, documented divergence); case reshaped to 'env -i =x' since a full env dump can never byte-match through interop. - printenv (2): cases looked up LC_ALL, which the WSL-side launch never delivers to the Windows subject; the runner now exports WINUX_DIFFVAR to both sides (WSLENV no-flag = verbatim) and the cases use it. - nice (1): invalid adjustment prints one line (no Try tail). - pathchk (1): route system-category error codes through the shared Win32->POSIX mapping so ENOTDIR reads 'Not a directory'. - stty (1): the recover form is exactly 36 fields (GNU termios shape); stty -g emits 36 to keep the round-trip, so the 10-field case is 'invalid argument' before -F is opened. - timeout (1): missing operand prints only the Try line (GNU has no message there), exit 125. - regressions/70: passes with the ordered env entries fix from #1352. Whitelist (1): - mktemp/05: mkstemp names are random by contract; the shape is pinned natively by the unit tests. baseline.json: the 12 entries recorded OUT_DIFF/EXIT_DIFF for these cases are re-recorded PASS (ratchet tightened; nothing else touched - the 116 never-recorded and 18 mismatched entries stay for #1462/#1483). Verified locally (Ubuntu-GitLab WSL, coreutils 9.4, WINUXCMD_BIN= build-vs): full corpus 642 cases -> 598 PASS / 35 KNOWN_DIFF / 5 SKIP / 4 EXIT_DIFF, where the four (diff3/25, install/02, locate/01, locate/02) are local host-allowlist noise (this machine resolves the allowlisted host binaries into the local Niubash install; CI resolves Git-for-Windows ones and records them PASS). Unit tests for the touched commands: 260/260. * test(differential): record failing-case evidence; fix pathchk ENOTDIR across filesystem views - runner.sh appends a 'Failing case evidence' section to the report for every unexplained mismatch: both sides' rc, stdout and stderr. A CI-only divergence is otherwise undiagnosable from its bucket alone (whitelist entries are expected to cite byte-level evidence). - pathchk: POSIX lstat answers ENOTDIR when a non-final component is a file, but the not-found verdict for 'regfile/file' depends on which Win32 filesystem view answers (NTFS gives ERROR_DIRECTORY; the 9p/UNC view of the WSL work directory can give a not-found class, which made differential pathchk/01 exit 0 on the CI runner while passing locally). The not-there path now walks the component chain: the first existing prefix that is not a directory pins 'Not a directory'. * fix(pathchk): make_api_path_operand already yields the wide path; runner evidence skips KNOWN_DIFF * test(differential): whitelist regressions/70 as interop-PATH environment noise The recorded evidence (baseline-report.md, run 41323739882) shows both sides agree on the -i block and the assignment order (Z=1, A=2, rc 0); the CI subject's extra TERM/HOME lines come from the inner env resolving to the WSL /usr/bin/env through the interop bridge, because the baseline workflow builds only the winuxcmd target and build-vs carries no per-command env.exe. Same environment category as whereis/02; passes in the full-build shape. * test(differential): restore whitelist-linux.txt (API base64 truncation clobbered it; the previous commit intended only to append the regressions/70 entry) * test(differential): record the full 642-case coverage in baseline.json compare-baseline demands every corpus case be recorded; the audit waves added 124 case files without ledger entries, which kept the baseline job red behind the runner gate (and 3 msys-oracle cases were recorded PASS instead of the linux shape's SKIP). This records every case's verdict from the verified CI run 41324820632 (642 cases: 599 PASS, 38 KNOWN_DIFF, 5 SKIP; the runner gate reported Differences: 0), including the whitelist-driven reclassifications the linux shape carries (cal ncal artifacts, updatedb/01, regressions/12/42/56/57/70, mkdir/30). This absorbs the never-recorded census from #1483's survey into the ledger as data; the 18 recorded-but-mismatched investigations remain with #1462. * test(differential): compare-baseline explains declared-shape skips A case whose file declares 'oracle:' or 'subject:' runs only in that shape; under the recorded linux/interop shape runner.sh SKIPs it by construction. Recording that skip clashed with the growth gate (PASS -> SKIP counts as worsening), while not recording it tripped 'unexplained skip' - the two gates disagreed about msys-oracle cases (basename/50, dirname/03, test/13). The declaration in the case file is itself the explanation, so compare-baseline now accepts such skips regardless of the recorded bucket, and the ledger keeps those cases' recorded PASS (the verdict of the shape that can actually run them). --------- Co-authored-by: cmx <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
W7 cluster of the per-command oracle audit (#1462). Method: util-linux 2.39.3 source first (contract: options, formats, exit codes), then the applet; clean-room (behavior facts only).
Landed so far:
In progress on this branch: logger (-f/per-line/default tag/priority validation), whereis (-B/-M/-S...-f grammar, -l format), cal (-1/-3/-n/-y/-j, week-start, month names, year gutter), col (cell-stack model), column (columnation + option rebindings), hexdump (float conversions, -n/-s suffixes), getopt (-T ordering, -h/-V), kill (-p/--timeout/name resolution).
CI is the build gate (no local MSVC). Standing noise: regressions/70-env. Full per-command verdicts land in REPORT.md in the workdir and a summary comment at completion.