On Mon, 30 Jul 2018 09:17:27 +0000
"Ucan, Emre (ADITG/ESB)" <eu...@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 <eu...@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.paala...@collabora.co.uk>

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


Thanks,
pq

Attachment: pgp5JAuCJQqif.pgp
Description: OpenPGP digital signature

_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to