[systemd-devel] Clarification around a segmentation fault from an udevd worker
SF Markus Elfring
elfring at users.sourceforge.net
Wed Jul 29 04:40:36 PDT 2015
> This is *very* strange. The 'format' parameter should not contain that
> "%s:%s:%d" prefix at all, as this cannot work of course because the
> argument list doesn't match.
I guess that I wonder also about one of my own programming mistakes here.
> Which version of systemd are you based on?
last commit: 6ad6d61f9ddd58983b075e4fbece30bae46fac37
> Do you have *any* local modifications in your tree?
Yes. - It seems that I was bitten by a format string mismatch during
an attempt to display a few more implementation details for my needs.
diff --git a/src/libsystemd/sd-device/device-private.c b/src/libsystemd/sd-device/device-private.c
index 2e60433..b5a31ec 100644
--- a/src/libsystemd/sd-device/device-private.c
+++ b/src/libsystemd/sd-device/device-private.c
@@ -1076,7 +1076,7 @@ int device_update_db(sd_device *device) {
goto fail;
}
- log_debug("created %s file '%s' for '%s'", has_info ? "db" : "empty",
+ log_debug("%s:%s:%d: created %s file '%s' for '%s'", has_info ? "db" : "empty", __FUNCTION__, __FILE__, __LINE__,
path, device->devpath);
return 0;
Should my compiler "gcc 5.2.0" be able to detect and warn about misplaced
parameters in such an use case?
Regards,
Markus
More information about the systemd-devel
mailing list