Debian Bug report logs - #547452
timelimit: Does not re-raise signals properly, returns bogus exit code instead

version graph

Package: timelimit; Maintainer for timelimit is Peter Pentchev <roam@debian.org>; Source for timelimit is src:timelimit (PTS, buildd, popcon).

Reported by: Teddy Hogeborn <teddy@recompile.se>

Date: Sat, 19 Sep 2009 21:03:01 UTC

Severity: normal

Tags: patch

Found in version timelimit/1.4-2

Fixed in version timelimit/1.5-1

Done: Peter Pentchev <roam@ringlet.net>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Peter Pentchev <roam@ringlet.net>:
Bug#547452; Package timelimit. (Sat, 19 Sep 2009 21:03:04 GMT) (full text, mbox, link).


Acknowledgement sent to Teddy Hogeborn <teddy@fukt.bsnet.se>:
New Bug report received and forwarded. Copy sent to Peter Pentchev <roam@ringlet.net>. (Sat, 19 Sep 2009 21:03:04 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Teddy Hogeborn <teddy@fukt.bsnet.se>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: timelimit: Does not re-raise signals properly, returns bogus exit code instead
Date: Sat, 19 Sep 2009 22:54:12 +0200
Package: timelimit
Version: 1.4-2
Severity: normal
Tags: patch


Returning signal+128 does *not* tell the invoking shell that the
program terminated by a signal.  Quote from
<http://www.cons.org/cracauer/sigint.html>:

	You cannot "fake" the proper exit status by an exit(3) with a
	special numeric value, even if you look up the numeric value
	for your system.  People often assume this since the manuals
	for shells often list some return value for exactly this.  But
	this is just a naming convention for your shell script.  It
	does not work from one UNIX API program to another.  The real
	information "did I exit on a signal yes/no" it not contained
	in the returned numeric value, it just looks that way in a
	shell which has just cooked up what the Unix API returned.

Patch:

--- timelimit-1.4/timelimit.c.~1~	2008-11-12 10:20:39.000000000 +0100
+++ timelimit-1.4/timelimit.c	2009-09-19 22:47:48.000000000 +0200
@@ -318,8 +318,29 @@
 		    (long)pid);
 	if (WIFEXITED(status))
 		return (WEXITSTATUS(status));
-	else if (WIFSIGNALED(status))
-		return (WTERMSIG(status) + 128);
+	else if (WIFSIGNALED(status)) {
+#ifdef HAVE_SIGACTION
+		struct sigaction act;
+		
+		memset(&act, 0, sizeof(act));
+		act.sa_handler = SIG_DFL;
+		act.sa_flags = 0;
+		if (sigaction(WTERMSIG(status), &act, NULL) < 0) {
+			err(EX_OSERR, "restoring signal handler for %d",
+			   WTERMSIG(status));
+			abort();
+		}
+#else  /* HAVE_SIGACTION */
+		if (signal(sig, SIG_DFL) == SIG_ERR) {
+			err(EX_OSERR, "restoring signal handler for %d",
+			   WTERMSIG(status));
+			abort();
+		}
+#endif /* HAVE_SIGACTION */
+		raise(WTERMSIG(status));
+		while (1)
+			pause();
+	}
 	else
 		return (EX_OSERR);
 }

-- System Information:
Debian Release: 5.0.3
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.26-2-686
Locale: LANG=C, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages timelimit depends on:
ii  libc6          2.7-18         GNU C Library: Shared libraries

timelimit recommends no packages.

-- no debconf information




Reply sent to Peter Pentchev <roam@ringlet.net>:
You have taken responsibility. (Sun, 01 Nov 2009 00:30:11 GMT) (full text, mbox, link).


Notification sent to Teddy Hogeborn <teddy@fukt.bsnet.se>:
Bug acknowledged by developer. (Sun, 01 Nov 2009 00:30:11 GMT) (full text, mbox, link).


Message #10 received at 547452-close@bugs.debian.org (full text, mbox, reply):

From: Peter Pentchev <roam@ringlet.net>
To: 547452-close@bugs.debian.org
Subject: Bug#547452: fixed in timelimit 1.5-1
Date: Sun, 01 Nov 2009 00:21:34 +0000
Source: timelimit
Source-Version: 1.5-1

We believe that the bug you reported is fixed in the latest version of
timelimit, which is due to be installed in the Debian FTP archive:

timelimit_1.5-1.diff.gz
  to main/t/timelimit/timelimit_1.5-1.diff.gz
timelimit_1.5-1.dsc
  to main/t/timelimit/timelimit_1.5-1.dsc
timelimit_1.5-1_i386.deb
  to main/t/timelimit/timelimit_1.5-1_i386.deb
