Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Apr 2009 22:47:06 -0400
From:      Ryan Stone <rysto32@gmail.com>
To:        Artem Belevich <fbsdlist@src.cx>
Cc:        freebsd-current@freebsd.org, Ben Kelly <ben@wanderview.com>
Subject:   Re: [patch] zfs livelock and thread priorities
Message-ID:  <bc2d970904241947r50576efbgc93164a9e4dd297d@mail.gmail.com>
In-Reply-To: <ed91d4a80904241816r28531a04r2dc70fa8960d430e@mail.gmail.com>
References:  <DC9F2088-A0AF-467D-8574-F24A045ABD81@wanderview.com> <49C2CFF6.8070608@egr.msu.edu> <BDABA909-C2AE-4A55-869B-CA01BE778A82@wanderview.com> <ed91d4a80904131636u18c90474w7cdaa57bc7000e02@mail.gmail.com> <08D7DC2A-68BE-47B6-8D5D-5DE6B48F87E5@wanderview.com> <AC3C4C3F-40C6-4AF9-BAF3-2C4D1E444839@wanderview.com> <ed91d4a80904142135n429dea52o672abf51116fa707@mail.gmail.com> <ed91d4a80904241816r28531a04r2dc70fa8960d430e@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bc2d970904241947r50576efbgc93164a9e4dd297d>