libgit2 / libgit2/libgit2sharp

"Error reading from the zlib stream"-Exception on Fetch/ Clone/ Push with custom transport

Ouverte
#1,594 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Langage dominant
C#
Étoiles
3.5k
Forks
925
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

I wrote a custom smarttransport according to a ssh sample. After fetch, pull or clone I get valid data but the method throws LibGit2Sharp Exception with "error reading from the zlib stream".

Transport with upload-pack read->write->read->write works, see dump below.

The error message: "error reading from the zlib stream" occurs in libgit2 within pack.c in method git_packfile_stream_read() after calling inflate(&obj->zstream, Z_SYNC_FLUSH); Error will be called if the result is !=Z_OK && !=Z_STREAM_END.
After setting pack.compression=0 the zlib stream contains uncompressed data. But the error message is still there.

STDIN/ STDOU

READ:

00fc5daa747d4ca7905ff8996f770ef74d1b894be3d2 HEAD multi_ack thin-pack side-band side-band-64k ofs-delta shallow deepen-since deepen-not deepen-relative no-progress include-tag multi_ack_detailed symref=HEAD:refs/heads/master agent=git/2.18.0.windows.1 003f5daa747d4ca7905ff8996f770ef74d1b894be3d2 refs/heads/master 003e5daa747d4ca7905ff8996f770ef74d1b894be3d2 refs/heads/test2 0000

WRITE:

0074want 5daa747d4ca7905ff8996f770ef74d1b894be3d2 multi_ack_detailed side-band-64k include-tag thin-pack ofs-delta 0032want 5daa747d4ca7905ff8996f770ef74d1b894be3d2 00000009done

READ:

0008NAK 0023Enumerating objects: 9, done. Counting objects: 100% (9/9), done. Compressing objects: 100% (6/6), done. 002bTotal 9 (delta 0), reused 0 (delta 0) 02e7PACK òx£ì-1-0 +=»+ÄälºNc !6Ìß$NAé+­x-m763[AÁ+sª$C+!7eì[å$í¦Àn÷^A&ã:Cÿ+-T#&Ö+BfàªäëKê+Úg_·µ»}+²i¨yi·¦Ò+ï«gÅÉä+Ç \Ú¤þ}¹©]ks_.k8¬òx£ì-=-0@ß=º+ÄäþºÄäþpº ZéZszûÀ}z¦ëÏ\KpêÈUqòÉk+=-Ç U8O àú¨­&oÁëÿ=óª=d+AÊ4qóÏÇ:+ã-áß»>ãf´cÌÝe>zٳƾ2*/WÙó?«ô-hOÇ
ªÄu}¬- -¿ýj~Ç@9[ÿ

x£ì-1-0@Ð=º­ÄäLLöTBê¡þpmÀDñDj-²¦#¦³7}¯¦@°nël8eÔR-ª¿ëSûY'UM%IÓƒ+¹c_vx,g_3ý+¦p{--ûé4d©DÊÎÁ¦¦ G¿¯Ûò[8 Ë-õ¿x£343 ¢Éd¸¦åîUFzÜ--£+²Ê½2.Þr³ê]ÙdhfbóPöÜÿÆø¬WRQ-ã»Ã¤J¦_Ðß¾ØKMº¥à
3Sã¦x£-¦-,+L¦QH+¤--,I,NIa.-à-3©îí+ §Ó-¿x£343
¢Éd¸¦åîUFzÜ--£+²Ê½2.Þr³ê]ÙdhfbóPöÜÿÆø¬WRQ-­=âìBnï§+=ƒ º=¦|[c N+ô¦x£-¦-,+L¦QH+¤--,I,NIa.-ò +®*ªx£340031Q(JML+Mi+®(a+§u¦sQ?-§î¦O´¢¹¦,²Û+. H>x£-¦-,+L¦QH+¤--, )-öP¸ãyô

WRITE:

0000

Exception

An unhandled exception of type 'LibGit2Sharp.LibGit2SharpException' occurred in LibGit2Sharp.dll
Additional information: error reading from the zlib stream

Callstack

bei LibGit2Sharp.Core.Ensure.HandleError(Int32 result) in C:\projects\libgit2sharp\LibGit2Sharp\Core\Ensure.cs:Zeile 136. bei LibGit2Sharp.Core.Proxy.git_remote_fetch(RemoteHandle remote, IEnumerable1 refSpecs, GitFetchOptions fetchOptions, String
logMessage) in
C:\projects\libgit2sharp\LibGit2Sharp\Core\Proxy.cs:Zeile 2268. bei
LibGit2Sharp.Commands.Fetch(Repository repository, String remote,
IEnumerable1 refspecs, FetchOptions options, String logMessage) in C:\projects\libgit2sharp\LibGit2Sharp\Commands\Fetch.cs:Zeile 76.
bei GitFunction.Test.Beta2.button1_Click(Object sender, EventArgs e) in C:\TFS\DS\ThomasZ\BeckhoffGitAdsService\GitAdsServicePackage\GitFunction.Test\Beta2.cs:Zeile 62. bei System.Windows.Forms.Control.OnClick(EventArgs e) bei System.Windows.Forms.Button.OnClick(EventArgs e) bei System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) bei System.Windows.Forms.Control.WndProc(Message& m) bei System.Windows.Forms.ButtonBase.WndProc(Message& m) bei System.Windows.Forms.Button.WndProc(Message& m) bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData) bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) bei System.Windows.Forms.Application.Run(Form mainForm) bei GitFunction.Test.Program.Main() in C:\TFS\DS\ThomasZ\BeckhoffGitAdsService\GitAdsServicePackage\GitFunction.Test\Program.cs:Zeile 19. bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) bei System.Threading.ThreadHelper.ThreadStart()

Versions
LibGit2Sharp 0.24.0.0
LibGit2Sharp 0.25.0.0 with VS 2017 and .Net Standard 2.0
git version 2.18.0.windows.1
Win 10 x64
.Net 4.5

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par la séquence de lecture/écriture de custom smarttransport upload-pack et comparez les paquets capturés et la sortie du pack avec le chemin de fetch se terminant par Proxy.git_remote_fetch. Examinez ensuite git_packfile_stream_read() dans pack.c de libgit2 autour de inflate(..., Z_SYNC_FLUSH), en utilisant les versions de LibGit2Sharp et de Git indiquées. Le travail est considéré comme terminé lorsque fetch, clone ou push s’achève sans l’exception zlib tout en préservant les données reçues valides.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
csharp, git
Domaine
devtools, networking
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
30/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.