bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sleep, nanosleep test failures


From: Pádraig Brady
Subject: Re: sleep, nanosleep test failures
Date: Fri, 12 Nov 2010 11:16:37 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3

On 12/11/10 10:57, Bruno Haible wrote:
> Hi,
> 
> On a stock Linux/x86 machine I observe these test failures:
> 
>   test-nanosleep.c:78: assertion failed
>   FAIL: test-nanosleep
>   test-sleep.c:53: assertion failed
>   FAIL: test-sleep
> 
> It's a "Red Hat Enterprise Linux ES release 4 (Nahant Update 8)" machine
> with Linux 2.6.9 kernel and glibc 2.3.4.
> 
> The reason is that when sleep() is asked to sleep for 49 days and interrupted
> after 1 second, it returns an "unslept amount" of 24.85 days. This is similar
> to the Cygwin 1.5.x behaviour, for which we already have a workaround.
> 
> ltrace execution:
> 
>   signal(14, 0x8048740)                            = NULL
>   alarm(1)                                         = 0
>   sleep(4233600 <unfinished ...>
>   --- SIGALRM (Alarm clock) ---
>   <... sleep resumed> )                            = 2147156
> 
> strace execution:
> 
>   rt_sigaction(SIGALRM, {0x8048740, [ALRM], SA_RESTORER|SA_RESTART, 
> 0x5ee9b8}, {SIG_DFL}, 8) = 0
>   alarm(1)                                = 0
>   rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
>   rt_sigaction(SIGCHLD, NULL, {SIG_DFL}, 8) = 0
>   rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
>   nanosleep({4233600, 0}, 0xbfe8a254)     = ? ERESTART_RESTARTBLOCK (To be 
> restarted)
>   --- SIGALRM (Alarm clock) @ 0 (0) ---
>   sigreturn()                             = ? (mask now [])
> 
> Looking at the implementation of sleep() in glibc, the bug must be really in
> the kernel.
> 
> Jim, is this OK to commit? It fixes the issue.

OK by me anyway :)
Doing precisely that was on my list of things to check:
http://lists.gnu.org/archive/html/bug-coreutils/2010-11/msg00007.html
It's nice we can easily detect the issue.

cheers,
Pádraig.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]