git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* git bundle verify segfaults
@ 2019-05-24 17:48 Konstantin Ryabitsev
  2019-05-24 18:49 ` SZEDER Gábor
  0 siblings, 1 reply; 2+ messages in thread
From: Konstantin Ryabitsev @ 2019-05-24 17:48 UTC (permalink / raw)
  To: git

Hello:

I seem to be getting a segfault trying to verify bundles created from 
linux.git. It's easy to reproduce:

$ cd linux
$ git show-ref master
c50bbf615f2f0028ad1771506ef8807130ccc2ce refs/heads/master
$ git bundle create /tmp/linux.bundle master
Enumerating objects: 6705678, done.
Counting objects: 100% (6705678/6705678), done.
Delta compression using up to 8 threads
Compressing objects: 100% (1037089/1037089), done.
Writing objects: 100% (6705678/6705678), 1.19 GiB | 97.81 MiB/s, done.
Total 6705678 (delta 5657955), reused 6664576 (delta 5622679)
$ cd /tmp
$ git bundle verify linux.bundle
BUG: refs.c:1750: attempting to get main_ref_store outside of repository
Aborted (core dumped)
$ git --version
git version 2.21.0

Best,
-K

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: git bundle verify segfaults
  2019-05-24 17:48 git bundle verify segfaults Konstantin Ryabitsev
@ 2019-05-24 18:49 ` SZEDER Gábor
  0 siblings, 0 replies; 2+ messages in thread
From: SZEDER Gábor @ 2019-05-24 18:49 UTC (permalink / raw)
  To: git; +Cc: Jeff King

On Fri, May 24, 2019 at 01:48:35PM -0400, Konstantin Ryabitsev wrote:
> I seem to be getting a segfault trying to verify bundles created from
> linux.git. It's easy to reproduce:
> 
> $ cd linux
> $ git show-ref master
> c50bbf615f2f0028ad1771506ef8807130ccc2ce refs/heads/master
> $ git bundle create /tmp/linux.bundle master
> Enumerating objects: 6705678, done.
> Counting objects: 100% (6705678/6705678), done.
> Delta compression using up to 8 threads
> Compressing objects: 100% (1037089/1037089), done.
> Writing objects: 100% (6705678/6705678), 1.19 GiB | 97.81 MiB/s, done.
> Total 6705678 (delta 5657955), reused 6664576 (delta 5622679)
> $ cd /tmp
> $ git bundle verify linux.bundle
> BUG: refs.c:1750: attempting to get main_ref_store outside of repository
> Aborted (core dumped)

'git bundle verify' needs a repository to check "that the prerequisite
commits exist and are fully linked in the current repository" (quoting
its manpage).  I presume your '/tmp' is not a git repository, so Git
complains, though it definitely shouldn't just BUG(), but rather say
"fatal: not a git repository (or any of the parent directories): .git"
instead.

However, if the bundle is self-contained (like the one you created
above), then there are no prerequisite commits to check, and a
repository is not strictly necessary to verify the bundle's integrity,
so 'git bundle verify' could actually get the job done even outside of
a repository.  And it used to work until commit b1ef400eec
(setup_git_env: avoid blind fall-back to ".git", 2016-10-20), so I add
Peff to Cc...



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-24 18:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-24 17:48 git bundle verify segfaults Konstantin Ryabitsev
2019-05-24 18:49 ` SZEDER Gábor

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).