Re: [patch] zfs livelock and thread priorities

From: Artem Belevich <fbsdlist_at_src.cx>
Date: Fri, 24 Apr 2009 20:59:19 -0700
Ah! Indeed.

> va_list va;
> va_start(ap, fmt);
> va_copy(va, ap);
> vsnprintf(p2->p_comm, sizeof(p2->p_comm), fmt, va);
> vsnprintf(td->td_name, sizeof(td->td_name), fmt, ap);

We also need va_end(va) to clear up after va_copy();

I'll give it a try.

Thanks,
--Artem



On Fri, Apr 24, 2009 at 7:47 PM, Ryan Stone <rysto32_at_gmail.com> wrote:
> The crash happens because vsnprintf is called twice on the same va_list.
> That's not legal.  It happens to work on i386, but it will crash on amd64.
> The patch should instead do:
>
> va_list va;
> va_start(ap, fmt);
> va_copy(va, ap);
> vsnprintf(p2->p_comm, sizeof(p2->p_comm), fmt, va);
> vsnprintf(td->td_name, sizeof(td->td_name), fmt, ap);
>
> Ryan Stone
>
>
Received on Sat Apr 25 2009 - 01:59:20 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:46 UTC