Skip to content

Zed crashes when sshfs containing a git repo is unmounted #10992

@ConradIrwin

Description

@ConradIrwin

Summary

It is possible to reliably crash zed with:

  • Using sshfs (via macFuse) to do sshfs -o reconnect HOST:~/0 ~/sshfs
  • Opening zed ~/sshfs
  • Calling diskutil umount force ~/sshfs
Termination Reason:    Namespace SIGNAL, Code 10 Bus error: 10
Terminating Process:   exc handler [11875]

VM Region Info: 0x11f3480f4 is in 0x11f348000-0x11f3b8000;  bytes after start: 244  bytes before end: 458507
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      mapped file                 11f340000-11f348000    [   32K] r--/r-- SM=PRV  Object_id=c33a63d
--->  mapped file                 11f348000-11f3b8000    [  448K] r--/r-- SM=PRV  Object_id=c2ee83d
      GAP OF 0x108000 BYTES
      VM_ALLOCATE                 11f4c0000-11f4c4000    [   16K] r--/rwx SM=COW  

Kernel Triage:
VM - (arg = 0x0) Object has no pager because the backing vnode was force unmounted
VM - (arg = 0x0) Object has no pager because the backing vnode was force unmounted

The problem here is that libgit2 is mmapping a file, and when you try and read memory backed by an mmapped file you get a Bus error: 10.

Not sure how to fix yet, it looks like libgit2 has a NO_MMAP compile flag which we could try. Or maybe we can notice that the filesystem is unmounted and not check for updates to the git status.

(Either way using sshfs has other problems, so is not super recommended).

Environment

Zed: v0.133.0 (Zed Nightly fbc6e93)
OS: macOS 14.4.1
Memory: 128 GiB
Architecture: aarch64

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    reproducibleVerified steps to reproduce included

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions