libcamera-org/libcamera

missing error check in udevNotify()

Closed this issue · 6 comments

struct udev_device *dev = udev_monitor_receive_device(monitor_);

udev_monitor_receive_device() may return NULL on error, and applications using libcamera may trigger assertion.

See https://jenkins-systemd.apps.ocp.cloud.ci.centos.org/job/upstream-vagrant-archlinux/16312/artifact/systemd-centos-ci/artifacts_yia07dbo/vagrant-logs.6bn/vagrant-arch-testsuite.on8/coredumpctl_collect_boot_FAIL.log

This does seem legitimate.

Moving the issue to libcamera's bug tracker at https://bugs.libcamera.org/show_bug.cgi?id=230. I'll close this, as this repository is not officially monitored by the libcamera maintainers.

patch submitted to the libcamera devel mailing list
https://patchwork.libcamera.org/patch/20807/

@kbingham Thank you!

Merged to libcamera at 62760bd - so it will be included in the next release. It would be good to hear what errno this prints if you catch it happening.

@kbingham
The patch looks good to me. Thank you for the quick fix!

Our CIs monitor coredump (typically during early boot), but do not monitor any error messages. So, unfortunately, the error message cannot be detected.

If we see similar or another coredump with the next release. I will report.

Thanks for the feedback. I was weary it would be difficult to get the information, but I'm fairly confident given the original report that at least the fault should be fixed, but it would be good to determine what the cause was. Still I think that's outside of the control of libcamera.