udevDeviceMonitorStartup registers udevEventHandleCallback as event
handle, but doesn't store the returned watch id to remove it later on.
Also it's not clear to me whether the event handle should be register
for the whole lifetime of the udev driver instance or just for the
udevEnumerateDevices call.
If for example the call to udevSetupSystemDev [1] fails
udevDeviceMonitorShutdown is called to cleanup, but
udevEventHandleCallback is still registered and may be called when
driverState is NULL again, resulting in a segfault in
udevEventHandleCallback.
So to solve this the udevEventHandleCallback event handle must be
removed at the appropriate place.
Maximilian Wilhelm found this problem.
[1] 22:42:20.960: error : udevSetupSystemDev:1460 : Failed to get udev
device for syspath '/sys/devices/virtual/dmi/id' or
'/sys/class/dmi/id'
Matthias