You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Signal.signame(9) raises on Windows, though Signal.list["KILL"] is 9 #10095
Temurin 21.0.13, on GitHub's windows-latest runners
Windows Server 2025
Expected Behavior
pSignal.list["KILL"]pSignal.signame(9)
This should print 9 and "KILL", as it does on CRuby on Windows, which defines SIGKILL as 9 and builds Signal.list and Signal.signame from the same table:
Signal.list["KILL"] is 9, but Signal.signame(9) raises:
ArgumentError: invalid signal number: 9
org/jruby/RubySignal.java:211:in 'signame'
I think this goes back to #5430, which made Windows define KILL as 9 even though jnr-constants doesn't define SIGKILL there. It adds KILL to the map of names to numbers that Signal.list reads, but not to the map of numbers to names that Signal.signame reads:
Adding signums.put(9, "KILL") beside signals.put("KILL", 9) should fix it. The other signals jnr-constants defines on Windows (INT, ILL, ABRT, FPE, SEGV and TERM) go into both maps, so I think KILL is the only one affected.
I ran into this in Duel, which names the signal that killed a process with Signal.signame, and now falls back to the signal's number when that raises.
Activity