libgit2 / libgit2/libgit2sharp

Fatal Error : System.AccessViolationException while cloning some repos with RecurseSubmodules on

未關閉
#1,776 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
C#
星號
3.5k
分支
925
PR 合併指標
30 天內沒有已合併 PR

描述

I have found out that some repos with the Rescurse Submodulo option flag set to true causes a FatalError System.AccessViolationException, the same repo with the flag on off works as expected

Tried cloning the repo using git client and was able to clone normally with and without the --recursive flag, so now I suspect is something related only to lib2git.

Reproduction steps

Try to clone : https://github.com/AIDungeon/AIDungeon with CloneOptions :

RecurseSubmodules = true

Expected behavior

Successfully clone the repo

Actual behavior

Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at LibGit2Sharp.Core.NativeMethods.git_submodule_resolve_url(LibGit2Sharp.Core.Handles.GitBuf, LibGit2Sharp.Core.git_repository*, System.String) at LibGit2Sharp.Core.NativeMethods.git_submodule_resolve_url(LibGit2Sharp.Core.Handles.GitBuf, LibGit2Sharp.Core.git_repository*, System.String) at LibGit2Sharp.Core.Proxy.git_submodule_resolve_url(LibGit2Sharp.Core.Handles.RepositoryHandle, System.String) at LibGit2Sharp.Repository.RecursivelyCloneSubmodules(LibGit2Sharp.CloneOptions, System.String, Int32) at LibGit2Sharp.Repository.Clone(System.String, System.String, LibGit2Sharp.CloneOptions)

Version of LibGit2Sharp (release number or SHA1)

0.26.2

Operating system(s) tested; .NET runtime tested

Windows 10
.Net Core 3.1

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 Repository.RecursivelyCloneSubmodules 開始,沿著 Proxy.git_submodule_resolve_url 追蹤到堆疊追蹤中顯示的原生 git_submodule_resolve_url 呼叫。在啟用 RecurseSubmodules 的情況下於 Windows 上重現 AIDungeon 複製,然後驗證遞迴複製是否能在沒有 AccessViolationException 的情況下完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
csharp, git
領域
devtools
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。