microsoft / microsoft/VFSForGit

Could not find any recognizable digits

Open
#67 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Recently we have this issue while using gvfs clone. The stacktrace is:

   at System.ParseNumbers.StringToInt(String s, Int32 radix, Int32 flags, Int32* currPos)
   at System.Convert.ToByte(String value, Int32 fromBase)
   at GVFS.Common.Git.GitPathConverter.ConvertPathOctetsToUtf8(String filePath) in E:\A\_work\45\s\GVFS\GVFS.Common\Git\GitPathConverter.cs:line 34
   at GVFS.Common.Git.DiffTreeResult.ConvertPathToAbsoluteUtf8Path(String repoRoot, String relativePath) in E:\A\_work\45\s\GVFS\GVFS.Common\Git\DiffTreeResult.cs:line 110
   at GVFS.Common.Git.DiffTreeResult.ParseFromLsTreeLine(String line, String repoRoot) in E:\A\_work\45\s\GVFS\GVFS.Common\Git\DiffTreeResult.cs:line 72
   at GVFS.CommandLine.GVFSVerb.<>c__DisplayClass44_0.<TryDownloadRootGitAttributes>b__0(String line) in E:\A\_work\45\s\GVFS\GVFS\CommandLine\GVFSVerb.cs:line 396
   at System.Diagnostics.Process.OutputReadNotifyUser(String data)
   at System.Diagnostics.AsyncStreamReader.FlushMessageQueue()
   at System.Diagnostics.AsyncStreamReader.GetLinesFromStringBuilder()
   at System.Diagnostics.AsyncStreamReader.ReadBuffer(IAsyncResult ar)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.IO.Stream.ReadWriteTask.System.Threading.Tasks.ITaskCompletionAction.Invoke(Task completingTask)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task.Finish(Boolean bUserDelegateExecuted)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
   at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

Looking at the code:

https://github.com/Microsoft/GVFS/blob/522d018a2e34a13e56a94b158b7bc58ba3009a1d/GVFS/GVFS.Common/Git/DiffTreeResult.cs#L108-L111

and this code:

https://github.com/Microsoft/GVFS/blob/3c09517e5dd154a63592ac2d78c582b9629dad90/GVFS/GVFS.Common/Git/GitPathConverter.cs#L34

Seems like if there's any "\" in the path we would have this issue. Any reason?

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 with GVFS.Common/Git/GitPathConverter.cs at ConvertPathOctetsToUtf8 and GVFS.Common/Git/DiffTreeResult.cs at ParseFromLsTreeLine and ConvertPathToAbsoluteUtf8Path. Reproduce the failure during a gvfs clone using a path containing a backslash, then trace how the path reaches Convert.ToByte. Done means the clone no longer raises the parsing exception and the path is handled correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.