Your message dated Sat, 25 Jun 2011 19:47:30 +0000
with message-id <[email protected]>
and subject line Bug#631608: fixed in joystick 1:1.4.1-1
has caused the Debian Bug report #631608,
regarding inputattach spins CPU at 100%
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
631608: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=631608
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: inputattach
Version: 1:1.4-1
Severity: important
Tags: upstream patch

When booting, inputattach tries to hook up my serial port for some w8001 action 
but causes the CPU instead to spin at 100%.  strace'ing shows it's spinning on 
read(3,NULL,0) and is returning EBUSY; /proc/$PID/fd/3 points to /dev/ttyS0.

Looking at the source I found the following caused the problem:

http://linuxconsole.svn.sourceforge.net/viewvc/linuxconsole?view=revision&revision=2422

http://linuxconsole.svn.sourceforge.net/viewvc/linuxconsole/trunk/utils/inputattach.c?r1=2412&r2=2422&pathrev=2422

We need to tell Kees Cook that errno does actually have more than two values 
(not just zero and EINTR) and reading manpages helps ;P

Attached is a fix that seems to work after a suspend/resume cycle and of course 
on a fresh boot.

Thanks though to Kee's on finding what the actual hiccup was in the first place 
though, it's removed another thing off my todo list.

Cheers

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (900, 'unstable'), (500, 'experimental'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.39-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages inputattach depends on:
ii  libc6                         2.13-7     Embedded GNU C Library: Shared lib

inputattach recommends no packages.

inputattach suggests no packages.

-- no debconf information
--- joystick-1.4.orig/utils/inputattach.c	2011-05-16 22:05:56.000000000 +0100
+++ joystick-1.4/utils/inputattach.c	2011-06-25 10:49:00.000000000 +0100
@@ -607,6 +607,9 @@
 	puts("");
 }
 
+/* palmed wisdom from http://stackoverflow.com/questions/1674162/ */
+#define RETRY_ERROR(x) (x == EAGAIN || x == EWOULDBLOCK || x == EINTR)
+
 int main(int argc, char **argv)
 {
 	unsigned long devt;
@@ -738,7 +741,13 @@
 		retval = EXIT_FAILURE;
 	}
 
-	for (errno = 0; errno != EINTR; read(fd, NULL, 0)) ;
+	do {
+		i = read(fd, NULL, 0);
+		if (i == -1) {
+			if (RETRY_ERROR(errno))
+				continue;
+		}
+	} while (!i);
 
 	ldisc = 0;
 	ioctl(fd, TIOCSETD, &ldisc);

--- End Message ---
--- Begin Message ---
Source: joystick
Source-Version: 1:1.4.1-1

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

inputattach_1.4.1-1_amd64.deb
  to main/j/joystick/inputattach_1.4.1-1_amd64.deb
joystick_1.4.1-1.debian.tar.gz
  to main/j/joystick/joystick_1.4.1-1.debian.tar.gz
joystick_1.4.1-1.dsc
  to main/j/joystick/joystick_1.4.1-1.dsc
joystick_1.4.1-1_amd64.deb
  to main/j/joystick/joystick_1.4.1-1_amd64.deb
