canonical / multipass

Multipass orchestrates virtual Ubuntu instances
https://multipass.run
GNU General Public License v3.0
7.64k stars 634 forks source link

macOS: Instance is suspended after killing the daemon and cannot be restarted or stopped #3563

Open giuliazanchi opened 1 month ago

giuliazanchi commented 1 month ago

Describe the bug I was using the 1.14 RC5 macOS GUI client and it crashed unexpectedly when I switched off the "Allow privileged mounts" setting. The daemon caused it to suspend a running instance, which didn't suspend as expected and the daemon failed to quit, with the image becoming corrupted. I had to kill processes manually to be able to use Multipass again. The affected instance is still in suspended mode and cannot be started or stopped (even with --force option).

Logs multipassd.log.zip

Additional info

ricab commented 1 month ago

For our future reference, there are two issues here:

  1. the daemon is sometimes unable to exit when there are running instances. I believe that the daemon process gets blocked when joining threads, just before quitting, because at least one of them is blocked (most likely the one attempting to suspend an instance). That prevents the process from exiting. This may be more easily reproduced with parallel info/list requests (as in the GUI)
  2. Suspending QEMU instances sometimes corrupts them. The best hypothesis we have is that this happens when the QEMU process is killed after the suspension snapshot is created — manually in this case, but usually by the daemon.