git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git 2.46.0 crashes when trying to verify-pack outside of a repo
@ 2024-08-31  6:46 Ilya K
  2024-09-01 15:26 ` Junio C Hamano
  2024-09-04  6:26 ` [PATCH] builtin/index-pack: fix segfaults when running " Patrick Steinhardt
  0 siblings, 2 replies; 7+ messages in thread
From: Ilya K @ 2024-08-31  6:46 UTC (permalink / raw)
  To: git

Hello folks!

We've updated to Git 2.46.0 in NixOS, and encountered an issue with Dulwich (a Python Git implementation) tests failing[0] because it attempts to call `git verify-pack` on a bare pack, with no surrounding repo. This used to work in Git 2.45.x, but in 2.46 it simply prints "error: index-pack died of signal 11". This seems to happen on any pack, including ones generated by Git itself (at least on a random pack from a random checkout I tested).

Here's a traceback from the crash:

    (gdb) bt
    #0  0x00000000005d93ef in add_packed_git (
        path=path@entry=0x7dd8f0 "pack-a94057e69dcef307b749cd32232e845c48bb32c9.idx", path_len=45,
        local=local@entry=1) at packfile.c:754
    754             if (path_len < the_hash_algo->hexsz ||
    #1  0x000000000046bd38 in read_idx_option (
        pack_name=0x7dd8f0 "pack-a94057e69dcef307b749cd32232e845c48bb32c9.idx", opts=0x7fffffffcd00)
        at builtin/index-pack.c:1652
    1652            struct packed_git *p = add_packed_git(pack_name, strlen(pack_name), 1);
    #2  cmd_index_pack (argc=3, argv=<optimized out>, prefix=<optimized out>)
        at builtin/index-pack.c:1883
    1883                    read_idx_option(&opts, index_name);
    #3  0x000000000040651d in run_builtin (argv=0x7fffffffd270, argc=3, p=0x7a0560 <commands+1344>)
        at git.c:476
    476             status = p->fn(argc, argv, prefix);
    #4  handle_builtin (argc=3, argv=0x7fffffffd270) at git.c:732
    732                     exit(run_builtin(builtin, argc, argv));
    #5  0x0000000000407690 in run_argv (argcp=argcp@entry=0x7fffffffd04c,
        argv=argv@entry=0x7fffffffd040) at git.c:796
    796                             handle_builtin(*argcp, *argv);
    #6  0x000000000040812c in cmd_main (argc=<optimized out>, argc@entry=4, argv=<optimized out>,
        argv@entry=0x7fffffffd268) at git.c:931
    931                     int was_alias = run_argv(&argc, &argv);
    #7  0x00000000004061fd in main (argc=4, argv=0x7fffffffd268) at common-main.c:64
    64              result = cmd_main(argc, argv);

It seems like `the_hash_algo` (which, AFAIUI, is macroed to `the_repository->hash_algo`) may be uninitialized here, but I'm not familiar enough with the codebase to really tell if that's the issue.

If you want to reproduce it, simply copy any pack file from a repo's .git/objects/pack/ to a directory that's not a repo, then `git verify-pack <the-file-you-just-copied>`.

If you need any more information, please contact me.

Thanks in advance!

[0]: https://github.com/jelmer/dulwich/issues/1359


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

end of thread, other threads:[~2024-09-04  6:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-31  6:46 git 2.46.0 crashes when trying to verify-pack outside of a repo Ilya K
2024-09-01 15:26 ` Junio C Hamano
2024-09-01 23:45   ` Patrick Steinhardt
2024-09-02 13:18     ` brian m. carlson
2024-09-02 13:47       ` Patrick Steinhardt
2024-09-03 15:52         ` Junio C Hamano
2024-09-04  6:26 ` [PATCH] builtin/index-pack: fix segfaults when running " Patrick Steinhardt

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 NNTP newsgroup(s).