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
While trying to initialize a variable that represents a pid to something I thought was safe (an Integer that could never be a valid pid), I ended up killing my VM by doing:
pid= -1# Invalid pidProcess.new(pid).exists?# returns trueProcess.new(pid).kill# kills all processes in my Linux VM
Then I found that kill -9 -1 also kills my Linux VM. Possibly related Stack Overflow thread.
Even if Process.new(-1).kill is intended behaviour, should Process.new(-1).exists? return true?
The text was updated successfully, but these errors were encountered:
The initialize method of Process is defined as protected, but that's the default visibility status, so that new becomes public. It's probably a bug in the compiler. I will mark it as private. You shouldn't be able to instantiate a process by pid like that.
Just to provide more context on why this had the effect that it had - PID -1 is a special case. Trying to kill it results in everything except the kill process itself and init being killed.
While trying to initialize a variable that represents a
pid
to something I thought was safe (an Integer that could never be a validpid
), I ended up killing my VM by doing:Then I found that
kill -9 -1
also kills my Linux VM. Possibly related Stack Overflow thread.Even if
Process.new(-1).kill
is intended behaviour, shouldProcess.new(-1).exists?
return true?The text was updated successfully, but these errors were encountered: