All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Venkateswararao Jujjuri (JV)" <jvrao@linux.vnet.ibm.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] virtio-9p.c:401: v9fs_string_sprintf: Assertion `!(err == -1)' failed.
Date: Wed, 06 Oct 2010 13:26:20 -0700	[thread overview]
Message-ID: <4CACDB6C.1040402@linux.vnet.ibm.com> (raw)
In-Reply-To: <4CACB8BB.2040708@linux.vnet.ibm.com>

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) <jvrao@linux.vnet.ibm.com>


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);


> 
> - 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=<value
>> optimized out>)
>>     at /home/kraxel/projects/qemu/hw/virtio-9p.c:1229
>> #6  v9fs_stat (s=0x7f524d3ef010, pdu=<value optimized out>)
>>     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=<value optimized out>)
>>     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=<value optimized out>, argv=<value
>> optimized out>,
>>     envp=<value optimized out>) at /home/kraxel/projects/qemu/vl.c:1331
>> #15 main (argc=<value optimized out>, argv=<value optimized out>, envp=<value
>> optimized out>)
>>     at /home/kraxel/projects/qemu/vl.c:3036
>>
>>
>> cheers,
>>   Gerd
>>
> 
> 
> 

      reply	other threads:[~2010-10-06 20:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-06 12:48 [Qemu-devel] virtio-9p.c:401: v9fs_string_sprintf: Assertion `!(err == -1)' failed Gerd Hoffmann
2010-10-06 14:42 ` Stefan Hajnoczi
2010-10-06 18:25   ` Venkateswararao Jujjuri (JV)
2010-10-06 17:58 ` Venkateswararao Jujjuri (JV)
2010-10-06 20:26   ` Venkateswararao Jujjuri (JV) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CACDB6C.1040402@linux.vnet.ibm.com \
    --to=jvrao@linux.vnet.ibm.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.