libgit2 / libgit2/libgit2sharp

System.AccessViolationException on CherryPick

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

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

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

説明

You are opening a bug report against the LibGit2Sharp project: we
use GitHub Issues for tracking bug reports and feature requests. If
you have a question about an API or usage, please ask on StackOverflow:
http://stackoverflow.com/questions/tagged/libgit2sharp.

Otherwise, to report a bug, please fill out the reproduction steps
(below) and delete these introductory paragraphs. Thanks!

Reproduction steps
public static void Main(string[] args) {
    Download();
}

public static Tag GetLatestVersion()
{
    using Repository repo = new("./");
    return repo.Tags
        // Order by version: 2.0.0, 1.2.0, 1.0.0, etc
        .OrderByDescending(tag => tag.FriendlyName)
        // Gets latest tag
        .First();
}

public static void Download()
{
    using Repository repo = new("./");
    Tag latestTag = GetLatestVersion();
    CherryPickOptions cherryPickOptions = new();
    cherryPickOptions.FailOnConflict = false;
    cherryPickOptions.FileConflictStrategy = CheckoutFileConflictStrategy.Theirs;
    cherryPickOptions.FindRenames = true;
    cherryPickOptions.IgnoreWhitespaceChange = false;
    repo.CherryPick((Commit)latestTag.Target, new Signature(Program.Config.Update.GitName, Program.Config.Update.GitEmail, DateTimeOffset.Now), cherryPickOptions);
}
Expected behavior

Specific commit from tag to be cherrypicked

Actual behavior

System.AccessViolationException exception thrown. Message:

An unhandled exception of type 'System.AccessViolationException' occurred in LibGit2Sharp.dll:
'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'
<Cannot evaluate the exception stack trace>
Version of LibGit2Sharp (release number or SHA1)

0.26.2 (Nuget)

Operating system(s) tested; .NET runtime tested

Windows 10 64bit; Dotnet 5.0.202

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

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

はじめの一歩

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

調査の方向性

C# で提供されている Download と GetLatestVersion の再現コードから、特に repo.CherryPick の呼び出しから始め、Windows 10 x64 上で .NET 5 と LibGit2Sharp 0.26.2 を使用します。このエントリーポイントから CherryPick の実行を追跡し、access violation が発生しなくなったことと、タグ付けされた commit が期待どおりに cherrypick されることを確認してください。

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

評価

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

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

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