WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH]Fix HVM domain cannot save if domid > 99

To: keir.fraser@xxxxxxxxxx
Subject: [Xen-devel] [PATCH]Fix HVM domain cannot save if domid > 99
From: Zhigang Wang <zhigang.x.wang@xxxxxxxxxx>
Date: Fri, 06 Jun 2008 15:37:26 +0800
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 06 Jun 2008 00:38:39 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.14 (X11/20080421)
hi keir,

I don't whether will pull back patches in xen-unstable to xen-3.1-testing,
but it is a big bug: HVM domain cannot save if domid > 99.

This bug due to the code in tools/ioemu/target-i386-dm/helper2.c:

int main_loop(void)
{
    ...
    char qemu_file[20];
    ...
    sprintf(qemu_file, "/tmp/xen.qemu-dm.%d", domid);
    ...
}

sprintf will overflow when domid > 99.

pull back xen-unstable changeset 15242 and 16866 fixes it.

thanks,

zhigang


log:

==============================================================================

xend.log:

[2008-06-05 12:41:58 2514] DEBUG (XendCheckpoint:90) [xc_save]:
/usr/lib/xen/bin/xc_save 26 101 0 0 4
[2008-06-05 12:41:58 2514] DEBUG (XendCheckpoint:349) suspend
[2008-06-05 12:41:58 2514] DEBUG (XendCheckpoint:93) In saveInputHandler
suspend
[2008-06-05 12:41:58 2514] DEBUG (XendCheckpoint:95) Suspending 101 ...
[2008-06-05 12:41:58 2514] DEBUG (XendDomainInfo:451)
XendDomainInfo.shutdown(suspend)
[2008-06-05 12:41:58 2514] DEBUG (XendDomainInfo:996)
XendDomainInfo.handleShutdownWatch
[2008-06-05 12:41:58 2514] DEBUG (XendDomainInfo:996)
XendDomainInfo.handleShutdownWatch
[2008-06-05 12:41:58 2514] INFO (XendCheckpoint:101) Domain 101 suspended.
[2008-06-05 12:41:58 2514] INFO (XendCheckpoint:106) release_devices for hvm
domain
[2008-06-05 12:41:58 2514] INFO (XendDomainInfo:1186) Domain has shutdown:
name=migrating-win2k3_annie id=101 reason=suspend.
[2008-06-05 12:41:58 2514] INFO (image:466) use sigusr1 to signal qemu 6820
[2008-06-05 12:41:59 2514] DEBUG (XendCheckpoint:110) Written done
[2008-06-05 12:42:06 2514] INFO (XendCheckpoint:378) Saving memory pages: iter
1   0%^H^H^H^H  5%^H^H^H^H 10%^H^H^H^H 15%^H^H^H^H 20%^H^H^H^H 25%^H^H^H^H
30%^H^H^H^H 35%^H^H^H^H 40%^H^H^H^H 45%^H^H^H^H 50%^H^H^H^H 55%^H^H^H^H
60%^H^H^H^H 65%^H^H^H^H 70%^H^H^H^H 75%^H^H^H^H 80%^H^H^H^H 85%^H^H^H^H
90%^H^H^H^H 95%^M 1: sent 983008, skipped 0, delta 6657ms, dom0 59%, target 0%,
sent 4838Mb/s, dirtied 0Mb/s 0 pages
[2008-06-05 12:42:06 2514] INFO (XendCheckpoint:378) Total pages sent= 983008
(0.94x)
[2008-06-05 12:42:06 2514] INFO (XendCheckpoint:378) (of which 0 were fixups)
[2008-06-05 12:42:06 2514] INFO (XendCheckpoint:378) All memory is saved
[2008-06-05 12:42:07 2514] INFO (XendCheckpoint:378) Save exit rc=0
[2008-06-05 12:42:07 2514] ERROR (XendCheckpoint:143) Save failed on domain
win2k3_annie (101).
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/xen/xend/XendCheckpoint.py", line 117,
in save
    qemu_fd = os.open("/tmp/xen.qemu-dm.%d" % dominfo.getDomid(), os.O_RDONLY)
OSError: [Errno 2] No such file or directory: '/tmp/xen.qemu-dm.101'


==============================================================================

xend-debug.log:

Thu Jun  5 12:41:59 2008
 main:        End of stream
