All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] Native MinGW build crashes when partitioning hard disk in guest
@ 2014-02-01 10:47 Legorol
  2014-02-01 11:51 ` Stefan Weil
  0 siblings, 1 reply; 3+ messages in thread
From: Legorol @ 2014-02-01 10:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: sw

(I am reposting this as my first post seems to have fallen through the 
cracks.)

I am building the official Qemu 1.7.0 release from source natively under 
MinGW for myself. I execute the i386 target. Qemu starts fine, but it 
crashes when I try to partition a 2G hard disk under an MS-DOS 6.22 guest. 
Details of the build and reproducing the crash are below.

The problem also occurs for me with the 1.6.2 release. The problem does not 
occur with these binaries from other people:
Eric Lassauge's Qemu-1.6.0-windows.zip
Prashant Satish's qemu-1.6.0-win32-sdl.tar.lzma
Stefan Weil's qemu-w32-setup-20131128, qemu-w32-setup-20140118.exe

The problem does not occur when I add the --enable-debug flag to configure! 
Whatever optimisation is removed as a result seems to avoid the crash.

How can I troubleshoot what the problem is? What should I change about my 
build to solve the problem?

Host: Windows 7 64-bit

Build environment: (32-bit)
MinGW fresh install including:
mingw32-gettext  bin  0.18.3.1-1
mingw32-gettext  dev  0.18.3.1-1
mingw32-gettext  dll  0.18.3.1-1
mingw32-libintl  dll  0.18.3.1-1
mingw32-libz  dev  1.2.8-1
mingw32-libz  dll  1.2.8-1
MSYS shell fresh install
Glib libraries and dependencies:
glib_2.34.3-1_win32
glib-dev_2.34.3-1_win32
pkg-config_0.28-1_win32
pkg-config-dev_0.28-1_win32
SDL-devel-1.2.15-mingw32

Qemu 1.7.0 source is in /mingw/build/qemu-1.7.0

Build process: (out-of-tree build)
using MSYS shell, in /mingw/build/qemu-1.7.0-obj directory:
../qemu-1.7.0/configure --python=C:/Python27/python --prefix=/mingw/build/qemu-1.7.0-bin 
 --target-list="i386-softmmu" --disable-coroutine-pool
make
make install

To reproduce crash:
have a 1.44 floppy image of MS-DOS 6.22 boot disk
place the disk image with name dos.img in /mingw/build/qemu-test directory
using MSYS shell, in /mingw/build/qemu-test directory:
../qemu-1.7.0-bin/qemu-img create -f qcow2 test.img 2G
../qemu-1.7.0-bin/qemu-system-i386 -fda dos.img -hda test.img -boot a
once DOS boots up, type fdisk and try to create a single partition using all 
available space
Qemu crashes


Regards,
Legorol

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] Native MinGW build crashes when partitioning hard disk in guest
  2014-02-01 10:47 [Qemu-devel] Native MinGW build crashes when partitioning hard disk in guest Legorol
@ 2014-02-01 11:51 ` Stefan Weil
  2014-02-01 16:50   ` Legorol
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Weil @ 2014-02-01 11:51 UTC (permalink / raw)
  To: Legorol, qemu-devel

Am 01.02.2014 11:47, schrieb Legorol:
> (I am reposting this as my first post seems to have fallen through the
> cracks.)
> 
> I am building the official Qemu 1.7.0 release from source natively under
> MinGW for myself. I execute the i386 target. Qemu starts fine, but it
> crashes when I try to partition a 2G hard disk under an MS-DOS 6.22
> guest. Details of the build and reproducing the crash are below.
> 
> The problem also occurs for me with the 1.6.2 release. The problem does
> not occur with these binaries from other people:
> Eric Lassauge's Qemu-1.6.0-windows.zip
> Prashant Satish's qemu-1.6.0-win32-sdl.tar.lzma
> Stefan Weil's qemu-w32-setup-20131128, qemu-w32-setup-20140118.exe
> 
> The problem does not occur when I add the --enable-debug flag to
> configure! Whatever optimisation is removed as a result seems to avoid
> the crash.
> 
> How can I troubleshoot what the problem is? What should I change about
> my build to solve the problem?
> 

Hi,

I assume that this is caused by a known problem with coroutines (which
are used by QEMU's block operations) for Windows. Any file operation can
cause that crash. See this discussion for details:

http://lists.nongnu.org/archive/html/qemu-devel/2013-09/msg04197.html

The problem is caused by buggy code produced by the MinGW compilers when
optimisation is enabled. There exist several workarounds which fix the
problem:

* disable optimisation for coroutine-win32.c (that's what --enable-debug
does)

* disable the coroutine pool

* modify the code of function qemu_coroutine_switch in coroutine-win32.c
  (that's what I use for my binaries)

Try this patch:

http://repo.or.cz/w/qemu/ar7.git/commitdiff/c777d5d62a729fd8b19847aaa0aad3d7a1f73f47

Regards
Stefan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] Native MinGW build crashes when partitioning hard disk in guest
  2014-02-01 11:51 ` Stefan Weil
