"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: Corruption in freshly checked out tree
To:
Christian Weisgerber <naddy@mips.inka.de>
Cc:
gameoftrees@openbsd.org
Date:
Sun, 9 Jan 2022 20:43:57 +0100

Download raw body.

Thread
On Sun, Jan 09, 2022 at 07:49:28PM +0100, Christian Weisgerber wrote:
> Repository:
> 
> ------------------->
> [core]
>         repositoryformatversion = 0
>         filemode = true
>         bare = true
> [remote "origin"]
>         url = https://github.com/openbsd/src.git
>         fetch = +refs/heads/master:refs/heads/master
> [http "https://github.com/"]
>         pinnedpubkey = sha256//7zwAM/YU+zd8BZMCl0J943URuyF35zefKC7QIoxTq+U=
> <-------------------
> 
> I checked out a src tree, and when I tried to compile a kernel,
> I encountered corrupted file content.
> 
> Specifically, the first 1132 bytes of
> 
>   sys/dev/pci/drm/amd/include/asic_reg/gc/gc_9_0_sh_mask.h
>   sys/dev/pci/drm/amd/include/asic_reg/gc/gc_9_2_1_sh_mask.h

The blob IDs I see for these files are:

efc16ddf274a33f9b31bf264a17b52fca098257f gc_9_0_sh_mask.h
6199fce51e205b4871bfc01e602f7106a23c4439 gc_9_2_1_sh_mask.h

> are overwritten with the start of
> 
>   gnu/usr.bin/perl/lib/unicore/TestProp.pl
> 
> Well, the first line reads
> 
> # !!!!!!!   DO NOT EDIT7THIS FILE   !!!!!!!
> 
> with an erroneous '7', so even the corruption is corrupted.
> 
> I used "got tree -i" to get the blob IDs for the two files, and
> "got cat <hash>" shows what looks like correct content.
> 
> However, "got blame" fails:  got: value out of range
> 
> I checked out another copy of the tree from the repository, and it
> shows the same corruption.
> 
> got 0.65-current, as of commit 0f71f6196dbf9f3afd34524586b8bfdb2d1eaccd.
> Oh, hmm, that would be got 0.66-current, but I forgot a "make clean",
> and there's no dependency on got-version.mk.

Files in my existing checkout are fine. I tried the following in order
to reproduce: got co -p sys/dev/pci/drm/amd/include/asic_reg /git/src.git/
The files check out fine. I tried this with both my existing src.git copy
and with a fresh clone from github (fetched with 'got clone' over ssh).

There could be pack file with bad deltas in your repository which
lead to corrupt file content when unpacked.

It is possible that copies of an object exist in multiple pack files.
This could explain why some commands work for you and others do not,
depending on which pack file ended up at the front of the list of
cached packs due to pack access behaviour of the running code.
So perhaps 'got cat' finds the object in a good pack file, and
'got checkout' finds it in a bad pack file and that leads to corruption?

Does 'git fsck' complain about anything?
Did you ever run 'gotadmin pack' on this repository?