/usr/bin/timeout doesn't reflect exit code of launched commandline

Bug #78742 reported by Brak
6
Affects Status Importance Assigned to Milestone
tct (Debian)
Fix Released
Unknown
tct (Ubuntu)
In Progress
Medium
Unassigned

Bug Description

Binary package hint: timeout

Behold:

root@# grep foo /etc/hosts
root@# echo $?
1
root@# timeout -9 10 grep foo /etc/hosts
root@# echo $?
0

And some stracing... maybe I'm missing something. Here are the two commands like above, except with strace prepended, respectively.

close(1) = 0
exit_group(1) = ?
root@# echo $?
0
root@#

alarm(100) = 0
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0, NULL) = 24637
--- SIGCHLD (Child exited) @ 0 (0) ---
exit_group(256) = ?
root@# echo $?
0
root@#

Changed in tct:
importance: Undecided → Medium
status: Unconfirmed → Confirmed
Revision history for this message
Dan O'Huiginn (daniel-ohuiginn) wrote :

This is a bug which has been known for some years, and which the Debian maintainer has refused to fix without an OK from upstream. There's a patch attached to the Debian bug, which would solve the problem quite easily.

I'm in favour of fixing the bug, but it's possible that by now people are expecting timeout to behave in the broken way.

So, I'm going to take this bug on, run it past upstream, and fix either the program or the documentation depending on what they say.

Changed in tct:
assignee: nobody → daniel-ohuiginn
status: Confirmed → In Progress
Changed in tct:
status: Unknown → Unconfirmed
Revision history for this message
Dan O'Huiginn (daniel-ohuiginn) wrote :

This will apparently be fixed in release 1-17, which is currently in preparation.

Revision history for this message
Dan O'Huiginn (daniel-ohuiginn) wrote :

....and in fact, the new version has been released, and is at http://www.porcupine.org/forensics/tct.html

Unless the bug is causing anybody immediate major problems, I suggest we wait until the new version gets into Debian.

Revision history for this message
Brak (brak-archive) wrote :

This bug has been causing immediate problems. The only reason I would consider it "major" is because I can now count on two hands the number of developers who have a less than great feeling about Ubuntu vs. other Linux distros that have a working timout.

I would appreciate it going in sooner rather than later if at all possible. tct is already at version 1.18.

Thanks for any help moving this forward.

-Joerg

Revision history for this message
Brak (brak-archive) wrote :

I was hoping this was fixed for Hardy Heron 8.04, but that doesn't seem to be the case.

The /usr/bin/timeout that's still buggy is from the "timeout" package. Perhaps I should file a bug against that one as well. The tct package appears to no longer contain a timeout binary.

Revision history for this message
Dan (danser) wrote :

It's been a while since this bug was reported, so I made a debdiff (attached) which updates TCT to 1.18 and fixes the bug.

Changed in tct:
assignee: daniel-ohuiginn → nobody
Changed in tct:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.