Skip to content

Kill: Display error on invalid UTF-8 rather than list of signals - #12878

Closed
iburaky2 wants to merge 2 commits into
uutils:mainfrom
iburaky2:fix/kill-invalid-utf8-error-message
Closed

iburaky2 wants to merge 2 commits into
uutils:mainfrom
iburaky2:fix/kill-invalid-utf8-error-message

Conversation

@iburaky2

Copy link
Copy Markdown
Contributor

Fixes #12816

@iburaky2
iburaky2 marked this pull request as draft June 14, 2026 18:30
@iburaky2
iburaky2 force-pushed the fix/kill-invalid-utf8-error-message branch from dd6998c to 1e33f1a Compare June 14, 2026 18:32
@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/cut/bounded-memory (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/pid-pipe (fails in this run but passes in the 'main' branch)
Note: The gnu test tests/csplit/csplit-heap is now being skipped but was previously passing.
Note: The gnu test tests/rm/many-dir-entries-vs-OOM is now being skipped but was previously passing.
Congrats! The gnu test tests/cp/link-heap is now passing!
Congrats! The gnu test tests/seq/seq-epipe is now passing!
Note: The gnu test tests/env/env-signal-handler was skipped on 'main' but is now failing.

@iburaky2
iburaky2 marked this pull request as ready for review June 14, 2026 19:25
@sylvestre
sylvestre force-pushed the fix/kill-invalid-utf8-error-message branch from 1e33f1a to 7a82315 Compare September 19, 2026 20:53
Comment thread src/uu/kill/src/kill.rs
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let mut args = args.collect_ignore();
let mut args = args.collect_lossy();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lossy replaces the bytes with U+FFFD in the error, GNU shows the original bytes escaped.
could we keep OsString for the pids/signals and use .quote() on them instead?

.arg("-l")
.arg(&arg)
.fails()
.stderr_contains("'\u{FFFD}a\u{FFFD}': invalid signal");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please also add a case without -l, e.g. an invalid UTF-8 pid

@sylvestre

Copy link
Copy Markdown
Contributor

Style and Lint jobs are failing, please fix them (the SELinux one is unrelated)
still waiting on the inline comments: keeping the original bytes with .quote() and a test without -l

@iburaky2

iburaky2 commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

Sorry, busy with other stuff atm

@iburaky2 iburaky2 closed this Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants