libgit2 / libgit2/libgit2sharp

Internal ArgumentNullException during Repository.Reset

Offen
#1,322 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
C#
Sterne
3.5k
Forks
925
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

We have a tool that regularly runs on a repository to migrate changes between several different repositories. As a part of the process, we do a soft reset of a submodule, which periodically (around one time per week) fails with an ArgumentNullException:

Unhandled Exception: System.ArgumentNullException: Value cannot be null.
Parameter name: SafeHandle cannot be null.
    mscorlib.dll!System.StubHelpers.StubHelpers.SafeHandleAddRef(System.Runtime.InteropServices.SafeHandle pHandle, ref bool success) Line 1664
    LibGit2Sharp.dll!LibGit2Sharp.Core.Proxy.git_reset(LibGit2Sharp.Core.Handles.RepositorySafeHandle repo, LibGit2Sharp.ObjectId committishId, LibGit2Sharp.ResetMode resetKind, ref LibGit2Sharp.Core.GitCheckoutOpts checkoutOptions) Line 2615
    LibGit2Sharp.dll!LibGit2Sharp.Repository.Reset(LibGit2Sharp.ResetMode resetMode, LibGit2Sharp.Commit commit, LibGit2Sharp.CheckoutOptions opts) Line 1002
    LibGit2Sharp.dll!LibGit2Sharp.Repository.Reset(LibGit2Sharp.ResetMode resetMode, LibGit2Sharp.Commit commit) Line 985

Unfortunately, I do not have a specific repo; every time this happens a rerun works properly again.

Version Consumed: 0.22. I'm not aware of this happening in an earlier version, but we had enough bugs in the tool itself that it's quite possible we never picked this up in the noise.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit Repository.Reset und dem im Stacktrace gezeigten Aufruf Proxy.git_reset unter Verwendung des gemeldeten LibGit2Sharp-0.22-Kontexts. Untersuche, wie das Repository-Handle und die Soft-Reset-Eingaben während Submodul-Resets übergeben werden; das Issue stellt kein reproduzierbares Repository bereit, daher setzt die Fertigstellung voraus, die intermittierende Ursache des Null-Handles zu isolieren und zu verifizieren, dass der Reset keine Exception mehr auslöst.

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
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.