From: Tanaka Akira Date: 2012-08-29T17:30:46+09:00 Subject: Re: Is calling system() from a thread suppose to be safe? 2012/8/25 Raúl Gutiérrez Segalés : > Sure, here is the full-script: > > http://www.itevenworks.net/~rgs/ruby/wifi-state-observer > > 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 `
' How about avoiding Process.waitall? I feel the error message can be improved, though. -- Tanaka Akira