On Mon, 2 Jun 2008 14:18:34 +0100
"Eric Kow" <eric.kow@gmail.com> wrote:
> Maybe we can reproduce this more easily by setting PAGER to varying
> values of sleep...
I tried that, with this simple script:
#!/bin/bash
i=0
while true
do
i=$[i+3]
cat >/tmp/mypager <<EOF
echo Waiting for $i seconds...
sleep $i
exit 0
EOF
chmod 755 /tmp/mypager
DARCS_PAGER=/tmp/mypager darcs query a
echo ok
done
but for some reason, that does not seem to trigger the problem, at
least not in the first minute or so...
Instead I gave strace enough time: when darcs behave normally, I see
this trace:
...
wait4(24975, 0x7fff1c389554, 0, NULL) = ? ERESTARTSYS (To be restarted)
--- SIGVTALRM (Virtual timer expired) @ 0 (0) ---
rt_sigreturn(0x1a) = 61
wait4(24975, 0x7fff1c389554, 0, NULL) = ? ERESTARTSYS (To be restarted)
--- SIGVTALRM (Virtual timer expired) @ 0 (0) ---
rt_sigreturn(0x1a) = 61
wait4(24975, 0x7fff1c389554, 0, NULL) = ? ERESTARTSYS (To be restarted)
--- SIGVTALRM (Virtual timer expired) @ 0 (0) ---
write(4, "\377", 1) = 1
rt_sigreturn(0x2) = 61
wait4(24975, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 24975
--- SIGCHLD (Child exited) @ 0 (0) ---
unlink("/tmp/darcs-pager24972") = 0
getcwd("/home/lele/wip/darcs-2.0", 4096) = 25
chdir("/home/lele/wip/darcs-2.0") = 0
chdir("/home/lele/wip/darcs-2.0") = 0
getrusage(RUSAGE_SELF, {ru_utime={0, 192012}, ru_stime={0, 24001}, ...}) = 0
write(4, "\376", 1) = 1
clock_gettime(0xfffffffe /* CLOCK_??? */, {0, 214695426}) = 0
rt_sigprocmask(SIG_BLOCK, [HUP INT ABRT PIPE TERM], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
futex(0xbe0eac, 0x85 /* FUTEX_??? */, 1) = 1
futex(0xbe0ed8, 0x81 /* FUTEX_??? */, 1) = 1
futex(0xbcad80, 0x81 /* FUTEX_??? */, 1) = 1
futex(0xbe0eac, 0x85 /* FUTEX_??? */, 1) = 1
futex(0xbe0ed8, 0x81 /* FUTEX_??? */, 1) = 1
futex(0xbcad80, 0x81 /* FUTEX_??? */, 1) = 1
sched_yield() = 0
timer_settime(0, 0, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 0
timer_delete(0) = 0
fcntl(0, F_GETFL) = 0x8002 (flags O_RDWR|O_LARGEFILE)
fcntl(1, F_GETFL) = 0x8002 (flags O_RDWR|O_LARGEFILE)
fcntl(2, F_GETFL) = 0x8002 (flags O_RDWR|O_LARGEFILE)
rt_sigprocmask(SIG_BLOCK, [TTOU], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
getrusage(RUSAGE_SELF, {ru_utime={0, 192012}, ru_stime={0, 24001}, ...}) = 0
exit_group(0) = ?
But after "threshold" seconds I get this instead:
...
wait4(26621, 0x7fff8c6c6884, 0, NULL) = ? ERESTARTSYS (To be restarted)
--- SIGVTALRM (Virtual timer expired) @ 0 (0) ---
rt_sigreturn(0x1a) = 61
wait4(26621, 0x7fff8c6c6884, 0, NULL) = ? ERESTARTSYS (To be restarted)
--- SIGVTALRM (Virtual timer expired) @ 0 (0) ---
write(4, "\377", 1) = 1
rt_sigreturn(0x2) = 61
wait4(26621, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 26621
--- SIGCHLD (Child exited) @ 0 (0) ---
unlink("/tmp/darcs-pager26618") = 0
getcwd("/home/lele/wip/darcs-2.0", 4096) = 25
chdir("/home/lele/wip/darcs-2.0") = 0
chdir("/home/lele/wip/darcs-2.0") = 0
getrusage(RUSAGE_SELF, {ru_utime={0, 208013}, ru_stime={0, 28001}, ...}) = 0
write(4, "\376", 1) = 1
clock_gettime(0xfffffffe /* CLOCK_??? */, {0, 231146281}) = 0
rt_sigprocmask(SIG_BLOCK, [HUP INT ABRT PIPE TERM], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
futex(0xbe10dc, 0x85 /* FUTEX_??? */, 1) = 1
sched_yield() = 0
sched_yield() = 0
sched_yield() = 0
sched_yield() = 0
and that final "sched_yield()" goes on forever... That's the loop that
requires a "kill -9" to be stopped.
ciao, lele.
--
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele@nautilus.homeip.net | -- Fortunato Depero, 1929. |