clock_nanosleep failure

Dmitry V. Levin ldv at altlinux.org
Tue Jun 6 10:39:36 UTC 2017


On Mon, Jun 05, 2017 at 05:34:16PM +0200, Andreas Schwab wrote:
> A lot of tests fail because clock_nanosleep fails:
> 
> $ ../strace -e clock_nanosleep ./clock_nanosleep >/dev/null
> clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=0, tv_nsec=789985}, NULL) = 0
> clock_nanosleep(CLOCK_REALTIME, 0, NULL, 0xefca3994) = -1 EFAULT (Bad address)
> clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=0, tv_nsec=789985}, 0xefca3994) = 0
> clock_nanosleep(CLOCK_MONOTONIC, 0, {tv_sec=0, tv_nsec=1000000000}, 0xefca3994) = -1 EINVAL (Invalid argument)
> clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=-559038737, tv_nsec=4207869677}, 0xefca3994) = -1 EINVAL (Invalid argument)
> clock_nanosleep(CLOCK_MONOTONIC, 0, {tv_sec=-559038737, tv_nsec=4207869677}, 0xefca3994) = -1 EINVAL (Invalid argument)
> clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=0, tv_nsec=999999999}, {tv_sec=0, tv_nsec=920211999}) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
> --- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---
> clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, {tv_sec=1496676522, tv_nsec=80487000}, 0xefca3994) = ? ERESTARTNOHAND (To be restarted if no handler)
> --- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---
> clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, {tv_sec=1496676522, tv_nsec=80487000}, 0xefca3994) = ? ERESTARTNOHAND (To be restarted if no handler)
> --- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---
> clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, {tv_sec=1496676522, tv_nsec=80487000}, 0xefca3994) = ? ERESTARTNOHAND (To be restarted if no handler)
> --- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---
> clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, {tv_sec=1496676522, tv_nsec=80487000}, 0xefca3994) = ? ERESTARTNOHAND (To be restarted if no handler)
> --- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---
> clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, {tv_sec=1496676522, tv_nsec=80487000}, 0xefca3994) = 0

I would expect this sequence only if SIGALRM was SIG_IGN'ed
which is not the case in this test.

Why clock_nanosleep is restarted after being interrupted by a signal
handler?  What kind of kernel is behaving this way?

P.S. The mailing list doesn't seem to be working properly these days.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20170606/4a72602f/attachment.bin>


More information about the Strace-devel mailing list