From: Christian Reiniger Date: 2004-11-24T05:21:24+09:00 Subject: Possible Bug: Running thread blocks access to /proc/loadavg --nextPart4207632.xdrB97hdsK Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline =46ollowing code: =2D--------- puts "Outside: " + File.read('/proc/loadavg') t =3D Thread.new { sleep 3 } puts "Outside 2: " + File.read('/proc/loadavg') =2D---------- On my system, the "Outside 2:..." is never printed (ruby just hangs with=20 no CPU utilization). Just the existence of some spawned thread seems to=20 prevent access to /proc/loadavg. Other files (e.g. /proc/cpuinfo) can be accessed just fine. Putting the thing into the spawned thread generates the same behavior=20 (hang on the second File.read). Using File.open with File::NONBLOCK instead of File.read does not change=20 anything. chris@chrisbig > ruby --version ruby 1.8.2 (2004-11-06) [i686-linux] chris@chrisbig > uname -a Linux chrisbig 2.6.9 #3 Tue Nov 23 21:28:15 CET 2004 i686 AMD Athlon(tm)=20 XP 2800+ AuthenticAMD GNU/Linux chris@chrisbig > esearch -F -c dev-lang/ruby [ I] ruby (1.8.2_pre3): An object-oriented scripting language Same behavior with kernel 2.6.1-rc1. On the following machine it works fine: creinig@munin:~$ ruby --version ruby 1.8.2 (2004-11-03) [i386-linux] creinig@munin:~$ uname -a Linux munin 2.4.27-1-386 #1 Fri Sep 3 06:24:46 UTC 2004 i686 GNU/Linux A strace dump (from a run on the first machine) is available at=20 http://sunsite.dk/~creinig/tmp/loadavg-strace Any idea? =2D-=20 Christian Reiniger Install once, run forever. Linux. --nextPart4207632.xdrB97hdsK Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBBo6nRGpB8KmR8IwcRAgwhAKDPPNxIkjI0iSEjlEG9xnKfo9NsowCeLaBz h0b5vR+6AWwmL5+hwrawkv4= =3cc+ -----END PGP SIGNATURE----- --nextPart4207632.xdrB97hdsK--