Race condition in Process#wait ------------------------------ Key: JRUBY-3780 URL: http://jira.codehaus.org/browse/JRUBY-3780 Project: JRuby Issue Type: Bug Components: Core Classes/Modules Affects Versions: JRuby 1.3.1 Environment: jruby 1.2.0 (ruby 1.8.6 patchlevel 287) (2009-03-16 rev 9419) [i386-java] java version "1.6.0_0" OpenJDK Runtime Environment (IcedTea6 1.5) (fedora-18.b16.fc10-i386) OpenJDK Client VM (build 14.0-b15, mixed mode) Reporter: TwP Priority: Critical
{code:title=racer.rb} io = IO.popen 'sleep 5' puts Time.now Process.wait io.pid puts Time.now {code} The expected output is two timestamps with five seconds difference between them. Works as expected with MRI 1.8.6 and 1.9.1 JRuby, however, produces spurious results with one of the three outcomes: 1) works just like MRI 2) two timestamps are printed - one immediately after the other (no time difference) 3) No child processes - No child processes (Errno::ECHILD) Running the script repeatedly will produce all of the results listed above. This behavior is observed with JRuby 1.2.0 on Fedora 10 and with JRuby 1.3.1 on Mac OS X. Blessings, TwP -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email