libgit2 / libgit2/libgit2sharp

Crash in git_diff_tree_to_index when calling Repository.RetrieveStatus

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

還沒有人認領這個 Issue。

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

描述

I originally raised this bug with libgit2 directly but response was that this is in fact a libgit2sharp error.
https://github.com/libgit2/libgit2/issues/5363

Reproduction steps

Use Repository.RetrieveStatus from libgit2sharp from inside Unity3D editor script.

  1. download this: libgit2-git_diff_tree_to_index-Crash.zip
  2. download Unity 2019.3.0f5 (other versions crash as well)
  3. open the above project
  4. select menu item "Git Error/RetrieveStatus - CRASH"
  5. note native crash, with the log below
Expected behavior

No crash, instead returns RepositoryStatus

Actual behavior
git2-106a5f2.dll caused an Access Violation (0xc0000005)
  in module git2-106a5f2.dll at 0033:7cb4ae65.

Stack Trace of Crashed Thread 9380:
0x00007FFC7CB4AE65 (git2-106a5f2) git_diff_tree_to_index
0x00007FFC7CBB4B09 (git2-106a5f2) git_status_list_new
0x0000028C392EADBF (LibGit2Sharp) LibGit2Sharp.Core.NativeMethods.git_status_list_new()
0x0000028C392EAB9B (LibGit2Sharp) LibGit2Sharp.Core.Proxy.git_status_list_new()
0x0000028C392E57FB (LibGit2Sharp) LibGit2Sharp.RepositoryStatus..ctor()
0x0000028C392E49FB (LibGit2Sharp) LibGit2Sharp.Repository.RetrieveStatus()
Version of LibGit2Sharp (release number or SHA1)

git2-106a5f2, but also happens with e.g. git2-7ce88e6 (happened with all versions I tried).

Operating system(s) tested; .NET runtime tested

Windows 10

貢獻指南

開啟貢獻指南

從這裡開始

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

研究方向

從附加的 Unity 重現專案以及 issue 中描述的 Repository.RetrieveStatus 呼叫開始。檢查 git_diff_tree_to_index 和 git_status_list_new 附近的原生崩潰堆疊,然後在 Windows 10 上驗證重現專案不再崩潰並回傳 RepositoryStatus。

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

評估

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

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

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