From owner-freebsd-current@FreeBSD.ORG Sat Apr 25 03:59:20 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA9E8106566B for ; Sat, 25 Apr 2009 03:59:20 +0000 (UTC) (envelope-from artemb@gmail.com) Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.28]) by mx1.freebsd.org (Postfix) with ESMTP id 8DAA68FC1C for ; Sat, 25 Apr 2009 03:59:20 +0000 (UTC) (envelope-from artemb@gmail.com) Received: by yx-out-2324.google.com with SMTP id 8so916570yxb.13 for ; Fri, 24 Apr 2009 20:59:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=3uvp8xCEVM0awiNV4mGtXYYKz5D/MfCL50/TW+kg+nI=; b=AWNUHGWIFOQuuvowgNsvz++OEti0lK7hJuPbmBagku+/XFci4jFCb1awrefa3liOOv 2mxsyg/wI/UUWvUBOrtVDd9SK/F6z4uvtiOOFl3yAvNP4r+6/FW8XVcAoxGUo2KF+MSO P6nOrwcHk9Kd8Av9E2uPGeedBb415YfpA4k/8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=sv+jDbJZoYBw9InTCdVdVMFoRJu5HVHnRa8vvFKN3/BA+qlhdwlEe/+8f4nldeOVto 4q4GDw8SUroYCn5VGEozKNooI9dxu2yn7yhQokjfTPvfe5YYKZKNvEnTK9/I/ZnD1Q90 qmiyX21yn+I5S/qmQ3j8JPm0umKAjynlxvZwU= MIME-Version: 1.0 Sender: artemb@gmail.com Received: by 10.90.117.17 with SMTP id p17mr793197agc.62.1240631959876; Fri, 24 Apr 2009 20:59:19 -0700 (PDT) In-Reply-To: References: <49C2CFF6.8070608@egr.msu.edu> <08D7DC2A-68BE-47B6-8D5D-5DE6B48F87E5@wanderview.com> Date: Fri, 24 Apr 2009 20:59:19 -0700 X-Google-Sender-Auth: 1037ce8e16844542 Message-ID: From: Artem Belevich To: Ryan Stone Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org, Ben Kelly Subject: Re: [patch] zfs livelock and thread priorities X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Apr 2009 03:59:21 -0000 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 wrote: > The crash happens because vsnprintf is called twice on the same va_list. > That's not legal.=A0 It happens to work on i386, but it will crash on amd= 64. > 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 > >