[systemd-devel] Clarification around a segmentation fault from an udevd worker

Reverend Homer mk.43.ecko at gmail.com
Wed Jul 29 05:28:01 PDT 2015



29.07.2015 14:40, SF Markus Elfring пишет:
>> 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__,
I think that you mean

+        log_debug("%s:%s:%d: created %s file '%s' for '%s'", __FUNCTION__, __FILE__, __LINE__,
has_info ? "db" : "empty",

>                     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
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel

-- 
Regards,
R.H.



More information about the systemd-devel mailing list