[PATCH weston v5 10/14] compositor: protocol logger

Pekka Paalanen ppaalanen at gmail.com
Mon Aug 6 13:03:09 UTC 2018


On Mon, 30 Jul 2018 09:17:27 +0000
"Ucan, Emre (ADITG/ESB)" <eucan at de.adit-jv.com> wrote:

> Hi Daniel,
> 
> We found an issue with this patch. I am adding a patch to this email to fix this issue. Please check:
> 
> Subject: [PATCH] main: copy va_list for second use
> 
> we are using va_list once for debug protocol and
> once for local logging to stdout. After first use
> the list is invalidated. Therefore, we have to copy
> it for the second use.
> 
> Signed-off-by: Emre Ucan <eucan at de.adit-jv.com>
> ---
>  compositor/main.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/compositor/main.c b/compositor/main.c
> index 3333147..7975af0 100644
> --- a/compositor/main.c
> +++ b/compositor/main.c
> @@ -193,6 +193,9 @@ vlog(const char *fmt, va_list ap)
>  {
>  	int l;
>  	char timestr[128];
> +	va_list ap2;
> +
> +	va_copy(ap2, ap);
>  
>  	if (weston_debug_scope_is_enabled(log_scope)) {
>  		weston_debug_scope_printf(log_scope, "%s ",
> @@ -202,7 +205,8 @@ vlog(const char *fmt, va_list ap)
>  	}
>  
>  	l = weston_log_timestamp();
> -	l += vfprintf(weston_logfile, fmt, ap);
> +	l += vfprintf(weston_logfile, fmt, ap2);
> +	va_end(ap2);
>  
>  	return l;
>  }

Hi Emre,

nice, I wonder if this was the thing causing those crashes that IIRC
Maniraj was seeing and worked around them by having
weston_debug_scope_timestamp() return void.

Reading the manual, you are correct and this is needed.

Squashing this into the appropriate commit (patch 6) retains:
Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>

custom_handler() and vlog_continue() seem to need the same fix.


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20180806/f454817b/attachment.sig>


More information about the wayland-devel mailing list