microsoft / microsoft/VFSForGit

GVFS.Mount will crash if it receives a ReleaseLock before mounting is complete

Open
#1,296 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

affects: reliability platform: linux platform: macOS platform: windows type: bug
Dominant language
C#
Stars
6.1k
Forks
474
Avg merge
2d 4h
Merged PRs (30d)
8

Description

VFS For Git Version
1.0.19158.2

Callstack

"System.NullReferenceException: Object reference not set to an instance of an object.
   at GVFS.Mount.InProcessMount.HandleReleaseLockRequest(String messageBody, Connection connection) in E:\A\_work\593\s\GVFS\GVFS.Mount\InProcessMount.cs:line 343
   at GVFS.Common.NamedPipes.NamedPipeServer.HandleConnection(ITracer tracer, Connection connection, Action`3 handleRequest)
   at GVFS.Common.NamedPipes.NamedPipeServer.OnNewConnection(IAsyncResult ar, Boolean createNewThreadIfSynchronous)\",
"ErrorMessage":"Unhandled exception in connection handler"

Timeline of events

  1. git rebase is started (and acquires the lock)
  2. git rebase hangs
  3. User runs gvfs diagnose
  4. gvfs diagnose unmounts and remounts the repo
  5. As the repo is unmounted, git rebase hits an error that causes the git command to exit
  6. The post-command hook called by git rebase crosses with GVFS.Mount starting up, and GVFS.Mount receives a NamedPipeMessages.ReleaseLock.Request before InProcessMount.fileSystemCallbacks is initialized.

The crash occurs in HandleReleaseLockRequest because it does not check if fileSystemCallbacks is valid (nor does it check the if the repo is Ready like HandleLockRequest).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in GVFS.Mount/InProcessMount.cs at HandleReleaseLockRequest, then compare its readiness handling with HandleLockRequest. Reproduce or trace the startup race described in the timeline, and verify that a ReleaseLock received before fileSystemCallbacks is initialized no longer causes an unhandled NullReferenceException.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
devtools
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.