New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process#kill: Unknown signal: EXIT (ArgumentError) #1474

Closed
deepj opened this Issue Nov 20, 2018 · 4 comments

Comments

2 participants
@deepj
Copy link

deepj commented Nov 20, 2018

This was originally caught in this Rack spec https://github.com/rack/rack/blob/master/test/spec_server.rb#L146 then https://github.com/rack/rack/blob/master/lib/rack/server.rb#L445.

There is no issue under MRI (Ruby 2.5.3). Something about kill -0 command https://stackoverflow.com/a/14296353

To reproduce:

Process.kill(0, Process.pid)

Error:

process.rb:1:in `kill': Unknown signal: EXIT (ArgumentError)
	from process.rb:1:in `each'
	from process.rb:1:in `kill'
	from process.rb:1:in `<main>'

@nirvdrum nirvdrum self-assigned this Nov 30, 2018

@nirvdrum nirvdrum added the bug label Nov 30, 2018

@nirvdrum

This comment has been minimized.

Copy link
Member

nirvdrum commented Nov 30, 2018

Thanks for reporting this. It looks like there's no signal with value 0. Ruby uses a special name of "EXIT" for it, but otherwise it doesn't have a name. Calling kill with a value of 0 for the signal performs permissions checks without actually sending a signal to the process. We currently use Java to send signals and the Java mechanism needs to be able to look up a signal by name, but there is no name. So, as far as I can tell, there's no way to send this special signal value from Java. We may have to just break out and make a POSIX call directly.

@nirvdrum

This comment has been minimized.

Copy link
Member

nirvdrum commented Nov 30, 2018

I typed that up a bit too hastily. We do call kill natively if the PID we're killing is not the same as the process's PID. Updating that to take signal 0 into account looks to be a simple fix.

@nirvdrum nirvdrum added this to the 1.0.0-rc11 milestone Dec 4, 2018

@nirvdrum

This comment has been minimized.

Copy link
Member

nirvdrum commented Dec 4, 2018

Thanks again for the report. I've fixed the issue and added a spec for it in 063b055.

@nirvdrum nirvdrum closed this Dec 4, 2018

@nirvdrum

This comment has been minimized.

Copy link
Member

nirvdrum commented Jan 15, 2019

@deepj The fix for this should have shipped with the new 1.0.0 RC 11 release. Please comment here if you're still seeing a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment