microsoft / microsoft/VFSForGit
GVFS.Mount will crash if it receives a ReleaseLock before mounting is complete
Open
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
git rebaseis started (and acquires the lock)git rebasehangs- User runs
gvfs diagnose gvfs diagnoseunmounts and remounts the repo- As the repo is unmounted,
git rebasehits an error that causes the git command to exit - The post-command hook called by
git rebasecrosses withGVFS.Mountstarting up, andGVFS.Mountreceives aNamedPipeMessages.ReleaseLock.RequestbeforeInProcessMount.fileSystemCallbacksis 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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