[patch] zfs livelock and thread priorities
Ben Kelly
ben at wanderview.com
Sat Apr 25 17:49:40 UTC 2009
On Apr 24, 2009, at 11:59 PM, Artem Belevich wrote:
> 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've updated the patch to use va_copy(). Unfortunately I don't have
an AMD64 machine to test on at the moment. However, I did look at
other places in the kernel where va_copy() is used so I am hopeful I
got it right.
Thanks again for the help!
- Ben
>
> 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
>>
>>
More information about the freebsd-current
mailing list