*** buffer overflow detected ***: /usr/lib/xen/bin/qemu-dm terminated
======= Backtrace: =========
/lib/i686/nosegneg/libc.so.6(__chk_fail+0x41)[0x351ac1]
/lib/i686/nosegneg/libc.so.6[0x3512d8]
/lib/i686/nosegneg/libc.so.6(_IO_default_xsputn+0xb4)[0x2d12b4]
/lib/i686/nosegneg/libc.so.6(_IO_vfprintf+0xf8c)[0x2aa86c]
/lib/i686/nosegneg/libc.so.6(__vsprintf_chk+0xad)[0x35138d]
/lib/i686/nosegneg/libc.so.6(__sprintf_chk+0x30)[0x3512c0] 
/usr/lib/xen/bin/qemu-dm[0x80c111a]
[0x656c6c61]
======= Memory map: ========
00110000-0011b000 r-xp 00000000 08:06 485119
/lib/libgcc_s-4.1.1-20070105.so.1
0011b000-0011c000 rw-p 0000a000 08:06 485119
/lib/libgcc_s-4.1.1-20070105.so.1
00251000-0026a000 r-xp 00000000 08:06 485104     /lib/ld-2.5.so
0026a000-0026b000 r--p 00018000 08:06 485104     /lib/ld-2.5.so
0026b000-0026c000 rw-p 00019000 08:06 485104     /lib/ld-2.5.so
0026e000-003a8000 r-xp 00000000 08:06 485105
/lib/i686/nosegneg/libc-2.5.so
003a8000-003aa000 r--p 0013a000 08:06 485105
/lib/i686/nosegneg/libc-2.5.so
003aa000-003ab000 rw-p 0013c000 08:06 485105
/lib/i686/nosegneg/libc-2.5.so
003ab000-003ae000 rw-p 003ab000 00:00 0
003b0000-003d5000 r-xp 00000000 08:06 485108
/lib/i686/nosegneg/libm-2.5.so
003d5000-003d6000 r--p 00024000 08:06 485108
/lib/i686/nosegneg/libm-2.5.so
003d6000-003d7000 rw-p 00025000 08:06 485108
/lib/i686/nosegneg/libm-2.5.so
003d9000-003ec000 r-xp 00000000 08:06 485109
/lib/i686/nosegneg/libpthread-2.5.so
003ec000-003ed000 r--p 00012000 08:06 485109
/lib/i686/nosegneg/libpthread-2.5.so
003ed000-003ee000 rw-p 00013000 08:06 485109
/lib/i686/nosegneg/libpthread-2.5.so
003ee000-003f0000 rw-p 003ee000 00:00 0 
003f2000-003f9000 r-xp 00000000 08:06 485115
/lib/i686/nosegneg/librt-2.5.so
003f9000-003fa000 r--p 00006000 08:06 485115
/lib/i686/nosegneg/librt-2.5.so
003fa000-003fb000 rw-p 00007000 08:06 485115
/lib/i686/nosegneg/librt-2.5.so
003fd000-003ff000 r-xp 00000000 08:06 483069     /lib/libutil-2.5.so
003ff000-00400000 r--p 00001000 08:06 483069     /lib/libutil-2.5.so
00400000-00401000 rw-p 00002000 08:06 483069     /lib/libutil-2.5.so
00406000-00408000 r-xp 00000000 08:06 485106     /lib/libdl-2.5.so
00408000-00409000 r--p 00001000 08:06 485106     /lib/libdl-2.5.so
00409000-0040a000 rw-p 00002000 08:06 485106     /lib/libdl-2.5.so
0040c000-00415000 r-xp 00000000 08:06 649748     /usr/lib/libesd.so.0.2.36
00415000-00416000 rw-p 00009000 08:06 649748     /usr/lib/libesd.so.0.2.36
00424000-00428000 r-xp 00000000 08:06 649184     /usr/lib/libxenstore.so.3.0.0
00428000-00429000 rw-p 00003000 08:06 649184     /usr/lib/libxenstore.so.3.0.0
00429000-0042c000 rw-p 00429000 00:00 0
0042e000-00440000 r-xp 00000000 08:06 655601     /usr/lib/libxenctrl.so.3.0.0
00440000-00441000 rw-p 00012000 08:06 655601     /usr/lib/libxenctrl.so.3.0.0
00441000-00457000 rw-p 00441000 00:00 0
0046d000-0047f000 r-xp 00000000 08:06 649162     /usr/lib/libz.so.1.2.3
0047f000-00480000 rw-p 00011000 08:06 649162     /usr/lib/libz.so.1.2.3
00482000-00558000 r-xp 00000000 08:06 485120     /lib/libasound.so.2.0.0
00558000-0055d000 rw-p 000d5000 08:06 485120     /lib/libasound.so.2.0.0
0055f000-00587000 r-xp 00000000 08:06 653260
/usr/lib/libaudiofile.so.0.0.2
00587000-0058a000 rw-p 00027000 08:06 653260
/usr/lib/libaudiofile.so.0.0.2
0058c000-005a6000 r-xp 00000000 08:06 649799     /usr/lib/libxenguest.so.3.0.0
005a6000-005a7000 rw-p 0001a000 08:06 649799     /usr/lib/libxenguest.so.3.0.0
005a9000-00625000 r-xp 00000000 08:06 652618     /usr/lib/libSDL-1.2.so.0.7.3
00625000-00627000 rw-p 0007c000 08:06 652618     /usr/lib/libSDL-1.2.so.0.7.3
00627000-00652000 rw-p 00627000 00:00 0
009d2000-009d3000 r-xp 009d2000 00:00 0          [vdso]
08047000-080e2000 r-xp 00000000 08:06 807541     /usr/lib/xen/bin/qemu-dm
080e2000-080e7000 rw-p 0009b000 08:06 807541     /usr/lib/xen/bin/qemu-dm
080e7000-082ad000 rw-p 080e7000 00:00 0
0a0d2000-0a13b000 rw-p 0a0d2000 00:00 0
b51a7000-b59a7000 rw-s 00000000 00:03 4026533330  /proc/xen/privcmd
b59a8000-b59a9000 ---p b59a8000 00:00 0
b59a9000-b63a9000 rw-p b59a9000 00:00 0
b6a90000-b6b1d000 rw-p b74a7000 00:00 0
b6baa000-b7439000 rw-p b6baa000 00:00 0
b75a2000-b75d2000 rw-s 00000000 00:08 132139     /dev/zero (deleted)
b75d2000-b75d3000 ---p b75d2000 00:00 0
b75d3000-b7fd8000 rw-p b75d3000 00:00 0
b7fd8000-b7fd9000 rw-s 00000000 00:03 4026533330  /proc/xen/privcmd
b7fd9000-b7fda000 rw-s 00000000 00:03 4026533330  /proc/xen/privcmd
b7fda000-b7fdc000 rw-p b7fda000 00:00 0
bf920000-bf935000 rw-p bf920000 00:00 0          [stack]

==============================================================================

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH]Fix HVM domain cannot save if domid > 99, Zhigang Wang <=