joystick_1.4.1.orig.tar.bz2
  to main/j/joystick/joystick_1.4.1.orig.tar.bz2



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 [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Stephen Kitt <[email protected]> (supplier of updated joystick 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 [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Sat, 25 Jun 2011 15:42:13 +0200
Source: joystick
Binary: joystick inputattach
Architecture: source amd64
Version: 1:1.4.1-1
Distribution: unstable
Urgency: low
Maintainer: Stephen Kitt <[email protected]>
Changed-By: Stephen Kitt <[email protected]>
Description: 
 inputattach - utility to connect serial-attached peripherals to the input subsy
 joystick   - set of testing and calibration tools for joysticks
Closes: 631608
Changes: 
 joystick (1:1.4.1-1) unstable; urgency=low
 .
   * New upstream release:
     - Handles other retry errors correctly (thanks to Alexander Clouter
       for the patch). Closes: #631608.
Checksums-Sha1: 
 76c96953991afe3893d01ea244ec5a423a72322b 1741 joystick_1.4.1-1.dsc
 ee7260a47eb4ebb9e8d6ca8f202b865d1f9863db 39362 joystick_1.4.1.orig.tar.bz2
 a6c71075d12906cbbd85198e6fb346631aeaa56b 9835 joystick_1.4.1-1.debian.tar.gz
 b39344956e012d4e3ad842a17911875b4a16c9f7 43242 joystick_1.4.1-1_amd64.deb
 4fdd64560d9eaa5ae5c2cbf1b139dff2312e15f0 21340 inputattach_1.4.1-1_amd64.deb
Checksums-Sha256: 
 cbe96dccc501ce1c3ab0b2d680a57b6ddccbeeb3f1bc54b76c4f97ca9f0531b6 1741 
joystick_1.4.1-1.dsc
 1a324660477594a7a13128eb9a188adadcfaf84f99fe1d26ad0da6235c6bae38 39362 
joystick_1.4.1.orig.tar.bz2
 742ba10ff02f8f997c652da8290d9db74e9630d8cacfa4a69ca86d55ef074ea0 9835 
joystick_1.4.1-1.debian.tar.gz
 7a97760afe5a58c60822694a0efe6a891ccfeed1aba51db6f7b59423e79d8bf6 43242 
joystick_1.4.1-1_amd64.deb
 74a5d7276466cb20e631831f61debb8af779eebbf03e6ebab14954ee9b0c98d4 21340 
inputattach_1.4.1-1_amd64.deb
Files: 
 8aa85a139ea30302ddd9a9071d24ec99 1741 utils extra joystick_1.4.1-1.dsc
 ccf9d1688c5699677a7410c21cc44a66 39362 utils extra joystick_1.4.1.orig.tar.bz2
 56afe976a736b1abcda9682180729467 9835 utils extra 
joystick_1.4.1-1.debian.tar.gz
 50908b2e10ead3f105c803e6b2fb4650 43242 utils extra joystick_1.4.1-1_amd64.deb
 48ee65806c96dae0ea9974d938361577 21340 utils extra 
inputattach_1.4.1-1_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Kees Cook <[email protected]>

iQIcBAEBCgAGBQJOBjhZAAoJEIly9N/cbcAmIFMQALLkrXFBfLh6v6sjE4mKZOrE
lv/2hwn5u/Rjx7ydsrR6IdTh+6xZJHalwIxTrv3cNU3q8dB7ex+llk3aXHt4Li93
AWR3+K++KwASxdAwmawan2nPNB6y94CVlhxou0nfX67iKPsKn1JM+dwTCF/hI0zA
rrtwuKvED6IjUSomNZhC00Jpn7ZiYTbIbzTugMaOm3EhRhdyqvyw/PsyYrSHyfCt
HYcUJ7UBWYOYZ00leiDa4PdTLDDfoWDhGvNA6WgEX/9s9kxPE/y2DskTYQtteahq
WCOp4o148NuqlVqoTlkzjFqEJnREvRX+9Xr+2t4IxXXj4sfkbILOeEMdRdBF3k00
oWwKCYNNKQ7OLOwTfFTSuRen7WaBzl65GjC3qoT08AQH56R8js5bWhgxVNGRc7W7
Hm428DOoR5apz+FElcatMA6WPgL45o3m0QpgwTbrTq8NROJ3SPO59N+wA/FKqcNC
BobIC0Qkiqc2TqDZz9amsVxHPrlYzJDFiREyeXUwAfOjdFjv9VLf5R6q8rK7HmXG
jA//ua5y9qLsQuP6Adn/D/QUQRixkQXyU0umfhZoztkrqaqoPMf7rzk7NJKRPZkd
hQTTtVPy89pa+eoptTBs6CV8Mi1vVgTrruKo3y9JgdP16F50NgpX6MN2gbRVmDbT
yeKSvLi1LeRTJLmrGbyB
=hlHB
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to