[Pkg-utopia-maintainers] Bug#1006368: upowerd: cannot open '/dev/input/event3': Success

Christian Göttsche cgzones at googlemail.com
Fri Feb 25 11:42:06 GMT 2022


Control: severity -1 serious

Bumping the severity since closing the laptop lid does not cause a sleep.

Looking at the opened file descriptors of upower

$ ls -la /proc/1198/fd
total 0
dr-x------. 2 root root  0 Feb 25 12:25 .
dr-xr-xr-x. 9 root root  0 Feb 25 12:25 ..
lrwx------. 1 root root 64 Feb 25 12:27 1 -> 'socket:[4678]'
lr-x------. 1 root root 64 Feb 25 12:27 10 ->
/sys/devices/platform/asus-nb-wmi/leds/asus::kbd_backlight/brightness_hw_changed
lrwx------. 1 root root 64 Feb 25 12:27 11 -> 'socket:[7205]'
lrwx------. 1 root root 64 Feb 25 12:27 2 -> 'socket:[4678]'
lrwx------. 1 root root 64 Feb 25 12:25 3 -> 'anon_inode:[eventfd]'
lrwx------. 1 root root 64 Feb 25 12:25 4 -> 'anon_inode:[eventfd]'
lrwx------. 1 root root 64 Feb 25 12:27 5 -> 'socket:[5540]'
lrwx------. 1 root root 64 Feb 25 12:27 6 -> 'anon_inode:[eventfd]'
l-wx------. 1 root root 64 Feb 25 12:27 7 -> /run/systemd/inhibit/2.ref
lrwx------. 1 root root 64 Feb 25 12:27 8 -> 'socket:[7203]'
lrwx------. 1 root root 64 Feb 25 12:27 9 ->
/sys/devices/platform/asus-nb-wmi/leds/asus::kbd_backlight/brightness

stdin, stdout and stderr are not opened.
Thus the open(2) call at
https://sources.debian.org/src/upower/0.99.16-1/src/linux/up-input.c/?hl=246#L2486

    input->eventfp = open (device_file, O_RDONLY | O_NONBLOCK);
        if (input->eventfp <= 0) {
         g_warning ("cannot open '%s': %s", device_file, strerror (errno));
        ret = FALSE;
         goto out;
     }

Probably returns successfully a new file descriptor with the value 0.
The condition should be "strictly less" instead of "less or equal".

See https://gitlab.freedesktop.org/upower/upower/-/commit/72469426b737f1398651efc360f62a86e3b2633b
for a fix
and https://gitlab.freedesktop.org/upower/upower/-/issues/174 for a
likewise bug report.



More information about the Pkg-utopia-maintainers mailing list