Bug #1344

sleep(0) sleeps forever on Mac OSX 10.4

Added by sean.ohalpin (Sean O'Halpin) about 3 years ago. Updated about 1 year ago.

[ruby-core:23094]
Status:Third Party's Issue Start date:04/01/2009
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:core
Target version:1.9.0-5
ruby -v:ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-darwin8.11.1]

Description

Instead of not sleeping at all, sleep(0) sleeps forever on Mac OSX 10.4. Multiruby output below:

$ uname -a
Darwin xxxx 8.11.1 Darwin Kernel Version 8.11.1: Wed Oct 10 18:23:28 PDT 2007; root:xnu-792.25.20~1/RELEASE_I386 i386 i386
$ multiruby -rtimeout -e 'Timeout::timeout(2) { sleep(0) }'
VERSION = jruby-1.1.6
CMD     = ~/.multiruby/install/jruby-1.1.6/bin/ruby -rtimeout -e Timeout::timeout(2) { sleep(0) }
RESULT = 0

VERSION = jruby-1.2.0RC2
CMD     = ~/.multiruby/install/jruby-1.2.0RC2/bin/ruby -rtimeout -e Timeout::timeout(2) { sleep(0) }
RESULT = 0

VERSION = 1.8.7-p72
CMD     = ~/.multiruby/install/1.8.7-p72/bin/ruby -rtimeout -e Timeout::timeout(2) { sleep(0) }
RESULT = 0

VERSION = v1_8_6_110
CMD     = ~/.multiruby/install/v1_8_6_110/bin/ruby -rtimeout -e Timeout::timeout(2) { sleep(0) }
RESULT = 0

VERSION = v1_9_1_0
CMD     = ~/.multiruby/install/v1_9_1_0/bin/ruby -rtimeout -e Timeout::timeout(2) { sleep(0) }
-e:1:in `sleep': execution expired (Timeout::Error)
        from -e:1:in `block in <main>'
        from -e:1:in `<main>'

RESULT = 256

TOTAL RESULT = 1 failures out of 5

Passed: jruby-1.2.0RC2, jruby-1.1.6, v1_8_6_110, 1.8.7-p72
Failed: v1_9_1_0

History

Updated by nobu (Nobuyoshi Nakada) about 3 years ago

Hi,

At Wed, 1 Apr 2009 17:33:51 +0900,
Sean O'Halpin wrote in [ruby-core:23094]:
> Instead of not sleeping at all, sleep(0) sleeps forever on
> Mac OSX 10.4. Multiruby output below:

Seems only on OS X 10.4.  It worked fine on 10.5.

Could you tell where it stops?

-- 
Nobu Nakada

Updated by akr (Akira Tanaka) almost 3 years ago

It may be related to follows.

"pthread_cond_timedwait() bug in Tiger?"
http://lists.apple.com/archives/darwin-dev/2005/May/msg00148.html
http://lists.apple.com/archives/Darwin-dev/2005/Jun/msg00174.html

Updated by nobu (Nobuyoshi Nakada) almost 3 years ago

  • Status changed from Open to Third Party's Issue

Also available in: Atom PDF