Access Violation on pushing to a new remote
まだ誰も着手していません。
評価
調査の方向性
Windows 10 上で .NET 6 を使用して、提供された push フローを再現し、repository.Network.Push とスタックトレースに示されている branch.IsTracking へのアクセスに焦点を当てる。Branch.ResolveTrackedBranch と git_branch_upstream_name の呼び出しを調査する。未追跡のローカルブランチがアクセス違反ではなく通常のエラーを生成すれば完了とする。
索引モデルが issue の本文から書いたものです。
説明
Reproduction steps
using var repository = new Repository(_options.LocalRepositoryPath);
const string message = "message";
var commitOptions = new CommitOptions()
{
AllowEmptyCommit = false,
PrettifyMessage = true,
};
var authorSignature = new Signature(_options.Username, _options.Email, DateTimeOffset.UtcNow);
await UpdateReadmeFile();
repository.Index.Add("readme.md");
repository.Index.Write();
Commands.Stage(repository, "*");
repository.Commit(message, authorSignature, authorSignature, commitOptions);
PushOptions pushOptions = new PushOptions()
{
CredentialsProvider = (_, __, ___) => new DefaultCredentials(),
};
_logger.LogInformation("Pushing changes to remote");
_logger.LogDebug($"Branch has been tracked: {branch.IsTracking}");
repository.Network.Push(branch, pushOptions);
Expected behavior
Another error should occur when the local branch is not being tracked. But not an access violation exception.
Actual behavior
This craches with:
Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Repeat 2 times:
--------------------------------
at LibGit2Sharp.Core.NativeMethods.git_branch_upstream_name(LibGit2Sharp.Core.Handles.GitBuf, LibGit2Sharp.Core.git_repository*, System.String)
--------------------------------
at LibGit2Sharp.Core.Proxy.git_branch_upstream_name(LibGit2Sharp.Core.Handles.RepositoryHandle, System.String)
at LibGit2Sharp.Branch.ResolveTrackedBranch()
at System.Lazy`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ViaFactory(System.Threading.LazyThreadSafetyMode)
at System.Lazy`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ExecutionAndPublication(System.LazyHelper, Boolean)
at System.Lazy`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].CreateValue()
at LibGit2Sharp.Branch.get_IsTracking()
Version of LibGit2Sharp (release number or SHA1)
Operating system(s) tested; .NET runtime tested
OS: Windows 10 Professional
.NET runtime: NET 6.0
- 主要言語
- C#
- スター
- 3.5k
- フォーク
- 925
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
libgit2/libgit2sharp のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
libgit2/libgit2sharp#2193 · コメント 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
libgit2/libgit2sharp#2192 · コメント 1 件 ·
-
Website is down オープン
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
libgit2/libgit2sharp#2191 · リアクション 2 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
libgit2/libgit2sharp#2189 · リアクション 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
libgit2/libgit2sharp#2187 · コメント 2 件 ·
libgit2/libgit2sharp の issue をすべて見る
似ている issue
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
sillsdev/languageforge-lexbox#2665 ·
-
bug documentation frontend
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
azurenoops/spin_agent#975 ·
-
:watch: Not Triaged 11.0 fundamentals/subsvc
難易度 2/5 1〜3時間 初心者へのやさしさ 92/100
dotnet/AspNetCore.Docs#37699 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
SubtitleEdit/subtitleedit#15108 · コメント 1 件 ·
-
area/docs-content Bug pulumi/docs
難易度 1/5 1〜3時間 初心者へのやさしさ 94/100