libgit2 / libgit2/libgit2sharp
System.AccessViolationException on CherryPick
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C#
- Sterne
- 3.5k
- Forks
- 925
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginnen Sie mit der bereitgestellten C#-Reproduktion von Download und GetLatestVersion, insbesondere mit dem Aufruf von repo.CherryPick, unter Verwendung von LibGit2Sharp 0.26.2 auf Windows 10 x64 mit .NET 5. Verfolgen Sie die Ausführung von CherryPick von diesem Einstiegspunkt aus und überprüfen Sie, dass die Zugriffsverletzung nicht mehr auftritt und der markierte Commit wie erwartet cherrypicked wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- csharp, git
- Bereich
- devtools
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100