@ 2014-02-01 16:50   ` Legorol
  0 siblings, 0 replies; 3+ messages in thread
From: Legorol @ 2014-02-01 16:50 UTC (permalink / raw)
  To: Stefan Weil; +Cc: qemu-devel

On 1 February 2014 12:51, Stefan Weil <sw@weilnetz.de> wrote:
> Am 01.02.2014 11:47, schrieb Legorol:
>> (I am reposting this as my first post seems to have fallen through the
>> cracks.)
>>
>> I am building the official Qemu 1.7.0 release from source natively under
>> MinGW for myself. I execute the i386 target. Qemu starts fine, but it
>> crashes when I try to partition a 2G hard disk under an MS-DOS 6.22
>> guest. Details of the build and reproducing the crash are below.
>>
>> The problem also occurs for me with the 1.6.2 release. The problem does
>> not occur with these binaries from other people:
>> Eric Lassauge's Qemu-1.6.0-windows.zip
>> Prashant Satish's qemu-1.6.0-win32-sdl.tar.lzma
>> Stefan Weil's qemu-w32-setup-20131128, qemu-w32-setup-20140118.exe
>>
>> The problem does not occur when I add the --enable-debug flag to
>> configure! Whatever optimisation is removed as a result seems to avoid
>> the crash.
>>
>> How can I troubleshoot what the problem is? What should I change about
>> my build to solve the problem?
>>
>
> Hi,
>
> I assume that this is caused by a known problem with coroutines (which
> are used by QEMU's block operations) for Windows. Any file operation can
> cause that crash. See this discussion for details:
>
> http://lists.nongnu.org/archive/html/qemu-devel/2013-09/msg04197.html

Thanks for the pointer. I have actually already seen that discussion
and read every related post in that thread.

>
> The problem is caused by buggy code produced by the MinGW compilers when
> optimisation is enabled. There exist several workarounds which fix the
> problem:
>
> * disable optimisation for coroutine-win32.c (that's what --enable-debug
> does)
>
> * disable the coroutine pool

As per the discussion you linked, I've already been compiling with
the --disable-coroutine-pool flag, as indicated in my description.

>
> * modify the code of function qemu_coroutine_switch in coroutine-win32.c
>   (that's what I use for my binaries)
>
> Try this patch:
>
> http://repo.or.cz/w/qemu/ar7.git/commitdiff/c777d5d62a729fd8b19847aaa0aad3d7a1f73f47
>
> Regards
> Stefan
>

I tried the patch (in addition to disabling the coroutine pool), and
it worked! I no longer get the crash.

There is something still amiss though, if you say that disabling the
coroutine pool OR applying the patch should do the trick. Just
disabling the coroutine pool wasn't enough for me.

Thanks,
Legorol

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-01 16:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-01 10:47 [Qemu-devel] Native MinGW build crashes when partitioning hard disk in guest Legorol
2014-02-01 11:51 ` Stefan Weil
2014-02-01 16:50   ` Legorol

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.