[systemd-devel] Assertion 'udev_device' failed at src/libudev/libudev-device.c:742, function udev_device_get_sysattr_value(). Aborting.

Sietse van Zanen sietse at wizdom.nu
Tue Nov 5 08:53:20 UTC 2024


Turned out to be a bug in zed:
Verify parent_dev before calling udev_device_get_sysattr_value by Uglymotha · Pull Request #16717 · openzfs/zfs<https://github.com/openzfs/zfs/pull/16717>

-Sietse

Van: Cristian Rodríguez <crrodriguez at opensuse.org>
Verzonden: Saturday, 2 November 2024 20:07
Aan: Sietse van Zanen <sietse at wizdom.nu>
CC: systemd-devel at lists.freedesktop.org
Onderwerp: Re: [systemd-devel] Assertion 'udev_device' failed at src/libudev/libudev-device.c:742, function udev_device_get_sysattr_value(). Aborting.



On Sat, Nov 2, 2024 at 5:38 AM Sietse van Zanen <sietse at wizdom.nu<mailto:sietse at wizdom.nu>> wrote:
I seem to be hitting some very weird corner case causing an assertion failure. The offender is ZFS Event Daemon:

The following code shows the offence:
                               struct udev_device *dev;
                               if ((dev = udev_monitor_receive_device(mon)) == NULL) {
                                               zed_log_msg(LOG_WARNING, "zed_udev_monitor: receive "
                                                   "device error %d", errno);
                                               continue;
                               }
                               …..
                               sectors = udev_device_get_property_value(dev,
                                                    "ID_PART_ENTRY_SIZE");
                               if (sectors == NULL)
                                               sectors = udev_device_get_sysattr_value(dev, "size");

Im at a loss here as to what’s causing the assertion failure. Both udev_device_get_property_value and udev_device_get_sysattr_value only assert a valid udev_device pointer. How can the pointer get lost between these two function calls?

-Sietse


 you need to poll before any valid udev_device is returned to you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20241105/6b3c8394/attachment.htm>


More information about the systemd-devel mailing list