New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
colord-sane segfaults on boot/restart via systemd #165
Comments
I have the same issue, and observe the same backtrace. I debugged this, and it seems the issue is in hplip The crash started appearing for me after I installed The crash happens on my laptop when booted up without any scanner or printer attached. Restarting the colord service immediately triggers the crash. I figure this crash is probably reproducible on other systems as well by just having hplip and colord-sane installed, no HP scanner required. This patch fixes the immediate crash for me: --- src/hplip-3.23.12/io/hpmud/musb.c 2023-11-27 16:06:40.000000000 +0100
+++ src/hplip-3.23.12/io/hpmud/musb2.c 2024-01-30 00:22:19.025763255 +0100
@@ -2055,7 +2055,7 @@
char serial[128], mfg[128], sz[HPMUD_LINE_SIZE];
int r, size=0;
- libusb_init(&ctx);
+ if (libusb_init(&ctx) != 0) return 0;
numdevs = libusb_get_device_list(ctx, &list);
if (numdevs <= 0) There are more unchecked calls to libusb functions like this, and the same unchecked call to I'm pretty sure this is not an upstream colord issue, it's an hplip issue. |
I bisected this, and the issue in hplip is much older, but the crash was uncovered by colord commit d735245. Specifically, |
I'd be fine dropping |
Removing that line definitely avoids the crash, though I can't say if it's enough to make HP USB scanners work properly with colord, since I don't have any such devices to test with. I will open a PR for removing that line. |
colord-sane scanner drivers using libusb can't initialize properly with RestrictAddressFamilies set to AF_UNIX. Remove that line to ensure those can work properly. This also avoids a crash in HPLIP due to unchecked calls to libusb_init(). Fixes hughsie#165
colord-sane scanner drivers using libusb can't initialize properly with RestrictAddressFamilies set to AF_UNIX. Remove that line to ensure those can work properly. This also avoids a crash in HPLIP due to unchecked calls to libusb_init(). Fixes #165
colord-sane scanner drivers using libusb can't initialize properly with RestrictAddressFamilies set to AF_UNIX. Remove that line to ensure those can work properly. This also avoids a crash in HPLIP due to unchecked calls to libusb_init(). Fixes hughsie#165
Starting (on boot/restarting via systemd) colord v1.4.7 on Arch (kernel 6.7.1, systemd 255) causes colord-sane (1.4.7) to segfault.
coredumpctl stacktrace
full backtrace
Issue not present in v 1.4.6.
The text was updated successfully, but these errors were encountered: