[correctness][confirmed-defect][sort] GNU NUL field-separator notation is rejected
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 84/100
Hướng nghiên cứu
Bắt đầu với builtins/sort/sort.go:215-219, nơi các đối số dấu phân cách dài hơn một byte bị từ chối, và so sánh cách xử lý với hành vi của GNU sort -t '\0' được mô tả trong issue. Thêm trường hợp hồi quy tại tests/scenarios/cmd/sort/flags/nul_field_separator.yaml và chạy các kịch bản sort tập trung. Kết quả đạt yêu cầu khi lệnh chấp nhận dấu phân cách và tạo ra b\na\n với mã thoát 0 và không có stderr.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Generated by the rshell behavior correctness scanner.
- Contract:
BEH-005 - Classification:
confirmed-defect - Impact:
medium - Target:
sort - Scanned commit:
514d1cb8188fda6b1accca5955dfab3b0e8aa34a
The supported -t option rejects GNU's documented two-character notation for an ASCII NUL separator. With a missing second field and stable sorting, GNU preserves the input order; rshell instead rejects the valid separator before reading input. No applicable divergence is documented.
Contract sources
docs/BEHAVIOR_CONTRACTS.md:13-19,51-55: Supported option values follow reference behavior absent a documented divergence.SHELL_FEATURES.md:33: The supported surface includes -t SEP, stable sorting, and key definitions./usr/share/info/coreutils.info.gz: sort invocation, --field-separator: The GNU manual explicitly says to specify ASCII NUL using the two-character string '\0', for example sort -t '\0'.
Implementation references
builtins/sort/sort.go:215-219: All separator arguments longer than one byte are rejected, including GNU's special backslash-zero notation.
Fixture setup
Create a fresh temporary directory for each execution containing data.txt with exact bytes "b\na\n". Execute from that directory. The script's quoted separator contains one literal backslash followed by zero.
Reproducer
sort -s -t '\0' -k2,2 data.txt
Commands used:
GOENV_VERSION=1.26.3 timeout 300s go build -o /tmp/zz_correctness_scan_rshell ./cmd/rshellIn a fresh fixture directory, save the exact script as zz_correctness_scan_script.sh, then run: /tmp/zz_correctness_scan_rshell --allowed-commands rshell:sort --allowed-paths "$PWD" zz_correctness_scan_script.shIn an equivalent fresh fixture directory: LC_ALL=C bash --noprofile --norc zz_correctness_scan_script.shGOENV_VERSION=1.26.3 timeout 300s go test ./tests -run '^TestShellScenarios$/cmd/sort' -count=2 -v
Expected
Exit code: 0
stdout:
b
a
stderr:
Actual
Exit code: 2
stdout:
stderr:
sort: multi-character tab "\\0"
Verification
- Reproduction runs: 4
- Reference: Local GNU sort 9.4 reference verified twice from fresh fixtures. rshell CLI reproduced twice; the YAML scenario failed identically in both focused scenario runs. Docker comparison was attempted but skipped after HTTP 502.
- Temporary test: tests/scenarios/cmd/sort/zz_correctness_scan_cases/zz_correctness_scan_nul_separator.yaml (removed)
- Suggested regression-test location:
tests/scenarios/cmd/sort/flags/nul_field_separator.yaml
Fingerprint: 2bcca49cfc44c5ea39c1f1dcf2a53cc5baa5d2a2278af231bb767ae3e324491c
- Ngôn ngữ chính
- Go
- Star
- 31
- Fork
- 3
- Merge trung bình
- 2 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 13
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của DataDog/rshell
-
[correctness][missing-coverage][sort] Strict uniqueness checks lack numeric-key equivalence coverageĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[correctness][missing-coverage][sort] Mixed files and repeated stdin lack a combined regressionĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[correctness][confirmed-defect][sort] Conflicting repeated field separators are silently acceptedĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của DataDog/rshell
Issue tương tự
-
enhancement exporter/awss3 needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
open-telemetry/opentelemetry-collector-contrib#51905 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/docs theme/validation
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Add skip-to-content linkĐang mởa11y P1-significant
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
infiniflow/ragflow#20625 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 69/100
SpecterOps/Janus#6 · 1 bình luận ·