Skip to content

Map signal 9 to KILL for Signal.signame on Windows - #10083

Merged
headius merged 1 commit into
jruby:jruby-10.0from
sferik:fix-windows-signame-kill
Nov 17, 2026
Merged

headius merged 1 commit into
jruby:jruby-10.0from
sferik:fix-windows-signame-kill

Conversation

@sferik

@sferik sferik commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Fixes #10080

On Windows, Signal.list["KILL"] is 9 but Signal.signame(9) raises ArgumentError. Since #5430 we add KILL to the name-to-number map that Signal.list reads, but not to the number-to-name map that Signal.signame reads. This adds it to both, like CRuby, which builds both from the same table: https://github.com/ruby/ruby/blob/06b18f11f4b0078e2683c661e7762fff7c04636c/include/ruby/win32.h#L425-L427

I added a spec that Signal.signame returns a name for every number in Signal.list. It passes on CRuby 3.4.12 and on JRuby on macOS, in both interpreter and JIT mode. I couldn't run it on Windows locally, so I'm counting on CI for that.

I targeted jruby-10.0 because the bug is there too.

On Windows, KILL is added to the name-to-number map that Signal.list
reads, but not to the number-to-name map that Signal.signame reads.
So Signal.signame(9) raised ArgumentError, though Signal.list["KILL"]
is 9.

Fixes jruby#10080
@headius headius added this to the JRuby 10.1.4.0 milestone Nov 17, 2026
@headius
headius merged commit dcc2a5d into jruby:jruby-10.0 Nov 17, 2026
126 of 127 checks passed
@sferik

sferik commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

@headius should I open another PR against the master branch?

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