Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[correctness][confirmed-defect][sort] Conflicting repeated field separators are silently accepted

クローズ 初心者向け
#636 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go
領域
cli, testing

調査の方向性

builtins/sort/sort.go:154 と builtins/sort/sort.go:207-221 を読み、セパレータフラグの登録と検証を追跡してください。tests/scenarios/cmd/sort/flags/repeated_separator_conflict.yaml に回帰シナリオを追加し、対象を絞った sort シナリオを実行してください。競合するセパレータが繰り返し指定された場合に終了コード 2 と診断 sort: incompatible tabs が出力され、既存の sort シナリオも引き続き成功すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Generated by the rshell behavior correctness scanner.

  • Contract: BEH-005
  • Classification: confirmed-defect
  • Impact: medium
  • Target: sort
  • Scanned commit: 514d1cb8188fda6b1accca5955dfab3b0e8aa34a

Conflicting repeated field separators silently use the final value instead of rejecting the invocation. GNU reports incompatible tabs and exits 2. This can silently sort by unintended keys. No applicable documented divergence was found.

Contract sources
  • docs/BEHAVIOR_CONTRACTS.md:51-55: Repeated, short, long, and attached flags must follow documented or reference behavior.
  • SHELL_FEATURES.md:33: Supports -t SEP and -k KEYDEF without a repeated-separator divergence.
  • /usr/bin/sort: Native GNU coreutils 9.4 reproducibly emitted the exact expected diagnostic and status.
Implementation references
  • builtins/sort/sort.go:154: Registers the separator as one string value, retaining only the final occurrence.
  • builtins/sort/sort.go:207-221: Validates only the final separator; does not detect conflicting prior values.

Fixture setup

No files required. Both engines were executed twice through Python subprocess.run with captured stdout/stderr/status, LC_ALL=C, and a new tempfile.TemporaryDirectory(prefix='zz_correctness_scan_') for each run.

Reproducer

printf 'b:2\na:1\n' | sort -t : --field-separator=, -k2,2n

Commands used:

  • GOENV_VERSION=1.26.3 timeout 300s go build -o /tmp/zz_correctness_scan_rshell ./cmd/rshell
  • /tmp/zz_correctness_scan_rshell --allowed-commands rshell:sort,rshell:printf -c "printf 'b:2\na:1\n' | sort -t : --field-separator=, -k2,2n"
  • LC_ALL=C bash -c "printf 'b:2\na:1\n' | sort -t : --field-separator=, -k2,2n"
  • GOENV_VERSION=1.26.3 timeout 300s go test ./tests -run '^TestShellScenarios$/^cmd$/^sort$/^(basic|flags|errors|help|pathological|zz_correctness_scan_cases)$' -count=2 -timeout 240s
Expected

Exit code: 2

stdout:


stderr:

sort: incompatible tabs
Actual

Exit code: 0

stdout:

a:1
b:2

stderr:


Verification

  • Reproduction runs: 2
  • Reference: GNU coreutils 9.4 under LC_ALL=C. Two clean direct reproductions; the GNU-derived exact YAML expectations also failed in both focused scenario runs.
  • Temporary test: tests/scenarios/cmd/sort/zz_correctness_scan_cases/zz_correctness_scan_repeated_separator.yaml; removed after verification. Script, stdout, and stderr used YAML |+ scalars.
  • Suggested regression-test location: tests/scenarios/cmd/sort/flags/repeated_separator_conflict.yaml

Fingerprint: 6d4358f484ac1b96dbd4011e33187a11575a8c6deb58d7a3bc317d247dd20537

主要言語
Go
スター
31
フォーク
3
平均マージ
2日 23時間
マージ済み PR(30日)
13

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

DataDog/rshell のほかの issue

DataDog/rshell の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。