system': no implicit conversion from nil to integer (TypeError) from wifi-state-observer:169:in vpn_down’
from wifi-state-observer:46:in block in run' from wifi-state-observer:54:in call’
from wifi-state-observer:54:in run' from wifi-state-observer:54:in run’
from wifi-state-observer:270:in `’
it seems like rb_last_status_get() might be non-thread safe? Though I
would expect at that time the GVL would held so I am not sure why would
rb_last_status_get() return nil. This is running 1.9.3.
Considering the message about conversion from nil to integer, I’d expect
the problem to be that either “cmd” or “@ncui_pid” is returning nil and
can’t be passed into the system command.
Considering the message about conversion from nil to integer, I’d expect
the problem to be that either “cmd” or “@ncui_pid” is returning nil and
can’t be passed into the system command.
Can you add a line which puts the cmd value out before triggering the
system command and report it back? It still looks like the only way to
get that error in this code is to pass something invalid to system.
system() happens inside vpn_down(). As you can see the main thread is
glib2 loop and the other forks/execs a binary (that connects to a
vpn).
It seems Process.waitall takes the child process spawned by system().
In my environment, the problem can be reproducible as follows,
sometimes (not always):
% ruby -ve ’
Thread.new { loop { p Process.waitall } }
loop { p system(“true”) }
’
ruby 2.0.0dev (2012-08-15 trunk 36702) [x86_64-linux]
-e:3: warning: instance variable status not initialized
-e:3:in system': no implicit conversion from nil to integer (TypeError) from -e:3:in block in ’
from -e:3:in loop' from -e:3:in ’