libgit2 / libgit2/libgit2sharp

System.AccessViolationException on CherryPick

Aperta
#1,883 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
C#
Stelle
3.5k
Fork
925
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con la riproduzione fornita in C# di Download e GetLatestVersion, in particolare con la chiamata a repo.CherryPick, usando LibGit2Sharp 0.26.2 su Windows 10 x64 con .NET 5. Traccia l’esecuzione di CherryPick da questo punto di ingresso e verifica che l’access violation non si verifichi più e che il commit contrassegnato venga cherrypickato come previsto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
csharp, git
Ambito
devtools
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.