-
Notifications
You must be signed in to change notification settings - Fork 534
SIGSEGV in fillREFDeltaObjectContent #568
Comments
can you send us the commit of go-git are you using? |
It's v4 release cloned yesterday |
Please the commit, the v4 was updated yesterday |
I can reproduce it with the latest release 7aa9d15 |
I'm facing the same issue. It is caused by d.DecodeObjectAt returning (nil, nil) in this case. |
@mcuadros I am not the only one who runs go-git on "wrong" data now ;-) |
I did a bit more digging and found the place where nil, nil is returned in this case. And another place where the condition I don't have a clear understanding of the internals of go-git. My guess is that the fix is just replacing
with
Can somebody with a better understanding confirm that ? |
The problem is that this should not happen, if this object not exists, then is a malformed packfile. If we just return an error, then instead of a panic you will get a error, but the read of the packfile will be unsuccessful anyway. So the way to solve it, is see what's is happening with this packfile and if this packfile is supported by cgit, if it is, we should supported to. Based on what we know, a delta can't reference a object that hasn't been read previously. |
I use the following code
go run bug.go
:/Users/sourced/Projects/hercules
points to the decompressed archive I've attached: hercules-bug.tar.gzI get:
If I run
git gc
inside the repository, everything works properly and there are no segfaults.The text was updated successfully, but these errors were encountered: