qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Bug 1924912] [NEW] VirtIO drivers don't work on Windows: "GLib: Too many handles to wait for!" crash
@ 2021-04-18 13:16 kleines Filmröllchen
  2021-04-18 13:35 ` [Bug 1924912] " Stefan Weil
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: kleines Filmröllchen @ 2021-04-18 13:16 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

I ran SerenityOS <https://github.com/SerenityOS/serenity> out of WSL2
with native Windows QEMU. The system runs fine on the Linux QEMU (with
Windows X-Server). However, with Windows QEMU I get a hard crash after
the following output:

```
[#0 colonel(0:0)]: Scheduler[0]: idle loop running
[init_stage2(2:2)]: PCI [0000:00:00:00] PCI::ID [8086:1237]
[init_stage2(2:2)]: PCI [0000:00:01:00] PCI::ID [8086:7000]
[init_stage2(2:2)]: PCI [0000:00:01:01] PCI::ID [8086:7010]
[init_stage2(2:2)]: PCI [0000:00:01:02] PCI::ID [8086:7020]
[init_stage2(2:2)]: PCI [0000:00:01:03] PCI::ID [8086:7113]
[init_stage2(2:2)]: PCI [0000:00:02:00] PCI::ID [1234:1111]
[init_stage2(2:2)]: PCI [0000:00:03:00] PCI::ID [8086:2922]
[init_stage2(2:2)]: PCI [0000:00:04:00] PCI::ID [1af4:1003]
[init_stage2(2:2)]: PCI [0000:00:05:00] PCI::ID [1af4:1005]
[init_stage2(2:2)]: PCI [0000:00:06:00] PCI::ID [8086:100e]
[#0 init_stage2(2:2)]: BXVGA: framebuffer @ P0xf8000000
[#0 init_stage2(2:2)]: BXVGADevice resolution set to 1024x768 (pitch=4096)
[init_stage2(2:2)]: UHCI: Controller found PCI::ID [8086:7020] @ PCI [0000:00:01:02]
[init_stage2(2:2)]: UHCI: I/O base IO c080
[init_stage2(2:2)]: UHCI: Interrupt line: 11
[#0 init_stage2(2:2)]: UHCI: Allocated framelist at physical address P0x00e40000
[#0 init_stage2(2:2)]: UHCI: Framelist is at virtual address V0xc115d000
[#0 init_stage2(2:2)]: UHCI: QH(0xc115f000) @ 14946304: link_ptr=14946338, element_link_ptr=1
[#0 init_stage2(2:2)]: UHCI: QH(0xc115f020) @ 14946336: link_ptr=14946370, element_link_ptr=1
[#0 init_stage2(2:2)]: UHCI: QH(0xc115f040) @ 14946368: link_ptr=14946402, element_link_ptr=1
[#0 init_stage2(2:2)]: UHCI: QH(0xc115f060) @ 14946400: link_ptr=14946434, element_link_ptr=1
[#0 init_stage2(2:2)]: UHCI: QH(0xc115f080) @ 14946432: link_ptr=14958593, element_link_ptr=1
[#0 init_stage2(2:2)]: UHCI: Reset completed
[#0 init_stage2(2:2)]: UHCI: Started
[#0 init_stage2(2:2)]: DMIExpose: SMBIOS 32bit Entry point @ P0x000f5870
[#0 init_stage2(2:2)]: DMIExpose: Data table @ P0x000f5890
[#0 init_stage2(2:2)]: VirtIOConsole: Found @ PCI [0000:00:04:00]
[#0 init_stage2(2:2)]: Trying to unregister unused handler (?)
[#0 init_stage2(2:2)]: VirtIOConsole: Multi port is not yet supported!
[#0 init_stage2(2:2)]: VirtIOConsole: cols: 0, rows: 0, max nr ports 0
qemu-system-i386.exe: warning: GLib: Too many handles to wait for!
```

The lines starting with [ are SerenityOS output; QEMU warns "GLib: Too
many handles to wait for!" and crashes right after (can't even Ctrl-C in
the WSL command line, force-close in Windows necessary). A window is
still spawned but as the OS already switched out of text mode, just a
black screen is visible as QEMU crashes.

I first thought this to be an issue with SerenityOS and reported it over
there: <https://github.com/SerenityOS/serenity/issues/6422>. The kernel
devs pointed out that this seems to be a VirtIO driver/device issue on
the Windows build of QEMU, because the Serenity kernel tries to
initialize VirtIO devices which apparently crashes QEMU. There will be
mitigations from the SerenityOS side (by allowing to disable VirtIO on
boot) but it would of course be great if QEMU handled this properly.

Version info: Both QEMU 6.0.0-rc3 and 5.2.0 exhibit this issue. Windows
release is 20H2, WSL2 is running Debian 10.9. SerenityOS has no proper
version but it was reproduced on the most current commits as of
18/04/2021.

** Affects: qemu
     Importance: Undecided
         Status: New


** Tags: windows

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1924912

Title:
  VirtIO drivers don't work on Windows: "GLib: Too many handles to wait
  for!" crash

Status in QEMU:
  New

Bug description:
  I ran SerenityOS <https://github.com/SerenityOS/serenity> out of WSL2
  with native Windows QEMU. The system runs fine on the Linux QEMU (with
  Windows X-Server). However, with Windows QEMU I get a hard crash after
  the following output:

  ```
  [#0 colonel(0:0)]: Scheduler[0]: idle loop running
  [init_stage2(2:2)]: PCI [0000:00:00:00] PCI::ID [8086:1237]
  [init_stage2(2:2)]: PCI [0000:00:01:00] PCI::ID [8086:7000]
  [init_stage2(2:2)]: PCI [0000:00:01:01] PCI::ID [8086:7010]
  [init_stage2(2:2)]: PCI [0000:00:01:02] PCI::ID [8086:7020]
  [init_stage2(2:2)]: PCI [0000:00:01:03] PCI::ID [8086:7113]
  [init_stage2(2:2)]: PCI [0000:00:02:00] PCI::ID [1234:1111]
  [init_stage2(2:2)]: PCI [0000:00:03:00] PCI::ID [8086:2922]
  [init_stage2(2:2)]: PCI [0000:00:04:00] PCI::ID [1af4:1003]
  [init_stage2(2:2)]: PCI [0000:00:05:00] PCI::ID [1af4:1005]
  [init_stage2(2:2)]: PCI [0000:00:06:00] PCI::ID [8086:100e]
  [#0 init_stage2(2:2)]: BXVGA: framebuffer @ P0xf8000000
  [#0 init_stage2(2:2)]: BXVGADevice resolution set to 1024x768 (pitch=4096)
  [init_stage2(2:2)]: UHCI: Controller found PCI::ID [8086:7020] @ PCI [0000:00:01:02]
  [init_stage2(2:2)]: UHCI: I/O base IO c080
  [init_stage2(2:2)]: UHCI: Interrupt line: 11
  [#0 init_stage2(2:2)]: UHCI: Allocated framelist at physical address P0x00e40000
  [#0 init_stage2(2:2)]: UHCI: Framelist is at virtual address V0xc115d000
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f000) @ 14946304: link_ptr=14946338, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f020) @ 14946336: link_ptr=14946370, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f040) @ 14946368: link_ptr=14946402, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f060) @ 14946400: link_ptr=14946434, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f080) @ 14946432: link_ptr=14958593, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: Reset completed
  [#0 init_stage2(2:2)]: UHCI: Started
  [#0 init_stage2(2:2)]: DMIExpose: SMBIOS 32bit Entry point @ P0x000f5870
  [#0 init_stage2(2:2)]: DMIExpose: Data table @ P0x000f5890
  [#0 init_stage2(2:2)]: VirtIOConsole: Found @ PCI [0000:00:04:00]
  [#0 init_stage2(2:2)]: Trying to unregister unused handler (?)
  [#0 init_stage2(2:2)]: VirtIOConsole: Multi port is not yet supported!
  [#0 init_stage2(2:2)]: VirtIOConsole: cols: 0, rows: 0, max nr ports 0
  qemu-system-i386.exe: warning: GLib: Too many handles to wait for!
  ```

  The lines starting with [ are SerenityOS output; QEMU warns "GLib: Too
  many handles to wait for!" and crashes right after (can't even Ctrl-C
  in the WSL command line, force-close in Windows necessary). A window
  is still spawned but as the OS already switched out of text mode, just
  a black screen is visible as QEMU crashes.

  I first thought this to be an issue with SerenityOS and reported it
  over there: <https://github.com/SerenityOS/serenity/issues/6422>. The
  kernel devs pointed out that this seems to be a VirtIO driver/device
  issue on the Windows build of QEMU, because the Serenity kernel tries
  to initialize VirtIO devices which apparently crashes QEMU. There will
  be mitigations from the SerenityOS side (by allowing to disable VirtIO
  on boot) but it would of course be great if QEMU handled this
  properly.

  Version info: Both QEMU 6.0.0-rc3 and 5.2.0 exhibit this issue.
  Windows release is 20H2, WSL2 is running Debian 10.9. SerenityOS has
  no proper version but it was reproduced on the most current commits as
  of 18/04/2021.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1924912/+subscriptions


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

* [Bug 1924912] Re: VirtIO drivers don't work on Windows: "GLib: Too many handles to wait for!" crash
  2021-04-18 13:16 [Bug 1924912] [NEW] VirtIO drivers don't work on Windows: "GLib: Too many handles to wait for!" crash kleines Filmröllchen
@ 2021-04-18 13:35 ` Stefan Weil
  2021-04-18 14:34 ` kleines Filmröllchen
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 14+ messages in thread
From: Stefan Weil @ 2021-04-18 13:35 UTC (permalink / raw)
  To: qemu-devel

Did you build your own Windows binary based on the official sources? Or
did you use a precompiled binary? If yes, which one?

Please describe the exact steps to reproduce the issue.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1924912

Title:
  VirtIO drivers don't work on Windows: "GLib: Too many handles to wait
  for!" crash

Status in QEMU:
  New

Bug description:
  I ran SerenityOS <https://github.com/SerenityOS/serenity> out of WSL2
  with native Windows QEMU. The system runs fine on the Linux QEMU (with
  Windows X-Server). However, with Windows QEMU I get a hard crash after
  the following output:

  ```
  [#0 colonel(0:0)]: Scheduler[0]: idle loop running
  [init_stage2(2:2)]: PCI [0000:00:00:00] PCI::ID [8086:1237]
  [init_stage2(2:2)]: PCI [0000:00:01:00] PCI::ID [8086:7000]
  [init_stage2(2:2)]: PCI [0000:00:01:01] PCI::ID [8086:7010]
  [init_stage2(2:2)]: PCI [0000:00:01:02] PCI::ID [8086:7020]
  [init_stage2(2:2)]: PCI [0000:00:01:03] PCI::ID [8086:7113]
  [init_stage2(2:2)]: PCI [0000:00:02:00] PCI::ID [1234:1111]
  [init_stage2(2:2)]: PCI [0000:00:03:00] PCI::ID [8086:2922]
  [init_stage2(2:2)]: PCI [0000:00:04:00] PCI::ID [1af4:1003]
  [init_stage2(2:2)]: PCI [0000:00:05:00] PCI::ID [1af4:1005]
  [init_stage2(2:2)]: PCI [0000:00:06:00] PCI::ID [8086:100e]
  [#0 init_stage2(2:2)]: BXVGA: framebuffer @ P0xf8000000
  [#0 init_stage2(2:2)]: BXVGADevice resolution set to 1024x768 (pitch=4096)
  [init_stage2(2:2)]: UHCI: Controller found PCI::ID [8086:7020] @ PCI [0000:00:01:02]
  [init_stage2(2:2)]: UHCI: I/O base IO c080
  [init_stage2(2:2)]: UHCI: Interrupt line: 11
  [#0 init_stage2(2:2)]: UHCI: Allocated framelist at physical address P0x00e40000
  [#0 init_stage2(2:2)]: UHCI: Framelist is at virtual address V0xc115d000
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f000) @ 14946304: link_ptr=14946338, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f020) @ 14946336: link_ptr=14946370, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f040) @ 14946368: link_ptr=14946402, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f060) @ 14946400: link_ptr=14946434, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f080) @ 14946432: link_ptr=14958593, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: Reset completed
  [#0 init_stage2(2:2)]: UHCI: Started
  [#0 init_stage2(2:2)]: DMIExpose: SMBIOS 32bit Entry point @ P0x000f5870
  [#0 init_stage2(2:2)]: DMIExpose: Data table @ P0x000f5890
  [#0 init_stage2(2:2)]: VirtIOConsole: Found @ PCI [0000:00:04:00]
  [#0 init_stage2(2:2)]: Trying to unregister unused handler (?)
  [#0 init_stage2(2:2)]: VirtIOConsole: Multi port is not yet supported!
  [#0 init_stage2(2:2)]: VirtIOConsole: cols: 0, rows: 0, max nr ports 0
  qemu-system-i386.exe: warning: GLib: Too many handles to wait for!
  ```

  The lines starting with [ are SerenityOS output; QEMU warns "GLib: Too
  many handles to wait for!" and crashes right after (can't even Ctrl-C
  in the WSL command line, force-close in Windows necessary). A window
  is still spawned but as the OS already switched out of text mode, just
  a black screen is visible as QEMU crashes.

  I first thought this to be an issue with SerenityOS and reported it
  over there: <https://github.com/SerenityOS/serenity/issues/6422>. The
  kernel devs pointed out that this seems to be a VirtIO driver/device
  issue on the Windows build of QEMU, because the Serenity kernel tries
  to initialize VirtIO devices which apparently crashes QEMU. There will
  be mitigations from the SerenityOS side (by allowing to disable VirtIO
  on boot) but it would of course be great if QEMU handled this
  properly.

  Version info: Both QEMU 6.0.0-rc3 and 5.2.0 exhibit this issue.
  Windows release is 20H2, WSL2 is running Debian 10.9. SerenityOS has
  no proper version but it was reproduced on the most current commits as
  of 18/04/2021.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1924912/+subscriptions


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

* [Bug 1924912] Re: VirtIO drivers don't work on Windows: "GLib: Too many handles to wait for!" crash
  2021-04-18 13:16 [Bug 1924912] [NEW] VirtIO drivers don't work on Windows: "GLib: Too many handles to wait for!" crash kleines Filmröllchen
  2021-04-18 13:35 ` [Bug 1924912] " Stefan Weil
@ 2021-04-18 14:34 ` kleines Filmröllchen
  2021-04-19 10:39   ` [Bug 1924912] " Stefan Weil
  2021-04-19 14:30 ` [Bug 1924912] " Laurent Vivier
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 14+ messages in thread
From: kleines Filmröllchen @ 2021-04-18 14:34 UTC (permalink / raw)
  To: qemu-devel

I used the pre-built binaries with the versions described above. I did
not change any install options so this can be reproduced after using the
official install binaries for each version.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1924912

Title:
  VirtIO drivers don't work on Windows: "GLib: Too many handles to wait
  for!" crash

Status in QEMU:
  New

Bug description:
  I ran SerenityOS <https://github.com/SerenityOS/serenity> out of WSL2
  with native Windows QEMU. The system runs fine on the Linux QEMU (with
  Windows X-Server). However, with Windows QEMU I get a hard crash after
  the following output:

  ```
  [#0 colonel(0:0)]: Scheduler[0]: idle loop running
  [init_stage2(2:2)]: PCI [0000:00:00:00] PCI::ID [8086:1237]
  [init_stage2(2:2)]: PCI [0000:00:01:00] PCI::ID [8086:7000]
  [init_stage2(2:2)]: PCI [0000:00:01:01] PCI::ID [8086:7010]
  [init_stage2(2:2)]: PCI [0000:00:01:02] PCI::ID [8086:7020]
  [init_stage2(2:2)]: PCI [0000:00:01:03] PCI::ID [8086:7113]
  [init_stage2(2:2)]: PCI [0000:00:02:00] PCI::ID [1234:1111]
  [init_stage2(2:2)]: PCI [0000:00:03:00] PCI::ID [8086:2922]
  [init_stage2(2:2)]: PCI [0000:00:04:00] PCI::ID [1af4:1003]
  [init_stage2(2:2)]: PCI [0000:00:05:00] PCI::ID [1af4:1005]
  [init_stage2(2:2)]: PCI [0000:00:06:00] PCI::ID [8086:100e]
  [#0 init_stage2(2:2)]: BXVGA: framebuffer @ P0xf8000000
  [#0 init_stage2(2:2)]: BXVGADevice resolution set to 1024x768 (pitch=4096)
  [init_stage2(2:2)]: UHCI: Controller found PCI::ID [8086:7020] @ PCI [0000:00:01:02]
  [init_stage2(2:2)]: UHCI: I/O base IO c080
  [init_stage2(2:2)]: UHCI: Interrupt line: 11
  [#0 init_stage2(2:2)]: UHCI: Allocated framelist at physical address P0x00e40000
  [#0 init_stage2(2:2)]: UHCI: Framelist is at virtual address V0xc115d000
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f000) @ 14946304: link_ptr=14946338, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f020) @ 14946336: link_ptr=14946370, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f040) @ 14946368: link_ptr=14946402, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f060) @ 14946400: link_ptr=14946434, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f080) @ 14946432: link_ptr=14958593, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: Reset completed
  [#0 init_stage2(2:2)]: UHCI: Started
  [#0 init_stage2(2:2)]: DMIExpose: SMBIOS 32bit Entry point @ P0x000f5870
  [#0 init_stage2(2:2)]: DMIExpose: Data table @ P0x000f5890
  [#0 init_stage2(2:2)]: VirtIOConsole: Found @ PCI [0000:00:04:00]
  [#0 init_stage2(2:2)]: Trying to unregister unused handler (?)
  [#0 init_stage2(2:2)]: VirtIOConsole: Multi port is not yet supported!
  [#0 init_stage2(2:2)]: VirtIOConsole: cols: 0, rows: 0, max nr ports 0
  qemu-system-i386.exe: warning: GLib: Too many handles to wait for!
  ```

  The lines starting with [ are SerenityOS output; QEMU warns "GLib: Too
  many handles to wait for!" and crashes right after (can't even Ctrl-C
  in the WSL command line, force-close in Windows necessary). A window
  is still spawned but as the OS already switched out of text mode, just
  a black screen is visible as QEMU crashes.

  I first thought this to be an issue with SerenityOS and reported it
  over there: <https://github.com/SerenityOS/serenity/issues/6422>. The
  kernel devs pointed out that this seems to be a VirtIO driver/device
  issue on the Windows build of QEMU, because the Serenity kernel tries
  to initialize VirtIO devices which apparently crashes QEMU. There will
  be mitigations from the SerenityOS side (by allowing to disable VirtIO
  on boot) but it would of course be great if QEMU handled this
  properly.

  Version info: Both QEMU 6.0.0-rc3 and 5.2.0 exhibit this issue.
  Windows release is 20H2, WSL2 is running Debian 10.9. SerenityOS has
  no proper version but it was reproduced on the most current commits as
  of 18/04/2021.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1924912/+subscriptions


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

* Re: [Bug 1924912] VirtIO drivers don't work on Windows: "GLib: Too many handles to wait for!" crash
  2021-04-18 14:34 ` kleines Filmröllchen
@ 2021-04-19 10:39   ` Stefan Weil
  2021-04-19 11:30     ` Stefan Weil
  2021-04-19 14:30     ` Laurent Vivier
  0 siblings, 2 replies; 14+ messages in thread
From: Stefan Weil @ 2021-04-19 10:39 UTC (permalink / raw)
  To: Bug 1924912, qemu-devel, Michael S. Tsirkin, Laurent Vivier

I can confirm the issue also with latest official QEMU sources.

Related issue URLs:

https://github.com/tesseract-ocr/tesseract/issues/2838

https://bugs.launchpad.net/qemu/+bug/1924912

Instructions and files required to reproduce the issue:

https://qemu.weilnetz.de/test/bugs/1924912/

Michael, Laurent, maybe you have an idea how to narrow down this issue?

Regards

Stefan




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

* Re: [Bug 1924912] VirtIO drivers don't work on Windows: "GLib: Too many handles to wait for!" crash
  2021-04-19 10:39   ` [Bug 1924912] " Stefan Weil
@ 2021-04-19 11:30     ` Stefan Weil
  2021-04-19 14:30     ` Laurent Vivier
  1 sibling, 0 replies; 14+ messages in thread
From: Stefan Weil @ 2021-04-19 11:30 UTC (permalink / raw)
  To: Bug 1924912, qemu-devel, Michael S. Tsirkin, Laurent Vivier

Am 19.04.21 um 12:39 schrieb Stefan Weil:

> I can confirm the issue also with latest official QEMU sources.
>
> Related issue URLs:
>
> https://github.com/tesseract-ocr/tesseract/issues/2838


Sorry, that URL was a copy+paste error. The correct one is 
https://github.com/SerenityOS/serenity/issues/6422.


>
> https://bugs.launchpad.net/qemu/+bug/1924912
>
> Instructions and files required to reproduce the issue:
>
> https://qemu.weilnetz.de/test/bugs/1924912/
>
> Michael, Laurent, maybe you have an idea how to narrow down this issue?
>
> Regards
>
> Stefan
>
>
>


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

* Re: [Bug 1924912] VirtIO drivers don't work on Windows: "GLib: Too many handles to wait for!" crash
  2021-04-19 10:39   ` [Bug 1924912] " Stefan Weil
  2021-04-19 11:30     ` Stefan Weil
@ 2021-04-19 14:30     ` Laurent Vivier
  2021-04-19 14:30       ` Laurent Vivier
                         ` (2 more replies)
  1 sibling, 3 replies; 14+ messages in thread
From: Laurent Vivier @ 2021-04-19 14:30 UTC (permalink / raw)
  To: Stefan Weil, Bug 1924912, qemu-devel, Michael S. Tsirkin

Le 19/04/2021 à 12:39, Stefan Weil a écrit :
> I can confirm the issue also with latest official QEMU sources.
> 
> Related issue URLs:
> 
> https://github.com/tesseract-ocr/tesseract/issues/2838
> 
> https://bugs.launchpad.net/qemu/+bug/1924912
> 
> Instructions and files required to reproduce the issue:
> 
> https://qemu.weilnetz.de/test/bugs/1924912/
> 
> Michael, Laurent, maybe you have an idea how to narrow down this issue?

Could it be related to the number of file descriptors that can differ between linux an windows?

We have a series of patches that sets the number of queues to the number of vCPU:

a4eef0711b2c vhost-user-blk-pci: default num_queues to -smp N
9445e1e15e66 virtio-blk-pci: default num_queues to -smp N
6a558822849f virtio-scsi-pci: default num_queues to -smp N
4e5163bd8444 virtio-scsi: introduce a constant for fixed virtqueues
1436f32a84c3 virtio-pci: add virtio_pci_optimal_num_queues() helper

And I think it can have inpact on the number of open file descriptors.

You can try by specifiying "num_queues=1" with the virtio interfaces on the QEMU command line.
(ot choose a machine type earlier than 5.2)

Thanks,
Laurent


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

* Re: [Bug 1924912] VirtIO drivers don't work on Windows: "GLib: Too many handles to wait for!" crash
  2021-04-19 14:30     ` Laurent Vivier
@ 2021-04-19 14:30       ` Laurent Vivier
  2021-04-19 15:28       ` Stefan Weil
  2021-05-26  9:47       ` Michael S. Tsirkin
  2 siblings, 0 replies; 14+ messages in thread
From: Laurent Vivier @ 2021-04-19 14:30 UTC (permalink / raw)
  To: qemu-devel

Le 19/04/2021 à 12:39, Stefan Weil a écrit :
> I can confirm the issue also with latest official QEMU sources.
> 
> Related issue URLs:
> 
> https://github.com/tesseract-ocr/tesseract/issues/2838
> 
> https://bugs.launchpad.net/qemu/+bug/1924912
> 
> Instructions and files required to reproduce the issue:
> 
> https://qemu.weilnetz.de/test/bugs/1924912/
> 
> Michael, Laurent, maybe you have an idea how to narrow down this issue?

Could it be related to the number of file descriptors that can differ
between linux an windows?

We have a series of patches that sets the number of queues to the number
of vCPU:

a4eef0711b2c vhost-user-blk-pci: default num_queues to -smp N
9445e1e15e66 virtio-blk-pci: default num_queues to -smp N
6a558822849f virtio-scsi-pci: default num_queues to -smp N
4e5163bd8444 virtio-scsi: introduce a constant for fixed virtqueues
1436f32a84c3 virtio-pci: add virtio_pci_optimal_num_queues() helper

And I think it can have inpact on the number of open file descriptors.

You can try by specifiying "num_queues=1" with the virtio interfaces on the QEMU command line.
(ot choose a machine type earlier than 5.2)

Thanks,
Laurent

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1924912

Title:
  VirtIO drivers don't work on Windows: "GLib: Too many handles to wait
  for!" crash

Status in QEMU:
  New

Bug description:
  I ran SerenityOS <https://github.com/SerenityOS/serenity> out of WSL2
  with native Windows QEMU. The system runs fine on the Linux QEMU (with
  Windows X-Server). However, with Windows QEMU I get a hard crash after
  the following output:

  ```
  [#0 colonel(0:0)]: Scheduler[0]: idle loop running
  [init_stage2(2:2)]: PCI [0000:00:00:00] PCI::ID [8086:1237]
  [init_stage2(2:2)]: PCI [0000:00:01:00] PCI::ID [8086:7000]
  [init_stage2(2:2)]: PCI [0000:00:01:01] PCI::ID [8086:7010]
  [init_stage2(2:2)]: PCI [0000:00:01:02] PCI::ID [8086:7020]
  [init_stage2(2:2)]: PCI [0000:00:01:03] PCI::ID [8086:7113]
  [init_stage2(2:2)]: PCI [0000:00:02:00] PCI::ID [1234:1111]
  [init_stage2(2:2)]: PCI [0000:00:03:00] PCI::ID [8086:2922]
  [init_stage2(2:2)]: PCI [0000:00:04:00] PCI::ID [1af4:1003]
  [init_stage2(2:2)]: PCI [0000:00:05:00] PCI::ID [1af4:1005]
  [init_stage2(2:2)]: PCI [0000:00:06:00] PCI::ID [8086:100e]
  [#0 init_stage2(2:2)]: BXVGA: framebuffer @ P0xf8000000
  [#0 init_stage2(2:2)]: BXVGADevice resolution set to 1024x768 (pitch=4096)
  [init_stage2(2:2)]: UHCI: Controller found PCI::ID [8086:7020] @ PCI [0000:00:01:02]
  [init_stage2(2:2)]: UHCI: I/O base IO c080
  [init_stage2(2:2)]: UHCI: Interrupt line: 11
  [#0 init_stage2(2:2)]: UHCI: Allocated framelist at physical address P0x00e40000
  [#0 init_stage2(2:2)]: UHCI: Framelist is at virtual address V0xc115d000
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f000) @ 14946304: link_ptr=14946338, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f020) @ 14946336: link_ptr=14946370, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f040) @ 14946368: link_ptr=14946402, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f060) @ 14946400: link_ptr=14946434, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f080) @ 14946432: link_ptr=14958593, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: Reset completed
  [#0 init_stage2(2:2)]: UHCI: Started
  [#0 init_stage2(2:2)]: DMIExpose: SMBIOS 32bit Entry point @ P0x000f5870
  [#0 init_stage2(2:2)]: DMIExpose: Data table @ P0x000f5890
  [#0 init_stage2(2:2)]: VirtIOConsole: Found @ PCI [0000:00:04:00]
  [#0 init_stage2(2:2)]: Trying to unregister unused handler (?)
  [#0 init_stage2(2:2)]: VirtIOConsole: Multi port is not yet supported!
  [#0 init_stage2(2:2)]: VirtIOConsole: cols: 0, rows: 0, max nr ports 0
  qemu-system-i386.exe: warning: GLib: Too many handles to wait for!
  ```

  The lines starting with [ are SerenityOS output; QEMU warns "GLib: Too
  many handles to wait for!" and crashes right after (can't even Ctrl-C
  in the WSL command line, force-close in Windows necessary). A window
  is still spawned but as the OS already switched out of text mode, just
  a black screen is visible as QEMU crashes.

  I first thought this to be an issue with SerenityOS and reported it
  over there: <https://github.com/SerenityOS/serenity/issues/6422>. The
  kernel devs pointed out that this seems to be a VirtIO driver/device
  issue on the Windows build of QEMU, because the Serenity kernel tries
  to initialize VirtIO devices which apparently crashes QEMU. There will
  be mitigations from the SerenityOS side (by allowing to disable VirtIO
  on boot) but it would of course be great if QEMU handled this
  properly.

  Version info: Both QEMU 6.0.0-rc3 and 5.2.0 exhibit this issue.
  Windows release is 20H2, WSL2 is running Debian 10.9. SerenityOS has
  no proper version but it was reproduced on the most current commits as
  of 18/04/2021.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1924912/+subscriptions


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

* [Bug 1924912] Re: VirtIO drivers don't work on Windows: "GLib: Too many handles to wait for!" crash
  2021-04-18 13:16 [Bug 1924912] [NEW] VirtIO drivers don't work on Windows: "GLib: Too many handles to wait for!" crash kleines Filmröllchen
  2021-04-18 13:35 ` [Bug 1924912] " Stefan Weil
  2021-04-18 14:34 ` kleines Filmröllchen
@ 2021-04-19 14:30 ` Laurent Vivier
  2021-05-15 11:20 ` Thomas Huth
  2021-05-17 14:56 ` kleines Filmröllchen
  4 siblings, 0 replies; 14+ messages in thread
From: Laurent Vivier @ 2021-04-19 14:30 UTC (permalink / raw)
  To: qemu-devel

** Bug watch added: github.com/tesseract-ocr/tesseract/issues #2838
   https://github.com/tesseract-ocr/tesseract/issues/2838

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1924912

Title:
  VirtIO drivers don't work on Windows: "GLib: Too many handles to wait
  for!" crash

Status in QEMU:
  New

Bug description:
  I ran SerenityOS <https://github.com/SerenityOS/serenity> out of WSL2
  with native Windows QEMU. The system runs fine on the Linux QEMU (with
  Windows X-Server). However, with Windows QEMU I get a hard crash after
  the following output:

  ```
  [#0 colonel(0:0)]: Scheduler[0]: idle loop running
  [init_stage2(2:2)]: PCI [0000:00:00:00] PCI::ID [8086:1237]
  [init_stage2(2:2)]: PCI [0000:00:01:00] PCI::ID [8086:7000]
  [init_stage2(2:2)]: PCI [0000:00:01:01] PCI::ID [8086:7010]
  [init_stage2(2:2)]: PCI [0000:00:01:02] PCI::ID [8086:7020]
  [init_stage2(2:2)]: PCI [0000:00:01:03] PCI::ID [8086:7113]
  [init_stage2(2:2)]: PCI [0000:00:02:00] PCI::ID [1234:1111]
  [init_stage2(2:2)]: PCI [0000:00:03:00] PCI::ID [8086:2922]
  [init_stage2(2:2)]: PCI [0000:00:04:00] PCI::ID [1af4:1003]
  [init_stage2(2:2)]: PCI [0000:00:05:00] PCI::ID [1af4:1005]
  [init_stage2(2:2)]: PCI [0000:00:06:00] PCI::ID [8086:100e]
  [#0 init_stage2(2:2)]: BXVGA: framebuffer @ P0xf8000000
  [#0 init_stage2(2:2)]: BXVGADevice resolution set to 1024x768 (pitch=4096)
  [init_stage2(2:2)]: UHCI: Controller found PCI::ID [8086:7020] @ PCI [0000:00:01:02]
  [init_stage2(2:2)]: UHCI: I/O base IO c080
  [init_stage2(2:2)]: UHCI: Interrupt line: 11
  [#0 init_stage2(2:2)]: UHCI: Allocated framelist at physical address P0x00e40000
  [#0 init_stage2(2:2)]: UHCI: Framelist is at virtual address V0xc115d000
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f000) @ 14946304: link_ptr=14946338, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f020) @ 14946336: link_ptr=14946370, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f040) @ 14946368: link_ptr=14946402, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f060) @ 14946400: link_ptr=14946434, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f080) @ 14946432: link_ptr=14958593, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: Reset completed
  [#0 init_stage2(2:2)]: UHCI: Started
  [#0 init_stage2(2:2)]: DMIExpose: SMBIOS 32bit Entry point @ P0x000f5870
  [#0 init_stage2(2:2)]: DMIExpose: Data table @ P0x000f5890
  [#0 init_stage2(2:2)]: VirtIOConsole: Found @ PCI [0000:00:04:00]
  [#0 init_stage2(2:2)]: Trying to unregister unused handler (?)
  [#0 init_stage2(2:2)]: VirtIOConsole: Multi port is not yet supported!
  [#0 init_stage2(2:2)]: VirtIOConsole: cols: 0, rows: 0, max nr ports 0
  qemu-system-i386.exe: warning: GLib: Too many handles to wait for!
  ```

  The lines starting with [ are SerenityOS output; QEMU warns "GLib: Too
  many handles to wait for!" and crashes right after (can't even Ctrl-C
  in the WSL command line, force-close in Windows necessary). A window
  is still spawned but as the OS already switched out of text mode, just
  a black screen is visible as QEMU crashes.

  I first thought this to be an issue with SerenityOS and reported it
  over there: <https://github.com/SerenityOS/serenity/issues/6422>. The
  kernel devs pointed out that this seems to be a VirtIO driver/device
  issue on the Windows build of QEMU, because the Serenity kernel tries
  to initialize VirtIO devices which apparently crashes QEMU. There will
  be mitigations from the SerenityOS side (by allowing to disable VirtIO
  on boot) but it would of course be great if QEMU handled this
  properly.

  Version info: Both QEMU 6.0.0-rc3 and 5.2.0 exhibit this issue.
  Windows release is 20H2, WSL2 is running Debian 10.9. SerenityOS has
  no proper version but it was reproduced on the most current commits as
  of 18/04/2021.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1924912/+subscriptions


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

* Re: [Bug 1924912] VirtIO drivers don't work on Windows: "GLib: Too many handles to wait for!" crash
  2021-04-19 14:30     ` Laurent Vivier
  2021-04-19 14:30       ` Laurent Vivier
@ 2021-04-19 15:28       ` Stefan Weil
  2021-05-26  9:47       ` Michael S. Tsirkin
  2 siblings, 0 replies; 14+ messages in thread
From: Stefan Weil @ 2021-04-19 15:28 UTC (permalink / raw)
  To: Bug 1924912, qemu-devel

Am 19.04.21 um 16:30 schrieb Laurent Vivier:

> Le 19/04/2021 à 12:39, Stefan Weil a écrit :
>> I can confirm the issue also with latest official QEMU sources.
>>
>> Related issue URLs:
>>
>> https://github.com/tesseract-ocr/tesseract/issues/2838
>>
>> https://bugs.launchpad.net/qemu/+bug/1924912
>>
>> Instructions and files required to reproduce the issue:
>>
>> https://qemu.weilnetz.de/test/bugs/1924912/
>>
>> Michael, Laurent, maybe you have an idea how to narrow down this issue?
> Could it be related to the number of file descriptors that can differ
> between linux an windows?
>
> We have a series of patches that sets the number of queues to the number
> of vCPU:
>
> a4eef0711b2c vhost-user-blk-pci: default num_queues to -smp N
> 9445e1e15e66 virtio-blk-pci: default num_queues to -smp N
> 6a558822849f virtio-scsi-pci: default num_queues to -smp N
> 4e5163bd8444 virtio-scsi: introduce a constant for fixed virtqueues
> 1436f32a84c3 virtio-pci: add virtio_pci_optimal_num_queues() helper
>
> And I think it can have inpact on the number of open file descriptors.
>
> You can try by specifiying "num_queues=1" with the virtio interfaces on the QEMU command line.
> (ot choose a machine type earlier than 5.2)
>
> Thanks,
> Laurent

I tried different machine types. That did not help.

The full command line which did not work was this one:

qemu-system-i386 -s -m 512M -cpu max -d guest_errors -smp 2 -device 
VGA,vgamem_mb=64 -drive file=_disk_image,format=raw,index=0,media=disk 
-device ich9-ahci -usb -device virtio-serial -chardev 
stdio,id=stdout,mux=on -device virtconsole,chardev=stdout -device 
isa-debugcon,chardev=stdout -device virtio-rng-pci -soundhw pcspk 
-device sb16 -netdev 
user,id=breh,hostfwd=tcp:127.0.0.1:8888-10.0.2.15:8888,hostfwd=tcp:127.0.0.1:8823-10.0.2.15:23,hostfwd=tcp:127.0.0.1:8000-10.0.2.15:8000,hostfwd=tcp:127.0.0.1:2222-10.0.2.15:22 
-device e1000,netdev=breh -kernel Kernel/Kernel -append hello

QEMU works nicely when I remove "-device virtio-serial" and "-device 
virtconsole,chardev=stdout" from that command line. How would I have to 

modify those arguments to limit the number of queues?

Thanks,

Stefan




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

* [Bug 1924912] Re: VirtIO drivers don't work on Windows: "GLib: Too many handles to wait for!" crash
  2021-04-18 13:16 [Bug 1924912] [NEW] VirtIO drivers don't work on Windows: "GLib: Too many handles to wait for!" crash kleines Filmröllchen
                   ` (2 preceding siblings ...)
  2021-04-19 14:30 ` [Bug 1924912] " Laurent Vivier
@ 2021-05-15 11:20 ` Thomas Huth
  2021-05-17 14:56 ` kleines Filmröllchen
  4 siblings, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2021-05-15 11:20 UTC (permalink / raw)
  To: qemu-devel

The QEMU project is currently moving its bug tracking to another system.
For this we need to know which bugs are still valid and which could be
closed already. Thus we are setting the bug state to "Incomplete" now.

If the bug has already been fixed in the latest upstream version of QEMU,
then please close this ticket as "Fix released".

If it is not fixed yet and you think that this bug report here is still
valid, then you have two options:

1) If you already have an account on gitlab.com, please open a new ticket
for this problem in our new tracker here:

    https://gitlab.com/qemu-project/qemu/-/issues

and then close this ticket here on Launchpad (or let it expire auto-
matically after 60 days). Please mention the URL of this bug ticket on
Launchpad in the new ticket on GitLab.

2) If you don't have an account on gitlab.com and don't intend to get
one, but still would like to keep this ticket opened, then please switch
the state back to "New" or "Confirmed" within the next 60 days (other-
wise it will get closed as "Expired"). We will then eventually migrate
the ticket automatically to the new system (but you won't be the reporter
of the bug in the new system and thus you won't get notified on changes
anymore).

Thank you and sorry for the inconvenience.


** Changed in: qemu
       Status: New => Incomplete

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1924912

Title:
  VirtIO drivers don't work on Windows: "GLib: Too many handles to wait
  for!" crash

Status in QEMU:
  Incomplete

Bug description:
  I ran SerenityOS <https://github.com/SerenityOS/serenity> out of WSL2
  with native Windows QEMU. The system runs fine on the Linux QEMU (with
  Windows X-Server). However, with Windows QEMU I get a hard crash after
  the following output:

  ```
  [#0 colonel(0:0)]: Scheduler[0]: idle loop running
  [init_stage2(2:2)]: PCI [0000:00:00:00] PCI::ID [8086:1237]
  [init_stage2(2:2)]: PCI [0000:00:01:00] PCI::ID [8086:7000]
  [init_stage2(2:2)]: PCI [0000:00:01:01] PCI::ID [8086:7010]
  [init_stage2(2:2)]: PCI [0000:00:01:02] PCI::ID [8086:7020]
  [init_stage2(2:2)]: PCI [0000:00:01:03] PCI::ID [8086:7113]
  [init_stage2(2:2)]: PCI [0000:00:02:00] PCI::ID [1234:1111]
  [init_stage2(2:2)]: PCI [0000:00:03:00] PCI::ID [8086:2922]
  [init_stage2(2:2)]: PCI [0000:00:04:00] PCI::ID [1af4:1003]
  [init_stage2(2:2)]: PCI [0000:00:05:00] PCI::ID [1af4:1005]
  [init_stage2(2:2)]: PCI [0000:00:06:00] PCI::ID [8086:100e]
  [#0 init_stage2(2:2)]: BXVGA: framebuffer @ P0xf8000000
  [#0 init_stage2(2:2)]: BXVGADevice resolution set to 1024x768 (pitch=4096)
  [init_stage2(2:2)]: UHCI: Controller found PCI::ID [8086:7020] @ PCI [0000:00:01:02]
  [init_stage2(2:2)]: UHCI: I/O base IO c080
  [init_stage2(2:2)]: UHCI: Interrupt line: 11
  [#0 init_stage2(2:2)]: UHCI: Allocated framelist at physical address P0x00e40000
  [#0 init_stage2(2:2)]: UHCI: Framelist is at virtual address V0xc115d000
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f000) @ 14946304: link_ptr=14946338, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f020) @ 14946336: link_ptr=14946370, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f040) @ 14946368: link_ptr=14946402, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f060) @ 14946400: link_ptr=14946434, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f080) @ 14946432: link_ptr=14958593, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: Reset completed
  [#0 init_stage2(2:2)]: UHCI: Started
  [#0 init_stage2(2:2)]: DMIExpose: SMBIOS 32bit Entry point @ P0x000f5870
  [#0 init_stage2(2:2)]: DMIExpose: Data table @ P0x000f5890
  [#0 init_stage2(2:2)]: VirtIOConsole: Found @ PCI [0000:00:04:00]
  [#0 init_stage2(2:2)]: Trying to unregister unused handler (?)
  [#0 init_stage2(2:2)]: VirtIOConsole: Multi port is not yet supported!
  [#0 init_stage2(2:2)]: VirtIOConsole: cols: 0, rows: 0, max nr ports 0
  qemu-system-i386.exe: warning: GLib: Too many handles to wait for!
  ```

  The lines starting with [ are SerenityOS output; QEMU warns "GLib: Too
  many handles to wait for!" and crashes right after (can't even Ctrl-C
  in the WSL command line, force-close in Windows necessary). A window
  is still spawned but as the OS already switched out of text mode, just
  a black screen is visible as QEMU crashes.

  I first thought this to be an issue with SerenityOS and reported it
  over there: <https://github.com/SerenityOS/serenity/issues/6422>. The
  kernel devs pointed out that this seems to be a VirtIO driver/device
  issue on the Windows build of QEMU, because the Serenity kernel tries
  to initialize VirtIO devices which apparently crashes QEMU. There will
  be mitigations from the SerenityOS side (by allowing to disable VirtIO
  on boot) but it would of course be great if QEMU handled this
  properly.

  Version info: Both QEMU 6.0.0-rc3 and 5.2.0 exhibit this issue.
  Windows release is 20H2, WSL2 is running Debian 10.9. SerenityOS has
  no proper version but it was reproduced on the most current commits as
  of 18/04/2021.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1924912/+subscriptions


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

* [Bug 1924912] Re: VirtIO drivers don't work on Windows: "GLib: Too many handles to wait for!" crash
  2021-04-18 13:16 [Bug 1924912] [NEW] VirtIO drivers don't work on Windows: "GLib: Too many handles to wait for!" crash kleines Filmröllchen
                   ` (3 preceding siblings ...)
  2021-05-15 11:20 ` Thomas Huth
@ 2021-05-17 14:56 ` kleines Filmröllchen
  4 siblings, 0 replies; 14+ messages in thread
From: kleines Filmröllchen @ 2021-05-17 14:56 UTC (permalink / raw)
  To: qemu-devel

Moved to https://gitlab.com/qemu-project/qemu/-/issues/332

** Changed in: qemu
       Status: Incomplete => Fix Released

** Bug watch added: gitlab.com/qemu-project/qemu/-/issues #332
   https://gitlab.com/qemu-project/qemu/-/issues/332

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1924912

Title:
  VirtIO drivers don't work on Windows: "GLib: Too many handles to wait
  for!" crash

Status in QEMU:
  Fix Released

Bug description:
  I ran SerenityOS <https://github.com/SerenityOS/serenity> out of WSL2
  with native Windows QEMU. The system runs fine on the Linux QEMU (with
  Windows X-Server). However, with Windows QEMU I get a hard crash after
  the following output:

  ```
  [#0 colonel(0:0)]: Scheduler[0]: idle loop running
  [init_stage2(2:2)]: PCI [0000:00:00:00] PCI::ID [8086:1237]
  [init_stage2(2:2)]: PCI [0000:00:01:00] PCI::ID [8086:7000]
  [init_stage2(2:2)]: PCI [0000:00:01:01] PCI::ID [8086:7010]
  [init_stage2(2:2)]: PCI [0000:00:01:02] PCI::ID [8086:7020]
  [init_stage2(2:2)]: PCI [0000:00:01:03] PCI::ID [8086:7113]
  [init_stage2(2:2)]: PCI [0000:00:02:00] PCI::ID [1234:1111]
  [init_stage2(2:2)]: PCI [0000:00:03:00] PCI::ID [8086:2922]
  [init_stage2(2:2)]: PCI [0000:00:04:00] PCI::ID [1af4:1003]
  [init_stage2(2:2)]: PCI [0000:00:05:00] PCI::ID [1af4:1005]
  [init_stage2(2:2)]: PCI [0000:00:06:00] PCI::ID [8086:100e]
  [#0 init_stage2(2:2)]: BXVGA: framebuffer @ P0xf8000000
  [#0 init_stage2(2:2)]: BXVGADevice resolution set to 1024x768 (pitch=4096)
  [init_stage2(2:2)]: UHCI: Controller found PCI::ID [8086:7020] @ PCI [0000:00:01:02]
  [init_stage2(2:2)]: UHCI: I/O base IO c080
  [init_stage2(2:2)]: UHCI: Interrupt line: 11
  [#0 init_stage2(2:2)]: UHCI: Allocated framelist at physical address P0x00e40000
  [#0 init_stage2(2:2)]: UHCI: Framelist is at virtual address V0xc115d000
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f000) @ 14946304: link_ptr=14946338, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f020) @ 14946336: link_ptr=14946370, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f040) @ 14946368: link_ptr=14946402, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f060) @ 14946400: link_ptr=14946434, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f080) @ 14946432: link_ptr=14958593, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: Reset completed
  [#0 init_stage2(2:2)]: UHCI: Started
  [#0 init_stage2(2:2)]: DMIExpose: SMBIOS 32bit Entry point @ P0x000f5870
  [#0 init_stage2(2:2)]: DMIExpose: Data table @ P0x000f5890
  [#0 init_stage2(2:2)]: VirtIOConsole: Found @ PCI [0000:00:04:00]
  [#0 init_stage2(2:2)]: Trying to unregister unused handler (?)
  [#0 init_stage2(2:2)]: VirtIOConsole: Multi port is not yet supported!
  [#0 init_stage2(2:2)]: VirtIOConsole: cols: 0, rows: 0, max nr ports 0
  qemu-system-i386.exe: warning: GLib: Too many handles to wait for!
  ```

  The lines starting with [ are SerenityOS output; QEMU warns "GLib: Too
  many handles to wait for!" and crashes right after (can't even Ctrl-C
  in the WSL command line, force-close in Windows necessary). A window
  is still spawned but as the OS already switched out of text mode, just
  a black screen is visible as QEMU crashes.

  I first thought this to be an issue with SerenityOS and reported it
  over there: <https://github.com/SerenityOS/serenity/issues/6422>. The
  kernel devs pointed out that this seems to be a VirtIO driver/device
  issue on the Windows build of QEMU, because the Serenity kernel tries
  to initialize VirtIO devices which apparently crashes QEMU. There will
  be mitigations from the SerenityOS side (by allowing to disable VirtIO
  on boot) but it would of course be great if QEMU handled this
  properly.

  Version info: Both QEMU 6.0.0-rc3 and 5.2.0 exhibit this issue.
  Windows release is 20H2, WSL2 is running Debian 10.9. SerenityOS has
  no proper version but it was reproduced on the most current commits as
  of 18/04/2021.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1924912/+subscriptions


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

* Re: [Bug 1924912] VirtIO drivers don't work on Windows: "GLib: Too many handles to wait for!" crash
  2021-04-19 14:30     ` Laurent Vivier
  2021-04-19 14:30       ` Laurent Vivier
  2021-04-19 15:28       ` Stefan Weil
@ 2021-05-26  9:47       ` Michael S. Tsirkin
  2021-05-26  9:47         ` mst
  2021-05-26 10:16         ` Laurent Vivier
  2 siblings, 2 replies; 14+ messages in thread
From: Michael S. Tsirkin @ 2021-05-26  9:47 UTC (permalink / raw)
  To: Laurent Vivier; +Cc: Stefan Weil, Bug 1924912, qemu-devel

So it's a virtio console issue on a windows host.

[#0 init_stage2(2:2)]: VirtIOConsole: Found @ PCI [0000:00:04:00]
[#0 init_stage2(2:2)]: Trying to unregister unused handler (?)
[#0 init_stage2(2:2)]: VirtIOConsole: Multi port is not yet supported!
[#0 init_stage2(2:2)]: VirtIOConsole: cols: 0, rows: 0, max nr ports 0
qemu-system-i386.exe: warning: GLib: Too many handles to wait for!

Laurent?


On Mon, Apr 19, 2021 at 04:30:23PM +0200, Laurent Vivier wrote:
> Le 19/04/2021 à 12:39, Stefan Weil a écrit :
> > I can confirm the issue also with latest official QEMU sources.
> > 
> > Related issue URLs:
> > 
> > https://github.com/tesseract-ocr/tesseract/issues/2838
> > 
> > https://bugs.launchpad.net/qemu/+bug/1924912
> > 
> > Instructions and files required to reproduce the issue:
> > 
> > https://qemu.weilnetz.de/test/bugs/1924912/
> > 
> > Michael, Laurent, maybe you have an idea how to narrow down this issue?
> 
> Could it be related to the number of file descriptors that can differ between linux an windows?
> 
> We have a series of patches that sets the number of queues to the number of vCPU:
> 
> a4eef0711b2c vhost-user-blk-pci: default num_queues to -smp N
> 9445e1e15e66 virtio-blk-pci: default num_queues to -smp N
> 6a558822849f virtio-scsi-pci: default num_queues to -smp N
> 4e5163bd8444 virtio-scsi: introduce a constant for fixed virtqueues
> 1436f32a84c3 virtio-pci: add virtio_pci_optimal_num_queues() helper
> 
> And I think it can have inpact on the number of open file descriptors.
> 
> You can try by specifiying "num_queues=1" with the virtio interfaces on the QEMU command line.
> (ot choose a machine type earlier than 5.2)
> 
> Thanks,
> Laurent



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

* Re: [Bug 1924912] VirtIO drivers don't work on Windows: "GLib: Too many handles to wait for!" crash
  2021-05-26  9:47       ` Michael S. Tsirkin
@ 2021-05-26  9:47         ` mst
  2021-05-26 10:16         ` Laurent Vivier
  1 sibling, 0 replies; 14+ messages in thread
From: mst @ 2021-05-26  9:47 UTC (permalink / raw)
  To: qemu-devel

So it's a virtio console issue on a windows host.

[#0 init_stage2(2:2)]: VirtIOConsole: Found @ PCI [0000:00:04:00]
[#0 init_stage2(2:2)]: Trying to unregister unused handler (?)
[#0 init_stage2(2:2)]: VirtIOConsole: Multi port is not yet supported!
[#0 init_stage2(2:2)]: VirtIOConsole: cols: 0, rows: 0, max nr ports 0
qemu-system-i386.exe: warning: GLib: Too many handles to wait for!

Laurent?


On Mon, Apr 19, 2021 at 04:30:23PM +0200, Laurent Vivier wrote:
> Le 19/04/2021 à 12:39, Stefan Weil a écrit :
> > I can confirm the issue also with latest official QEMU sources.
> > 
> > Related issue URLs:
> > 
> > https://github.com/tesseract-ocr/tesseract/issues/2838
> > 
> > https://bugs.launchpad.net/qemu/+bug/1924912
> > 
> > Instructions and files required to reproduce the issue:
> > 
> > https://qemu.weilnetz.de/test/bugs/1924912/
> > 
> > Michael, Laurent, maybe you have an idea how to narrow down this issue?
> 
> Could it be related to the number of file descriptors that can differ between linux an windows?
> 
> We have a series of patches that sets the number of queues to the number of vCPU:
> 
> a4eef0711b2c vhost-user-blk-pci: default num_queues to -smp N
> 9445e1e15e66 virtio-blk-pci: default num_queues to -smp N
> 6a558822849f virtio-scsi-pci: default num_queues to -smp N
> 4e5163bd8444 virtio-scsi: introduce a constant for fixed virtqueues
> 1436f32a84c3 virtio-pci: add virtio_pci_optimal_num_queues() helper
> 
> And I think it can have inpact on the number of open file descriptors.
> 
> You can try by specifiying "num_queues=1" with the virtio interfaces on the QEMU command line.
> (ot choose a machine type earlier than 5.2)
> 
> Thanks,
> Laurent

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1924912

Title:
  VirtIO drivers don't work on Windows: "GLib: Too many handles to wait
  for!" crash

Status in QEMU:
  Fix Released

Bug description:
  I ran SerenityOS <https://github.com/SerenityOS/serenity> out of WSL2
  with native Windows QEMU. The system runs fine on the Linux QEMU (with
  Windows X-Server). However, with Windows QEMU I get a hard crash after
  the following output:

  ```
  [#0 colonel(0:0)]: Scheduler[0]: idle loop running
  [init_stage2(2:2)]: PCI [0000:00:00:00] PCI::ID [8086:1237]
  [init_stage2(2:2)]: PCI [0000:00:01:00] PCI::ID [8086:7000]
  [init_stage2(2:2)]: PCI [0000:00:01:01] PCI::ID [8086:7010]
  [init_stage2(2:2)]: PCI [0000:00:01:02] PCI::ID [8086:7020]
  [init_stage2(2:2)]: PCI [0000:00:01:03] PCI::ID [8086:7113]
  [init_stage2(2:2)]: PCI [0000:00:02:00] PCI::ID [1234:1111]
  [init_stage2(2:2)]: PCI [0000:00:03:00] PCI::ID [8086:2922]
  [init_stage2(2:2)]: PCI [0000:00:04:00] PCI::ID [1af4:1003]
  [init_stage2(2:2)]: PCI [0000:00:05:00] PCI::ID [1af4:1005]
  [init_stage2(2:2)]: PCI [0000:00:06:00] PCI::ID [8086:100e]
  [#0 init_stage2(2:2)]: BXVGA: framebuffer @ P0xf8000000
  [#0 init_stage2(2:2)]: BXVGADevice resolution set to 1024x768 (pitch=4096)
  [init_stage2(2:2)]: UHCI: Controller found PCI::ID [8086:7020] @ PCI [0000:00:01:02]
  [init_stage2(2:2)]: UHCI: I/O base IO c080
  [init_stage2(2:2)]: UHCI: Interrupt line: 11
  [#0 init_stage2(2:2)]: UHCI: Allocated framelist at physical address P0x00e40000
  [#0 init_stage2(2:2)]: UHCI: Framelist is at virtual address V0xc115d000
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f000) @ 14946304: link_ptr=14946338, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f020) @ 14946336: link_ptr=14946370, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f040) @ 14946368: link_ptr=14946402, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f060) @ 14946400: link_ptr=14946434, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f080) @ 14946432: link_ptr=14958593, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: Reset completed
  [#0 init_stage2(2:2)]: UHCI: Started
  [#0 init_stage2(2:2)]: DMIExpose: SMBIOS 32bit Entry point @ P0x000f5870
  [#0 init_stage2(2:2)]: DMIExpose: Data table @ P0x000f5890
  [#0 init_stage2(2:2)]: VirtIOConsole: Found @ PCI [0000:00:04:00]
  [#0 init_stage2(2:2)]: Trying to unregister unused handler (?)
  [#0 init_stage2(2:2)]: VirtIOConsole: Multi port is not yet supported!
  [#0 init_stage2(2:2)]: VirtIOConsole: cols: 0, rows: 0, max nr ports 0
  qemu-system-i386.exe: warning: GLib: Too many handles to wait for!
  ```

  The lines starting with [ are SerenityOS output; QEMU warns "GLib: Too
  many handles to wait for!" and crashes right after (can't even Ctrl-C
  in the WSL command line, force-close in Windows necessary). A window
  is still spawned but as the OS already switched out of text mode, just
  a black screen is visible as QEMU crashes.

  I first thought this to be an issue with SerenityOS and reported it
  over there: <https://github.com/SerenityOS/serenity/issues/6422>. The
  kernel devs pointed out that this seems to be a VirtIO driver/device
  issue on the Windows build of QEMU, because the Serenity kernel tries
  to initialize VirtIO devices which apparently crashes QEMU. There will
  be mitigations from the SerenityOS side (by allowing to disable VirtIO
  on boot) but it would of course be great if QEMU handled this
  properly.

  Version info: Both QEMU 6.0.0-rc3 and 5.2.0 exhibit this issue.
  Windows release is 20H2, WSL2 is running Debian 10.9. SerenityOS has
  no proper version but it was reproduced on the most current commits as
  of 18/04/2021.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1924912/+subscriptions


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

* Re: [Bug 1924912] VirtIO drivers don't work on Windows: "GLib: Too many handles to wait for!" crash
  2021-05-26  9:47       ` Michael S. Tsirkin
  2021-05-26  9:47         ` mst
@ 2021-05-26 10:16         ` Laurent Vivier
  1 sibling, 0 replies; 14+ messages in thread
From: Laurent Vivier @ 2021-05-26 10:16 UTC (permalink / raw)
  To: qemu-devel

Le 26/05/2021 à 11:47, mst a écrit :
> So it's a virtio console issue on a windows host.
> 
> [#0 init_stage2(2:2)]: VirtIOConsole: Found @ PCI [0000:00:04:00]
> [#0 init_stage2(2:2)]: Trying to unregister unused handler (?)
> [#0 init_stage2(2:2)]: VirtIOConsole: Multi port is not yet supported!
> [#0 init_stage2(2:2)]: VirtIOConsole: cols: 0, rows: 0, max nr ports 0
> qemu-system-i386.exe: warning: GLib: Too many handles to wait for!
> 
> Laurent?

I will answer on gitlab issue:

https://gitlab.com/qemu-project/qemu/-/issues/332

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1924912

Title:
  VirtIO drivers don't work on Windows: "GLib: Too many handles to wait
  for!" crash

Status in QEMU:
  Fix Released

Bug description:
  I ran SerenityOS <https://github.com/SerenityOS/serenity> out of WSL2
  with native Windows QEMU. The system runs fine on the Linux QEMU (with
  Windows X-Server). However, with Windows QEMU I get a hard crash after
  the following output:

  ```
  [#0 colonel(0:0)]: Scheduler[0]: idle loop running
  [init_stage2(2:2)]: PCI [0000:00:00:00] PCI::ID [8086:1237]
  [init_stage2(2:2)]: PCI [0000:00:01:00] PCI::ID [8086:7000]
  [init_stage2(2:2)]: PCI [0000:00:01:01] PCI::ID [8086:7010]
  [init_stage2(2:2)]: PCI [0000:00:01:02] PCI::ID [8086:7020]
  [init_stage2(2:2)]: PCI [0000:00:01:03] PCI::ID [8086:7113]
  [init_stage2(2:2)]: PCI [0000:00:02:00] PCI::ID [1234:1111]
  [init_stage2(2:2)]: PCI [0000:00:03:00] PCI::ID [8086:2922]
  [init_stage2(2:2)]: PCI [0000:00:04:00] PCI::ID [1af4:1003]
  [init_stage2(2:2)]: PCI [0000:00:05:00] PCI::ID [1af4:1005]
  [init_stage2(2:2)]: PCI [0000:00:06:00] PCI::ID [8086:100e]
  [#0 init_stage2(2:2)]: BXVGA: framebuffer @ P0xf8000000
  [#0 init_stage2(2:2)]: BXVGADevice resolution set to 1024x768 (pitch=4096)
  [init_stage2(2:2)]: UHCI: Controller found PCI::ID [8086:7020] @ PCI [0000:00:01:02]
  [init_stage2(2:2)]: UHCI: I/O base IO c080
  [init_stage2(2:2)]: UHCI: Interrupt line: 11
  [#0 init_stage2(2:2)]: UHCI: Allocated framelist at physical address P0x00e40000
  [#0 init_stage2(2:2)]: UHCI: Framelist is at virtual address V0xc115d000
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f000) @ 14946304: link_ptr=14946338, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f020) @ 14946336: link_ptr=14946370, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f040) @ 14946368: link_ptr=14946402, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f060) @ 14946400: link_ptr=14946434, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: QH(0xc115f080) @ 14946432: link_ptr=14958593, element_link_ptr=1
  [#0 init_stage2(2:2)]: UHCI: Reset completed
  [#0 init_stage2(2:2)]: UHCI: Started
  [#0 init_stage2(2:2)]: DMIExpose: SMBIOS 32bit Entry point @ P0x000f5870
  [#0 init_stage2(2:2)]: DMIExpose: Data table @ P0x000f5890
  [#0 init_stage2(2:2)]: VirtIOConsole: Found @ PCI [0000:00:04:00]
  [#0 init_stage2(2:2)]: Trying to unregister unused handler (?)
  [#0 init_stage2(2:2)]: VirtIOConsole: Multi port is not yet supported!
  [#0 init_stage2(2:2)]: VirtIOConsole: cols: 0, rows: 0, max nr ports 0
  qemu-system-i386.exe: warning: GLib: Too many handles to wait for!
  ```

  The lines starting with [ are SerenityOS output; QEMU warns "GLib: Too
  many handles to wait for!" and crashes right after (can't even Ctrl-C
  in the WSL command line, force-close in Windows necessary). A window
  is still spawned but as the OS already switched out of text mode, just
  a black screen is visible as QEMU crashes.

  I first thought this to be an issue with SerenityOS and reported it
  over there: <https://github.com/SerenityOS/serenity/issues/6422>. The
  kernel devs pointed out that this seems to be a VirtIO driver/device
  issue on the Windows build of QEMU, because the Serenity kernel tries
  to initialize VirtIO devices which apparently crashes QEMU. There will
  be mitigations from the SerenityOS side (by allowing to disable VirtIO
  on boot) but it would of course be great if QEMU handled this
  properly.

  Version info: Both QEMU 6.0.0-rc3 and 5.2.0 exhibit this issue.
  Windows release is 20H2, WSL2 is running Debian 10.9. SerenityOS has
  no proper version but it was reproduced on the most current commits as
  of 18/04/2021.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1924912/+subscriptions


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

end of thread, other threads:[~2021-05-26 10:26 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-18 13:16 [Bug 1924912] [NEW] VirtIO drivers don't work on Windows: "GLib: Too many handles to wait for!" crash kleines Filmröllchen
2021-04-18 13:35 ` [Bug 1924912] " Stefan Weil
2021-04-18 14:34 ` kleines Filmröllchen
2021-04-19 10:39   ` [Bug 1924912] " Stefan Weil
2021-04-19 11:30     ` Stefan Weil
2021-04-19 14:30     ` Laurent Vivier
2021-04-19 14:30       ` Laurent Vivier
2021-04-19 15:28       ` Stefan Weil
2021-05-26  9:47       ` Michael S. Tsirkin
2021-05-26  9:47         ` mst
2021-05-26 10:16         ` Laurent Vivier
2021-04-19 14:30 ` [Bug 1924912] " Laurent Vivier
2021-05-15 11:20 ` Thomas Huth
2021-05-17 14:56 ` kleines Filmröllchen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).