Hi everyone, I''m experiencing a couple of issues running WinXP under Xen 3.0.2 with a dual-core AMD64 with SVM support and wondered if anyone could help me out. I use Ubuntu Linux as my main OS but often need to use Windows for development purposes, so installing WinXP under Xen seemed almost too good to be true - Xen is a great piece of software :) Here are the issues I have found whilst working on a MingW development environment under WinXP running as domU: 1) If I try and start the WinXP dom with vcpus > 1 in my /etc/xen/winxp then the dom fails to start (this was an attempt to see if I could debug multi-threaded code under Xen) 2) If I run a compiled C program that causes a crash (such as referencing a NULL pointer) then Windows brings up its normal crash dialog box offering to send the information to MS. However when I try and continue after the crash, the WinXP dom reboots again. This occurs even when I have attached MingW''s gdb to the process to try and catch the exception - is there a way to catch this so it doesn''t reboot the dom? 3) Normally I terminate WinXP running in my dom by using the Start -> Shutdown option and then closing the hvmloader window when the "It is safe to turn off your computer" notice appears. Unfortunately this still leaves a Zombie dom which shows up under "xm list". Trying "xm destroy" or "xm shutdown" doesn''t remove the zombie dom. The state flags for these zombies are listed as "----cd". 4) If I have started a WinXP dom during my session and shutdown my dom0 PC using "shutdown -h now" then Xen crashes. It appears that all applications have shut down, and the Xen console output appears back on the screen, but instead of completing the shutdown, Xen crashes and emits a stack trace on screen before immediately rebooting my PC. Unfortunately the reboot happens too quickly to write down the offending information, but if someone could talk me through how to capture it then I would be happy to help. If anyone could help me solve these issues, or point me towards any relevant patches/resources then it would be greatly appreciated. Many thanks, Mark. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Petersson, Mats
2006-Oct-05 13:32 UTC
RE: [Xen-users] Issues running WinXP using hvmloader
> -----Original Message----- > From: xen-users-bounces@lists.xensource.com > [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of > Mark Cave-Ayland > Sent: 05 October 2006 14:12 > To: xen-users@lists.xensource.com > Subject: [Xen-users] Issues running WinXP using hvmloader > > Hi everyone, > > I''m experiencing a couple of issues running WinXP under Xen > 3.0.2 with a > dual-core AMD64 with SVM support and wondered if anyone could help me > out. I use Ubuntu Linux as my main OS but often need to use > Windows for > development purposes, so installing WinXP under Xen seemed almost too > good to be true - Xen is a great piece of software :) > > Here are the issues I have found whilst working on a MingW development > environment under WinXP running as domU: > > > 1) If I try and start the WinXP dom with vcpus > 1 in my > /etc/xen/winxp then the dom fails to start (this was an > attempt to see if I could debug multi-threaded code under Xen)This may be to do with old version of Xen - or perhaps you haven''t got APIC and/or ACPI enabled in the config? See below about trying a later release of Xen.> > 2) If I run a compiled C program that causes a crash (such as > referencing a NULL pointer) then Windows brings up its normal > crash dialog box offering to send the information to MS. However > when I try and continue after the crash, the WinXP dom reboots > again. This occurs even when I have attached MingW''s gdb to the > process to try and catch the exception - is there a way to catch > this so it doesn''t reboot the dom?Hmm. So something like: void main(void) { int *p = NULL; p = 47; } Causes WinXP to reboot? It shouldn''t, that''s for sure. Any chance you can try this in 3.0.3-RC2?> > 3) Normally I terminate WinXP running in my dom by using the > Start -> Shutdown option and then closing the hvmloader window > when the "It is safe to turn off your computer" notice appears. > Unfortunately this still leaves a Zombie dom which shows up > under "xm list". Trying "xm destroy" or "xm shutdown" doesn''t > remove the zombie dom. The state flags for these zombies are > listed as "----cd".ACPI disabled or enabled?> > 4) If I have started a WinXP dom during my session and > shutdown my dom0 PC using "shutdown -h now" then Xen crashes. It > appears that all applications have shut down, and the Xen > console output appears back on the screen, but instead of > completing the shutdown, Xen crashes and emits a > stack trace on screen before immediately rebooting my PC. > Unfortunately the reboot happens too quickly to write down > the offending information, but if someone could talk me through > how to capture it then I would be happy to help.If you have the ability to connect a serial port to the Xen-machine, you can capture it in a terminal program on another machine by adding a serial output to the Xen-line in grub.conf: com1=115200,8n1 console=com1 sync_console Alternatively, you can probably write it down by adding "noreboot" to the Xen-line in grub.conf. I hope this is of some help. -- Mats> > > If anyone could help me solve these issues, or point me towards any > relevant patches/resources then it would be greatly appreciated. > > > Many thanks, > > Mark. > > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users > > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Mark Cave-Ayland
2006-Oct-05 14:43 UTC
RE: [Xen-users] Issues running WinXP using hvmloader
Hi Mats, On Thu, 2006-10-05 at 15:32 +0200, Petersson, Mats wrote:> > Here are the issues I have found whilst working on a MingW development > > environment under WinXP running as domU: > > > > > > 1) If I try and start the WinXP dom with vcpus > 1 in my > > /etc/xen/winxp then the dom fails to start (this was an > > attempt to see if I could debug multi-threaded code under Xen) > > This may be to do with old version of Xen - or perhaps you haven''t got > APIC and/or ACPI enabled in the config? > See below about trying a later release of Xen.Ah this could be the problem - at the moment I can''t boot Xen 3.0.2 without using the noapic option (I was also unable to boot the standard Ubuntu kernel without adding noapic either). As suggested by the kernel, I''ve added the apic=debug option to see the response. Unfortunately I don''t have a serial cable to hand, but I do have a digital camera: http://www.ilande.co.uk/xen/apic_debug.jpg.> > > > 2) If I run a compiled C program that causes a crash (such as > > referencing a NULL pointer) then Windows brings up its normal > > crash dialog box offering to send the information to MS. However > > when I try and continue after the crash, the WinXP dom reboots > > again. This occurs even when I have attached MingW''s gdb to the > > process to try and catch the exception - is there a way to catch > > this so it doesn''t reboot the dom? > > Hmm. So something like: > void main(void) > { > int *p = NULL; > p = 47; > } > Causes WinXP to reboot? It shouldn''t, that''s for sure. Any chance you > can try this in 3.0.3-RC2?This one is strange because while I have one program that segfaults immediately, the example above doesn''t cause the dom to crash (in fact it doesn''t even bring up the standard MS crash dialog). However, if I attach MingW''s gdb to the process and run the above example then it does cause the dom to crash and reboot!? Is there a binary download of 3.0.3-RC2 available for x86_64 since I don''t have a Xen build environment setup yet?> > 3) Normally I terminate WinXP running in my dom by using the > > Start -> Shutdown option and then closing the hvmloader window > > when the "It is safe to turn off your computer" notice appears. > > Unfortunately this still leaves a Zombie dom which shows up > > under "xm list". Trying "xm destroy" or "xm shutdown" doesn''t > > remove the zombie dom. The state flags for these zombies are > > listed as "----cd". > > ACPI disabled or enabled?I think this is disabled, since I don''t have any acpi options in my /etc/xen/winxp file. I shall try again with this enabled and see if it makes any difference.> > 4) If I have started a WinXP dom during my session and > > shutdown my dom0 PC using "shutdown -h now" then Xen crashes. It > > appears that all applications have shut down, and the Xen > > console output appears back on the screen, but instead of > > completing the shutdown, Xen crashes and emits a > > stack trace on screen before immediately rebooting my PC. > > Unfortunately the reboot happens too quickly to write down > > the offending information, but if someone could talk me through > > how to capture it then I would be happy to help. > > If you have the ability to connect a serial port to the Xen-machine, you > can capture it in a terminal program on another machine by adding a > serial output to the Xen-line in grub.conf: > com1=115200,8n1 console=com1 sync_console > Alternatively, you can probably write it down by adding "noreboot" to > the Xen-line in grub.conf.Again, I have no serial cable but I managed to grab a snapshot of the crash: http://www.ilande.co.uk/xen/shutdown_crash.jpg.> I hope this is of some help.Absolutely yes! :) Many thanks, Mark. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Mark Cave-Ayland
2006-Oct-05 16:17 UTC
RE: [Xen-users] Issues running WinXP using hvmloader
On Thu, 2006-10-05 at 15:44 +0100, Mark Cave-Ayland wrote:> > This may be to do with old version of Xen - or perhaps you haven''t got > > APIC and/or ACPI enabled in the config? > > See below about trying a later release of Xen. > > Ah this could be the problem - at the moment I can''t boot Xen 3.0.2 > without using the noapic option (I was also unable to boot the standard > Ubuntu kernel without adding noapic either). As suggested by the kernel, > I''ve added the apic=debug option to see the response. Unfortunately I > don''t have a serial cable to hand, but I do have a digital camera: > http://www.ilande.co.uk/xen/apic_debug.jpg.I''ve done a bit more googling and as a result I''ve just updated to the latest experimental (pre-release) BIOS and I can now boot Xen without the noapic option :)> > > 2) If I run a compiled C program that causes a crash (such as > > > referencing a NULL pointer) then Windows brings up its normal > > > crash dialog box offering to send the information to MS. However > > > when I try and continue after the crash, the WinXP dom reboots > > > again. This occurs even when I have attached MingW''s gdb to the > > > process to try and catch the exception - is there a way to catch > > > this so it doesn''t reboot the dom? > > > > Hmm. So something like: > > void main(void) > > { > > int *p = NULL; > > p = 47; > > } > > Causes WinXP to reboot? It shouldn''t, that''s for sure. Any chance you > > can try this in 3.0.3-RC2?Even with the APIC being detected, attaching gdb to the above program in MingW still reboots the WinXP dom. I haven''t managed to locate any 3.0.3-RC2 binaries yet...> > > 3) Normally I terminate WinXP running in my dom by using the > > > Start -> Shutdown option and then closing the hvmloader window > > > when the "It is safe to turn off your computer" notice appears. > > > Unfortunately this still leaves a Zombie dom which shows up > > > under "xm list". Trying "xm destroy" or "xm shutdown" doesn''t > > > remove the zombie dom. The state flags for these zombies are > > > listed as "----cd". > > > > ACPI disabled or enabled? > > I think this is disabled, since I don''t have any acpi options in > my /etc/xen/winxp file. I shall try again with this enabled and see if > it makes any difference.I''ve now added the options "acpi = 1" and "apic = 1" to my /etc/xen/winxp file but I still get a zombie dom when I shutdown my WinXP dom. Any other ideas?> > > 4) If I have started a WinXP dom during my session and > > > shutdown my dom0 PC using "shutdown -h now" then Xen crashes. It > > > appears that all applications have shut down, and the Xen > > > console output appears back on the screen, but instead of > > > completing the shutdown, Xen crashes and emits a > > > stack trace on screen before immediately rebooting my PC. > > > Unfortunately the reboot happens too quickly to write down > > > the offending information, but if someone could talk me through > > > how to capture it then I would be happy to help.(cut)> Again, I have no serial cable but I managed to grab a snapshot of the > crash: http://www.ilande.co.uk/xen/shutdown_crash.jpg.Just to confirm that this still occurs when I attempt to shutdown dom0 with Xen now detecting the APIC correctly. Kind regards, Mark. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Mark Cave-Ayland
2006-Oct-06 09:38 UTC
RE: [Xen-users] Issues running WinXP using hvmloader
Hi Mats, Thanks for your help so far with this. I took the plunge yesterday of using Mercurial to download the latest xen-3.0.3-testing.hg repository from http://xenbits.xensource.com/ and it looks as if things have definitely improved: - WinXP doms now shutdown cleanly without leaving zombies - My PC no longer crashes when I do a "shutdown -h now" I still can''t start up a WinXP dom with "vcpus = 2" in the configuration file at the moment; rather than crashing the dom like 3.0.2 did, 3.0.3-testing switches back to 1 CPU before loading. Trying to alter the vcpus using "xm vcpu-set" doesn''t change the vcpu value either. The only other issue is that I still can''t debug a program using MingW''s gdb under a WinXP running in a Xen dom, which I think may be related to something in the WinXP debug API, or the way that Xen handles segfaults. Here is the test program that I am using under MingW/msys: #include <stdlib.h> int main() { char buffer[2]; printf("Hello World!"); strcpy(buffer, "This is a very long string designed to do bad things"); } If I run this under a Xen WinXP dom then WinXP crashes as expected, throwing up the normal MS crash dialog. Normally closing the crash dialog results in termination of the program that produced it. Under Xen I find I have to manually terminate the crashed program by using Task Manager or invoking Ctrl-C from the console that launched it! The other issue is that gdb still can''t attach to a program to debug it; attempting to attach gdb to any process results in a SIGTRAP in part of the debugging API and it is impossible to get past this point. The function where the SIGTRAP occurs is always the same, "ntdll! DbgUiConnectToDbg", no matter which process you try and attach to. This makes me think that something in this function is raising an exception which is being incorrectly handled. $ gdb -p 500 GNU gdb 6.3 Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i686-pc-mingw32". Attaching to process 500 error reading the process''s file name: 5 [Switching to thread 500.0x2e4] (gdb) bt #0 0x7c901230 in ntdll!DbgUiConnectToDbg () from C:\WINDOWS\system32 \ntdll.dll #1 0x7c9507a8 in ntdll!KiIntSystemCall () from C:\WINDOWS\system32 \ntdll.dll #2 0x00000005 in ?? () #3 0x00000004 in ?? () #4 0x00000001 in ?? () ...etc... Any other thoughts? Kind regards, Mark. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Petersson, Mats
2006-Oct-06 09:53 UTC
RE: [Xen-users] Issues running WinXP using hvmloader
> -----Original Message----- > From: xen-users-bounces@lists.xensource.com > [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of > Mark Cave-Ayland > Sent: 06 October 2006 10:38 > To: Petersson, Mats > Cc: xen-users@lists.xensource.com > Subject: RE: [Xen-users] Issues running WinXP using hvmloader > > Hi Mats, > > Thanks for your help so far with this. I took the plunge yesterday of > using Mercurial to download the latest xen-3.0.3-testing.hg repository > from http://xenbits.xensource.com/ and it looks as if things have > definitely improved: > > - WinXP doms now shutdown cleanly without leaving zombies > - My PC no longer crashes when I do a "shutdown -h now" > > I still can''t start up a WinXP dom with "vcpus = 2" in the > configuration > file at the moment; rather than crashing the dom like 3.0.2 did, > 3.0.3-testing switches back to 1 CPU before loading. Trying > to alter the > vcpus using "xm vcpu-set" doesn''t change the vcpu value either. > > The only other issue is that I still can''t debug a program > using MingW''s > gdb under a WinXP running in a Xen dom, which I think may be > related to > something in the WinXP debug API, or the way that Xen handles > segfaults. > Here is the test program that I am using under MingW/msys: > > > #include <stdlib.h> > > int main() > { > char buffer[2]; > > printf("Hello World!"); > > strcpy(buffer, "This is a very long string designed to do bad > things"); > } > > > If I run this under a Xen WinXP dom then WinXP crashes as expected, > throwing up the normal MS crash dialog. Normally closing the crash > dialog results in termination of the program that produced > it. Under Xen > I find I have to manually terminate the crashed program by using Task > Manager or invoking Ctrl-C from the console that launched it!No clue why this would happen...> > The other issue is that gdb still can''t attach to a program > to debug it; > attempting to attach gdb to any process results in a SIGTRAP > in part of > the debugging API and it is impossible to get past this point. The > function where the SIGTRAP occurs is always the same, "ntdll! > DbgUiConnectToDbg", no matter which process you try and > attach to. This > makes me think that something in this function is raising an exception > which is being incorrectly handled. > > > $ gdb -p 500 > GNU gdb 6.3 > Copyright 2004 Free Software Foundation, Inc. > GDB is free software, covered by the GNU General Public > License, and you > are > welcome to change it and/or distribute copies of it under certain > conditions. > Type "show copying" to see the conditions. > There is absolutely no warranty for GDB. Type "show warranty" for > details. > This GDB was configured as "i686-pc-mingw32". > Attaching to process 500 > error reading the process''s file name: 5 > [Switching to thread 500.0x2e4] > (gdb) bt > #0 0x7c901230 in ntdll!DbgUiConnectToDbg () from C:\WINDOWS\system32 > \ntdll.dll > #1 0x7c9507a8 in ntdll!KiIntSystemCall () from C:\WINDOWS\system32 > \ntdll.dll > #2 0x00000005 in ?? () > #3 0x00000004 in ?? () > #4 0x00000001 in ?? () > > ...etc... > > > Any other thoughts?Not really - it looks like a problem with reading the other process''s memory - why that should happen, I don''t really know. Sorry to not be of much help here... -- Mats> > > Kind regards, > > Mark. > > > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users > > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users