From patchwork Wed Oct 6 20:26:20 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jvrao X-Patchwork-Id: 66965 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 77D47B70E4 for ; Thu, 7 Oct 2010 07:27:12 +1100 (EST) Received: from localhost ([127.0.0.1]:34492 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P3aZw-0003cN-2d for incoming@patchwork.ozlabs.org; Wed, 06 Oct 2010 16:27:08 -0400 Received: from [140.186.70.92] (port=36332 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P3aZJ-0003cH-Do for qemu-devel@nongnu.org; Wed, 06 Oct 2010 16:26:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P3aZI-0005FL-3T for qemu-devel@nongnu.org; Wed, 06 Oct 2010 16:26:29 -0400 Received: from e9.ny.us.ibm.com ([32.97.182.139]:41363) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P3aZI-0005F2-0p for qemu-devel@nongnu.org; Wed, 06 Oct 2010 16:26:28 -0400 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e9.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id o96K6YVX006476 for ; Wed, 6 Oct 2010 16:06:34 -0400 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o96KQOGx435308 for ; Wed, 6 Oct 2010 16:26:24 -0400 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o96KQMNV028825 for ; Wed, 6 Oct 2010 14:26:23 -0600 Received: from [127.0.0.1] (IBM-2AECC81F76A.beaverton.ibm.com [9.47.22.70]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id o96KQKK1028661; Wed, 6 Oct 2010 14:26:21 -0600 Message-ID: <4CACDB6C.1040402@linux.vnet.ibm.com> Date: Wed, 06 Oct 2010 13:26:20 -0700 From: "Venkateswararao Jujjuri (JV)" Organization: IBM User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: Gerd Hoffmann Subject: Re: [Qemu-devel] virtio-9p.c:401: v9fs_string_sprintf: Assertion `!(err == -1)' failed. References: <4CAC7037.80301@redhat.com> <4CACB8BB.2040708@linux.vnet.ibm.com> In-Reply-To: <4CACB8BB.2040708@linux.vnet.ibm.com> X-Enigmail-Version: 1.1.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: "qemu-devel@nongnu.org" X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On 10/6/2010 10:58 AM, Venkateswararao Jujjuri (JV) wrote: > On 10/6/2010 5:48 AM, Gerd Hoffmann wrote: >> Hi, >> >> $subject says all ... >> >> Triggered by mounting the filesystem. F14 guest. >> > > Ah. This is introduced by c9ba47dc5d8679efa4d5425aa27e0f8132920fb5 > v9fs_string_sprintf() doesn't support %lu. I will send a patch to fix this shortly. Here is the patch to fix it. sgined-off-by: Venkateswararao Jujjuri (JV) > > - JV > >> (gdb) #0 0x000000399f4329c5 in raise () from /lib64/libc.so.6 >> #1 0x000000399f4341a5 in abort () from /lib64/libc.so.6 >> #2 0x000000399f42b955 in __assert_fail () from /lib64/libc.so.6 >> #3 0x00000000004209a4 in v9fs_string_sprintf (str=0x1bc9560, fmt=0x5d31e4 "%s >> %lu") >> at /home/kraxel/projects/qemu/hw/virtio-9p.c:401 >> #4 0x0000000000423bcb in stat_to_v9stat (s=0x7f524d3ef010, name=0x1baf658, >> stbuf=0x1bc9588, >> v9stat=0x1bc94f0) at /home/kraxel/projects/qemu/hw/virtio-9p.c:1039 >> #5 0x0000000000423d27 in v9fs_stat_post_lstat (s=0x7f524d3ef010, pdu=> optimized out>) >> at /home/kraxel/projects/qemu/hw/virtio-9p.c:1229 >> #6 v9fs_stat (s=0x7f524d3ef010, pdu=) >> at /home/kraxel/projects/qemu/hw/virtio-9p.c:1263 >> #7 0x000000000041f8a8 in submit_pdu (vdev=0x7f524d3ef010, vq=0x1aed390) >> at /home/kraxel/projects/qemu/hw/virtio-9p.c:3452 >> #8 handle_9p_output (vdev=0x7f524d3ef010, vq=0x1aed390) >> at /home/kraxel/projects/qemu/hw/virtio-9p.c:3474 >> #9 0x0000000000428e66 in kvm_handle_io (env=0x1665800) at >> /home/kraxel/projects/qemu/kvm-all.c:741 >> #10 kvm_cpu_exec (env=0x1665800) at /home/kraxel/projects/qemu/kvm-all.c:882 >> #11 0x00000000004d596f in cpu_x86_exec (env1=) >> at /home/kraxel/projects/qemu/cpu-exec.c:338 >> #12 0x000000000040b468 in qemu_cpu_exec () at /home/kraxel/projects/qemu/cpus.c:767 >> #13 cpu_exec_all () at /home/kraxel/projects/qemu/cpus.c:795 >> #14 0x0000000000561d35 in main_loop (argc=, argv=> optimized out>, >> envp=) at /home/kraxel/projects/qemu/vl.c:1331 >> #15 main (argc=, argv=, envp=> optimized out>) >> at /home/kraxel/projects/qemu/vl.c:3036 >> >> >> cheers, >> Gerd >> > > > diff --git a/hw/virtio-9p.c b/hw/virtio-9p.c index 3b2d49c..1afa6d1 100644 --- a/hw/virtio-9p.c +++ b/hw/virtio-9p.c @@ -325,6 +325,14 @@ static int number_to_string(void *arg, char type) } while (num); break; } + case 'U': { + unsigned long num = *(unsigned long *)arg; + do { + ret++; + num = num/10; + } while (num); + break; + } default: printf("Number_to_string: Unknown number format\n"); return -1; @@ -342,6 +350,7 @@ v9fs_string_alloc_printf(char **strp, const char *fmt, va_li int nr_args = 0; char *arg_char_ptr; unsigned int arg_uint; + unsigned long arg_ulong; /* Find the number of %'s that denotes an argument */ for (iter = strstr(iter, "%"); iter; iter = strstr(iter, "%")) { @@ -367,6 +376,14 @@ v9fs_string_alloc_printf(char **strp, const char *fmt, va_l arg_uint = va_arg(ap2, unsigned int); len += number_to_string((void *)&arg_uint, 'u'); break; + case 'l': + if (*++iter == 'u') { + arg_ulong = va_arg(ap2, unsigned long); + len += number_to_string((void *)&arg_ulong, 'U'); + } else { + return -1; + } + break; case 's': arg_char_ptr = va_arg(ap2, char *); len += strlen(arg_char_ptr);