timelimit_1.5.orig.tar.gz
  to main/t/timelimit/timelimit_1.5.orig.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 547452@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Peter Pentchev <roam@ringlet.net> (supplier of updated timelimit package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Sat, 31 Oct 2009 17:21:26 +0200
Source: timelimit
Binary: timelimit
Architecture: source i386
Version: 1.5-1
Distribution: unstable
Urgency: low
Maintainer: Peter Pentchev <roam@ringlet.net>
Changed-By: Peter Pentchev <roam@ringlet.net>
Description: 
 timelimit  - Simple utility to limit a process's absolute execution time
Closes: 547452
Changes: 
 timelimit (1.5-1) unstable; urgency=low
 .
   * New upstream release
     - add the -p flag to propagate a termination signal.  Closes: #547452
   * Bump Standards-Version to 3.8.3 with no changes.
Checksums-Sha1: 
 734f0029727f1b980e708571b3cb445d6f240a62 1844 timelimit_1.5-1.dsc
 db9af9830099e376c89cd94a691ec8387807a125 7222 timelimit_1.5.orig.tar.gz
 9d16799a7e961970ee7d2853fe6641d77a1e410a 3060 timelimit_1.5-1.diff.gz
 decc5cd57fc7c2ba76e263f751faebcccd79e337 10584 timelimit_1.5-1_i386.deb
Checksums-Sha256: 
 8685160dd2eac4f053e2155e5180303b7696354de85891a81fe4f2e44142909d 1844 timelimit_1.5-1.dsc
 10e65d328f771a8d71f7481deea524fa312595008c685805f511ebbff4734bea 7222 timelimit_1.5.orig.tar.gz
 a01489000ca541da456cbdf0142fb8561061ce6ea2c494fe9cdf2818c6c90c5e 3060 timelimit_1.5-1.diff.gz
 445f482f02fc234852de34e1a6de90541513df0cf56187bea7934f17285fe34c 10584 timelimit_1.5-1_i386.deb
Files: 
 9e492cbc3bd755dea2fda6ea0af25966 1844 utils optional timelimit_1.5-1.dsc
 e9d3da9a81479689a59c58a93914b034 7222 utils optional timelimit_1.5.orig.tar.gz
 28045231d868cd7c709149291c7cef7a 3060 utils optional timelimit_1.5-1.diff.gz
 3676f7b2f927a6ecd3ab1556209c2cda 10584 utils optional timelimit_1.5-1_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQIcBAEBAgAGBQJK7GGfAAoJEBxXDIkOS9CrAosP/2ReNp4auduKT2aGirL/fqwi
K8B9k13nAs/sMGXKZMuF1QoZIaOTQTbrHs+UM4sLKi7JDmN71K6QvS0HLFm9TJCc
4ybbQFdMWvjZ0Q7NtXAsDIA6a2g0v0HyV7EYpiFcAqC1ajTbnq0V5TW9X2aWkVWz
gVMtV7H8tOtdI/lu2xgIcp01U8Aa+EQtUqf5PTszbGFRhvBfAxpVGjhKmAAmKlkM
RgJVBZ2gTRiRf3ZErK7+vPFTeG401oOGhyYbcwLsRF549RtDM3KVhm4+opFWZ8Dv
/V1xkKq3lliYpuTB0eGmGz3Gqjofq4KDJ3GnT06uKdIpFMa0LthRSWPati4UZ8m1
LVsne4Iau7yS0o0CKOrHwGLfuefy/CpMF/UKroAOOSGD1bCMmdQYetDESQ0DERGq
8eWFh5ih6fx9ZqQnvtfaqWXak3hjfo/v193sDRyhoycpSZ0Poe+g98/2Hw+7ZWBf
WdiMGtiQ7zeqdOc9VB0GRqGKcxI89IYxft5740Y/gdXudDaGE9M7GMIHzX2ddm2I
Zh55Pi9g/rpD/imZCmtKZ/Tep4yZeNpdFg/35TG5yrsA6ceSAQ+psFZghqqokru5
EvwuvWDJ2NKMFpwga4F5fIWAhMIspxADWRmYOVFtFMPC6cb4nql5eXQmQgXSyIcE
ldXy9/N1Kh2eLvW77nmM
=w1CL
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sun, 13 Dec 2009 07:35:53 GMT) (full text, mbox, link).


Bug unarchived. Request was from Teddy Hogeborn <teddy@recompile.se> to control@bugs.debian.org. (Mon, 10 Oct 2011 08:05:37 GMT) (full text, mbox, link).


Changed Bug submitter to 'Teddy Hogeborn <teddy@recompile.se>' from 'Teddy Hogeborn <teddy@fukt.bsnet.se>' Request was from Teddy Hogeborn <teddy@recompile.se> to control@bugs.debian.org. (Mon, 10 Oct 2011 08:05:38 GMT) (full text, mbox, link).


Bug archived. Request was from Teddy Hogeborn <teddy@recompile.se> to control@bugs.debian.org. (Mon, 10 Oct 2011 08:05:39 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Jul 1 13:13:12 2023; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.