Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSHFS mount failing to terminate crashes daemon on instance delete #3799

Open
Sploder12 opened this issue Nov 29, 2024 · 0 comments
Open

SSHFS mount failing to terminate crashes daemon on instance delete #3799

Sploder12 opened this issue Nov 29, 2024 · 0 comments
Labels
bug needs triage Issue needs to be triaged

Comments

@Sploder12
Copy link
Contributor

Sploder12 commented Nov 29, 2024

Describe the bug
If an sshfs mount fails to unmount during the deletion process the daemon will crash.

To Reproduce

  1. create an instance with some valid mount
  2. delete the instance while somehow ensuring the sshfs process will not terminate from SIGTERM
  3. observe daemon crash

Expected behavior
The daemon does not crash. There is either an error with deletion or the mount is killed with SIGKILL. (There should also be no crash if SIGKILL fails)

Logs

[2024-11-29T12:42:43.199] [info] [sshfs-mount-handler] Stopping mount "/home/ubuntu/TEST_FOLDER" in instance 'healing-octopus'
[2024-11-29T12:42:48.203] [warning] [sshfs-mount-handler] Failed to gracefully stop mount "/home/ubuntu/TEST_FOLDER" in instance 'healing-octopus': Failed to terminate SSHFS mount process: 
[2024-11-29T12:42:48.203] [info] [healing-octopus] Forcing shutdown
[2024-11-29T12:42:48.203] [info] [healing-octopus] Killing process
[2024-11-29T12:42:48.295] [info] [healing-octopus] process state changed to NotRunning
[2024-11-29T12:42:48.295] [info] [healing-octopus] process error occurred Crashed program: qemu-system-x86_64; error: Process crashed
[2024-11-29T12:42:48.336] [info] [healing-octopus] error: program: qemu-system-x86_64; error: Process crashed
[2024-11-29T12:42:48.336] [debug] [healing-octopus] Dropping cached SSH session
[2024-11-29T12:42:48.449] [debug] [daemon] Applied AppArmor policy: multipass.qemu-img
[2024-11-29T12:42:48.451] [debug] [qemu-img] [48278] started: qemu-img snapshot -l /home/trevor-shoe/.local/share/multipassd/vault/instances/healing-octopus/ubuntu-24.04-server-cloudimg-amd64.img
[2024-11-29T12:42:48.674] [debug] [daemon] Instance purged: healing-octopus
[2024-11-29T12:42:48.818] [warning] [Qt] QProcess: Destroyed while process ("/home/trevor-shoe/Desktop/Canonical/multipass/cmake-build-debug/bin/sshfs_server") is still running.
Signal: SIGSEGV (Segmentation fault)

Additional info

  • OS: Ubuntu 24.04
  • multipass version: 1.15.0-dev.746+g9d3b26ccd
  • multipass get local.driver: qemu

Additional context
Looks like a use-after-free coming from QProcess signal handlers
Occurs in GUI and CLI. Does not appear to be a regression.
To prevent SIGTERM from working you can run Multipass through CLion as a snap.

@Sploder12 Sploder12 added bug needs triage Issue needs to be triaged labels Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

1 participant