libgit2 / libgit2/libgit2sharp

Failing to read huge pack files

オープン
#1,835 コメント 0 件 リアクション 5 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
C#
スター
3.5k
フォーク
925
PR マージ指標
30日以内にマージされた PR はありません

説明

I'm using lib2gitsharp with big enterprise repositories which may have pack files with a size of 4 to 5 GB. When the size of the initially cloned pack file exceeds a certain value, reading operations will fail. I started with a 4.5 GB pack file repo, which I updated incrementally for some months. This poses no problems. When I freshly clone the same repo now, the initial pack file has (due to ongoing development) grown to 5.5 GB, which lib2gitsharp cannot handle any more.

Reproduction steps

Connect to a repository with pack files of size between 4.5 GB (working) and 5.56 GB (failing).
Iterate the commits of a branch or call a Diff.Compare on two Trees.

Expected behavior

Iterating the commit collection or comparing two trees works without exception.

Actual behavior

A LibGit2SharpException exception is thrown:

LibGit2Sharp.LibGit2SharpException
HResult=0x80131500
Message=invalid pack file - delta offset is zero
Source=LibGit2Sharp
StackTrace:
at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) in C:\projects\libgit2sharp\LibGit2Sharp\Core\Ensure.cs:line 154

Version of LibGit2Sharp (release number or SHA1)

0.26.2

Operating system(s) tested; .NET runtime tested

Win 10, .NET Framework 4.8

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、5.56 GB の pack ファイルを含むリポジトリで失敗を再現し、次に LibGit2Sharp/Core/Ensure.cs:154 の例外経路を調べます。コミットの反復処理と Diff.Compare の動作を 4.5 GB の正常動作するケースと比較します。両方の操作が無効な pack ファイル例外なしに完了すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
csharp, git
領域
devtools
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。