VirtualBox

Opened 5 years ago

Last modified 3 years ago

#19133 assigned defect

Mac-hosted VM lockup when guest opens a named pipe in a shared folder — at Initial Version

Reported by: lesha Owned by:
Component: shared folders Version: VirtualBox 6.0.14
Keywords: named pipe, fifo, lockup Cc:
Guest type: all Host type: all

Description

I discovered this bug because I was rsyncing a shared folder containing a named pipe, and this hung my machine.

Repro steps:

  • Set up a Linux guest on a Mac host. I have Ubuntu 18.04 running on VBox 6.0.14 (latest stable as of now).
  • Set up a shared folder
  • On the host, mkfifo TEST_PIPE in the folder
  • On the guest, cat TEST_PIPE

At this point, the guest is (partially) locked up. Specifically:

  • Ctrl-C nor SIGKILL will work for cat — it is hung in D state, unkillable
  • Any process touching the shared folder hangs likewise
  • dmesg will show the following stack for the hung cat https://pastebin.com/WjKQaZys
  • The guest cannot be cleanly rebooted because shutdown requires tearing down the guest additions module, which is blocked on talking to the VM.
  • Powering off the VM (not from the guest, but from the UI!) will hang.

So this is not a hang in guest additions, but in the VM code itself.

My guess is that the thread handling shared folders is locked up trying to read from the named pipe.

What confirms this is that the hang is resolved the moment that I do echo > TEST_PIPE on the host.

The reason this is not expected behavior is that the guest sees the named pipe as a regular file:

$ ls -l TEST_PIPE -rwxrwx--- 1 root vboxsf 0 Dec 6 16:21 TEST_PIPE

Two fixes seem possible:

  • Make named pipes act as true named pipes to the host. If you google "vboxsf named pipe", this is actually a feature that was previously requested.
  • Make the open syscall fail in this context. This is worse than working pipes, but better than a lockup. At the moment, data does not actually travel down the named pipe, if the host does echo foo > TEST_PIPE and the guest does cat TEST_PIPE, the guest simply says cat: TEST_PIPE: Protocol error.

Change History (0)

Note: See TracTickets for help on using tickets.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette