src-d/borges

Some repositories fail with "invalid delta"

Closed this issue · 3 comments

Examples:

  • git://github.com/ferzkopp/SDL
  • git://github.com/bilderbuchi/openFrameworks
  • git://github.com/line55/openFrameworks
{"endpoint":"git://github.com/ferzkopp/SDL","error":"invalid delta","job":"01637e9a-45db-3805-5b9a-879de28d2d03","level":"error","msg":"error pushing one change for","refs":["+refs/heads/HEAD:refs/heads/HEAD/01637e9a-45db-3805-5b9a-879de28d2d03","+refs/heads/master:refs/heads/master/01637e9a-45db-3805-5b9a-879de28d2d03","+refs/tags/pre-touch-removal:refs/tags/pre-touch-removal/01637e9a-45db-3805-5b9a-879de28d2d03","+refs/tags/release-1.2.1:refs/tags/release-1.2.1/01637e9a-45db-3805-5b9a-879de28d2d03","+refs/tags/release-1.2.10:refs/tags/release-1.2.10/01637e9a-45db-3805-5b9a-879de28d2d03","+refs/tags/release-1.2.11:refs/tags/release-1.2.11/01637e9a-45db-3805-5b9a-879de28d2d03","+refs/tags/release-1.2.12:refs/tags/release-1.2.12/01637e9a-45db-3805-5b9a-879de28d2d03","+refs/tags/release-1.2.13:refs/tags/release-1.2.13/01637e9a-45db-3805-5b9a-879de28d2d03","+refs/tags/release-1.2.14:refs/tags/release-1.2.14/01637e9a-45db-3805-5b9a-879de28d2d03","+refs/tags/release-1.2.15:refs/tags/release-1.2.15/01637e9a-45db-3805-5b9a-879de28d2d03","+refs/tags/release-1.2.2:refs/tags/release-1.2.2/01637e9a-45db-3805-5b9a-879de28d2d03","+refs/tags/release-1.2.3:refs/tags/release-1.2.3/01637e9a-45db-3805-5b9a-879de28d2d03","+refs/tags/release-1.2.4:refs/tags/release-1.2.4/01637e9a-45db-3805-5b9a-879de28d2d03","+refs/tags/release-1.2.5:refs/tags/release-1.2.5/01637e9a-45db-3805-5b9a-879de28d2d03","+refs/tags/release-1.2.6:refs/tags/release-1.2.6/01637e9a-45db-3805-5b9a-879de28d2d03","+refs/tags/release-1.2.7:refs/tags/release-1.2.7/01637e9a-45db-3805-5b9a-879de28d2d03","+refs/tags/release-1.2.8:refs/tags/release-1.2.8/01637e9a-45db-3805-5b9a-879de28d2d03","+refs/tags/release-1.2.9:refs/tags/release-1.2.9/01637e9a-45db-3805-5b9a-879de28d2d03"],"root":"2f110628a7db223ebe9b7985af389d00779ff273","source":"go-log.v1/logger.go:37","time":"2018-05-21T00:00:18.252663394Z","took":229}
{"endpoint":"git://github.com/ferzkopp/SDL","error":"push to rooted repo 2f110628a7db223ebe9b7985af389d00779ff273 failed: invalid delta","job":"01637e9a-45db-3805-5b9a-879de28d2d03","level":"error","msg":"error pushing changes to rooted repository","root":"2f110628a7db223ebe9b7985af389d00779ff273","source":"go-log.v1/logger.go:37","time":"2018-05-21T00:00:18.253103652Z"}
{"endpoint":"git://github.com/bilderbuchi/openFrameworks","error":"invalid delta","job":"01637ec9-76fb-42aa-f140-5038bba75958","level":"error","msg":"error pushing one change for","refs":["+refs/heads/HEAD:refs/heads/HEAD/01637ec9-76fb-42aa-f140-5038bba75958","+refs/heads/fix-2791:refs/heads/fix-2791/01637ec9-76fb-42aa-f140-5038bba75958","+refs/heads/master:refs/heads/master/01637ec9-76fb-42aa-f140-5038bba75958","+refs/heads/master-ci:refs/heads/master-ci/01637ec9-76fb-42aa-f140-5038bba75958","+refs/heads/new-oscpack:refs/heads/new-oscpack/01637ec9-76fb-42aa-f140-5038bba75958","+refs/heads/reorganize-dev-scripts:refs/heads/reorganize-dev-scripts/01637ec9-76fb-42aa-f140-5038bba75958","+refs/heads/stable:refs/heads/stable/01637ec9-76fb-42aa-f140-5038bba75958","+refs/heads/testbranch-CI:refs/heads/testbranch-CI/01637ec9-76fb-42aa-f140-5038bba75958","+refs/heads/travis-3:refs/heads/travis-3/01637ec9-76fb-42aa-f140-5038bba75958","+refs/heads/travis-4:refs/heads/travis-4/01637ec9-76fb-42aa-f140-5038bba75958","+refs/heads/travis-5:refs/heads/travis-5/01637ec9-76fb-42aa-f140-5038bba75958","+refs/heads/travis-multios:refs/heads/travis-multios/01637ec9-76fb-42aa-f140-5038bba75958","+refs/pull/1/head:refs/pull/1/head/01637ec9-76fb-42aa-f140-5038bba75958","+refs/pull/1/merge:refs/pull/1/merge/01637ec9-76fb-42aa-f140-5038bba75958","+refs/pull/2/head:refs/pull/2/head/01637ec9-76fb-42aa-f140-5038bba75958","+refs/pull/2/merge:refs/pull/2/merge/01637ec9-76fb-42aa-f140-5038bba75958","+refs/pull/3/head:refs/pull/3/head/01637ec9-76fb-42aa-f140-5038bba75958","+refs/pull/3/merge:refs/pull/3/merge/01637ec9-76fb-42aa-f140-5038bba75958","+refs/pull/4/head:refs/pull/4/head/01637ec9-76fb-42aa-f140-5038bba75958","+refs/pull/4/merge:refs/pull/4/merge/01637ec9-76fb-42aa-f140-5038bba75958","+refs/pull/5/head:refs/pull/5/head/01637ec9-76fb-42aa-f140-5038bba75958","+refs/pull/6/head:refs/pull/6/head/01637ec9-76fb-42aa-f140-5038bba75958","+refs/tags/0.7.4:refs/tags/0.7.4/01637ec9-76fb-42aa-f140-5038bba75958","+refs/tags/0.8.0:refs/tags/0.8.0/01637ec9-76fb-42aa-f140-5038bba75958","+refs/tags/0.8.1:refs/tags/0.8.1/01637ec9-76fb-42aa-f140-5038bba75958","+refs/tags/0.8.2:refs/tags/0.8.2/01637ec9-76fb-42aa-f140-5038bba75958","+refs/tags/0.8.3:refs/tags/0.8.3/01637ec9-76fb-42aa-f140-5038bba75958","+refs/tags/0.8.4:refs/tags/0.8.4/01637ec9-76fb-42aa-f140-5038bba75958","+refs/tags/0.9.0:refs/tags/0.9.0/01637ec9-76fb-42aa-f140-5038bba75958","+refs/tags/0061:refs/tags/0061/01637ec9-76fb-42aa-f140-5038bba75958","+refs/tags/0062:refs/tags/0062/01637ec9-76fb-42aa-f140-5038bba75958","+refs/tags/007:refs/tags/007/01637ec9-76fb-42aa-f140-5038bba75958","+refs/tags/0071:refs/tags/0071/01637ec9-76fb-42aa-f140-5038bba75958","+refs/tags/0072:refs/tags/0072/01637ec9-76fb-42aa-f140-5038bba75958","+refs/tags/0073:refs/tags/0073/01637ec9-76fb-42aa-f140-5038bba75958"],"root":"e0dd474783ea472fa3412e96768227f3a6b063ee","source":"go-log.v1/logger.go:37","time":"2018-05-21T01:58:34.18165262Z","took":1863}
{"endpoint":"git://github.com/bilderbuchi/openFrameworks","error":"push to rooted repo e0dd474783ea472fa3412e96768227f3a6b063ee failed: invalid delta","job":"01637ec9-76fb-42aa-f140-5038bba75958","level":"error","msg":"error pushing changes to rooted repository","root":"e0dd474783ea472fa3412e96768227f3a6b063ee","source":"go-log.v1/logger.go:37","time":"2018-05-21T01:58:34.182001705Z"}
{"endpoint":"git://github.com/line55/openFrameworks","error":"invalid delta","job":"01637f42-05c5-90d4-becd-c40c94938985","level":"error","msg":"error pushing one change for","refs":["+refs/heads/0061:refs/heads/0061/01637f42-05c5-90d4-becd-c40c94938985","+refs/heads/0062:refs/heads/0062/01637f42-05c5-90d4-becd-c40c94938985","+refs/heads/0062Release:refs/heads/0062Release/01637f42-05c5-90d4-becd-c40c94938985","+refs/heads/0062_features:refs/heads/0062_features/01637f42-05c5-90d4-becd-c40c94938985","+refs/heads/HEAD:refs/heads/HEAD/01637f42-05c5-90d4-becd-c40c94938985","+refs/heads/arturoc-swappable_renderers:refs/heads/arturoc-swappable_renderers/01637f42-05c5-90d4-becd-c40c94938985","+refs/heads/define_cleaning:refs/heads/define_cleaning/01637f42-05c5-90d4-becd-c40c94938985","+refs/heads/development:refs/heads/development/01637f42-05c5-90d4-becd-c40c94938985","+refs/heads/dragAndDrop:refs/heads/dragAndDrop/01637f42-05c5-90d4-becd-c40c94938985","+refs/heads/iphone-dev-0061:refs/heads/iphone-dev-0061/01637f42-05c5-90d4-becd-c40c94938985","+refs/heads/master:refs/heads/master/01637f42-05c5-90d4-becd-c40c94938985","+refs/heads/memoNewStyle:refs/heads/memoNewStyle/01637f42-05c5-90d4-becd-c40c94938985","+refs/heads/pez:refs/heads/pez/01637f42-05c5-90d4-becd-c40c94938985","+refs/heads/removingOfPixels:refs/heads/removingOfPixels/01637f42-05c5-90d4-becd-c40c94938985","+refs/heads/smartofPixels:refs/heads/smartofPixels/01637f42-05c5-90d4-becd-c40c94938985","+refs/heads/smartvideopointers:refs/heads/smartvideopointers/01637f42-05c5-90d4-becd-c40c94938985","+refs/heads/soundcleanup:refs/heads/soundcleanup/01637f42-05c5-90d4-becd-c40c94938985","+refs/heads/swappable:refs/heads/swappable/01637f42-05c5-90d4-becd-c40c94938985","+refs/heads/threadAndUrlWork:refs/heads/threadAndUrlWork/01637f42-05c5-90d4-becd-c40c94938985","+refs/heads/unstable:refs/heads/unstable/01637f42-05c5-90d4-becd-c40c94938985","+refs/pull/1/head:refs/pull/1/head/01637f42-05c5-90d4-becd-c40c94938985","+refs/pull/2/head:refs/pull/2/head/01637f42-05c5-90d4-becd-c40c94938985","+refs/pull/3/head:refs/pull/3/head/01637f42-05c5-90d4-becd-c40c94938985","+refs/pull/3/merge:refs/pull/3/merge/01637f42-05c5-90d4-becd-c40c94938985","+refs/pull/4/head:refs/pull/4/head/01637f42-05c5-90d4-becd-c40c94938985"],"root":"e0dd474783ea472fa3412e96768227f3a6b063ee","source":"go-log.v1/logger.go:37","time":"2018-05-21T05:35:13.295694608Z","took":3112}
{"endpoint":"git://github.com/line55/openFrameworks","error":"push to rooted repo e0dd474783ea472fa3412e96768227f3a6b063ee failed: invalid delta","job":"01637f42-05c5-90d4-becd-c40c94938985","level":"error","msg":"error pushing changes to rooted repository","root":"e0dd474783ea472fa3412e96768227f3a6b063ee","source":"go-log.v1/logger.go:37","time":"2018-05-21T05:35:13.296109316Z"}

The delta that fails in git://github.com/ferzkopp/SDL is because in PatchDelta the size to copy from src is bigger than the remaining size, and since it's an unsigned int overflows. Converting it to int64 does the trick to stop the error, but the packfile generated is not valid according to git verify-pack

error: delta replay has gone wild
fatal: pack has bad object at offset 14041249: failed to apply delta
objects/pack/pack-42e321fccc781f1c221725a6bf2b6d7e9f9e68c4.pack: bad

This is the minimal reproduction case I could find with the src and the delta that caused the error: https://github.com/erizocosmico/go-git-invalid-delta

This issue should be fixed updating go-git version.

With new version of go-git (4.4.1) I cannot reproduce it