[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#933230: marked as done (acpid: Race during startup can result in event devices not being opened)



Your message dated Mon, 19 Aug 2019 05:19:58 +0000
with message-id <E1hza5G-00086w-A1@fasolo.debian.org>
and subject line Bug#933230: fixed in acpid 1:2.0.32-1
has caused the Debian Bug report #933230,
regarding acpid: Race during startup can result in event devices not being opened
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 owner@bugs.debian.org
immediately.)


-- 
933230: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=933230
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: acpid
Version: 1:2.0.31-2

When using netlink and the input layer, acpid opens the existing devices
in /dev/input/event* first and only after sets an inotify to be told
about newly created devices. If an event device is created between the
time acpid reads the directory and the time it sets the inotify, it
won't open that device and events provided by that device will be lost.

On my system, this race happens frequently for /dev/input/event8 "Video
Bus" during boot, preventing acpid from handling my system's brightness
keys.

The attached patch changes the ordering, setting the inotify before
opening the existing devices. It also adds a check to prevent
double-opening of a device if it is created between the inotify and the
reading of the directory.
diff -urN acpid-2.0.31-old/acpid.c acpid-2.0.31/acpid.c
--- acpid-2.0.31-old/acpid.c	2018-03-29 11:05:57.252312727 -0400
+++ acpid-2.0.31/acpid.c	2019-07-27 15:48:34.468992622 -0400
@@ -99,12 +99,12 @@
 	}
 
 	if (netlink) {
-		/* open the input layer */
-		open_input();
-
 		/* watch for new input layer devices */
 		open_inotify();
 
+		/* open the input layer */
+		open_input();
+
 		/* open netlink */
 		open_netlink();
 	}
diff -urN acpid-2.0.31-old/input_layer.c acpid-2.0.31/input_layer.c
--- acpid-2.0.31-old/input_layer.c	2018-08-01 10:11:59.934141098 -0400
+++ acpid-2.0.31/input_layer.c	2019-07-27 15:50:55.725832853 -0400
@@ -490,6 +490,12 @@
 	for (i = 0; i < globbuf.gl_pathc; ++i) {
 		filename = globbuf.gl_pathv[i];
 
+		/* skip if already opened */
+		if (find_connection_name(filename) != NULL) {
+			success = 1;
+			continue;
+		}
+
 		/* open this input layer device file */
 		if (open_inputfile(filename) == 0)
 			success = 1;

--- End Message ---
--- Begin Message ---
Source: acpid
Source-Version: 1:2.0.32-1

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

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 933230@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Josue Ortega <josue@debian.org> (supplier of updated acpid 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@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Sun, 18 Aug 2019 18:42:00 -0600
Source: acpid
Architecture: source
Version: 1:2.0.32-1
Distribution: unstable
Urgency: medium
Maintainer: Josue Ortega <josue@debian.org>
Changed-By: Josue Ortega <josue@debian.org>
Closes: 928253 932785 933230
Changes:
 acpid (1:2.0.32-1) unstable; urgency=medium
 .
   * New upstream release (2.0.32). (Closes: #933230)
   * New maintainer (Closes: #932785)
   * Update package to use debhelper-compat (= 12)
   * Update debian/copyright to machine readable format (DEP-5)
   * debian/watch:
      - Update file to version 4
      - Update upstream URL
   * debian/control: Add ${misc:Pre-Depends}
   * debian/acpid.service: Add Documentation key
   * Remove acpid.postinst, it was intended for supporting ancient
     package version
   * acpid.preinst: Remove support for ancient package vresion (1.0.8-7)
   * Bump Standards-Version to 4.4.0. No changes required
   * Enable acpid.socket and acpi.path on installation. Thanks to Balint
     Reczey <rbalint@ubuntu.com>. Closes: #928253
Checksums-Sha1:
 0ff3a638545946ab2b98b4748b5c947b32cfd762 1938 acpid_2.0.32-1.dsc
 a194e99c5b596186c7865e7ddfec55dea6d7fc73 155768 acpid_2.0.32.orig.tar.xz
 9ef93cb89241d467f573b4b09a11461b13873a87 19000 acpid_2.0.32-1.debian.tar.xz
 f1298344e07714e0ec806318d3086504d80ef9cd 6507 acpid_2.0.32-1_amd64.buildinfo
Checksums-Sha256:
 8230421bb56d7c9ba290567b510712a81e4254be623410d7b63cf35385007107 1938 acpid_2.0.32-1.dsc
 f2d2d30b3edc3234bd82f6f7186699a6aa3c85c8d20bc4e30e9b3c68a1ed157e 155768 acpid_2.0.32.orig.tar.xz
 f1f011dad698f3067f2ffc1756d6728ab864f0f506a1a462fa529eeaf5dadb0e 19000 acpid_2.0.32-1.debian.tar.xz
 d01c57656328b381b331570c18fff6ea507c6a2ea23503b1bd7f4f5e70a138e4 6507 acpid_2.0.32-1_amd64.buildinfo
Files:
 bc4085e5756b2b60bf400ee452e6f285 1938 admin optional acpid_2.0.32-1.dsc
 248995264b9d1cd8bdb923d5b190fd44 155768 admin optional acpid_2.0.32.orig.tar.xz
 7b85f1122e2c4e190b5025c9aa1508f8 19000 admin optional acpid_2.0.32-1.debian.tar.xz
 0cd8b73422e476e62c6e34ea93a9cb24 6507 admin optional acpid_2.0.32-1_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQJFBAEBCAAvFiEEdzOzKNJ5X1viMlrdAVCdXKtK/T8FAl1Z8rIRHGpvc3VlQGRl
Ymlhbi5vcmcACgkQAVCdXKtK/T/PHRAAiWZm/FYCiVX7IQttUBfWIT0bohbm4vRa
z87wirIHfgxRuLqlvYYoFBw3AQJ6qjFcmCl2kBjozZmuJipH81GXUuJEYWuXpFdM
bpc9oQpGg4q+kfNRjMdLWN9e2Hy/nKNLWDgV3PNKI5jnUxBenChyi+S5InFsmn9S
6PR7YZ6rYuHbeeldLg2x2DuMQaikEG88Rwgos815Xh/H7p2ZN4CWQCqSOiybWegQ
2y6l8wQEJpxtO/MxFzDH8CCprFpuEUZgO7trzSfu4yxWGyZ5LEq2BxPg9KVW6BMp
bFcmsrf0MytrXGIee1hKvNPAzGfP1UqQK11z9ANNzwI7PJeoBcILuFnyRAsPLxWc
p7JnMCYOOj/jP+YWN9WSubng3SYO4ns23gmm4tHI5ivTX6XtovvLtWYC+zlDmekd
sihALOeegxiMBmsa4W1oyL7j8RLrmIk70pKh7LA4D3pac2wu3kO8w0ZnX5ulT/p7
5u0HARYJ7HtYgLFrycshKKA4IoDi6U262eCQGVFPc8qHA0oe4sNTLTIwh2gBoWk3
KZDiwVwzrccU6cK4ImJc1aeQm04u8s5JJMQfuBXZpCeLdXKmyJvzqTGmlS0D9pL9
O32IJnV0PWSQLoXnBIFoFAhygtpYqUMBIYtc6rJYmwyNrr2/xPWpJtEiNvv78G6+
wKV8Pl9xo5Q=
=7DiE
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: