From: Jared Van Bortel <cebtenzzre@gmail.com>
To: git@vger.kernel.org
Subject: Crash on empty pickaxe argument
Date: Sun, 16 Feb 2025 20:24:14 -0500 [thread overview]
Message-ID: <b59b75a1ad77f59cc8d81e2dd5cc9607e53b50af.camel@gmail.com> (raw)
Hi all,
I fat-fingered my enter key today and noticed this crash:
$ git --version
git version 2.48.1
$ mkdir foo && cd foo
$ git init
<snip>
$ git commit --allow-empty -m "foo"
[master (root-commit) ed4e080] foo
$ git log -S ""
BUG: diffcore-pickaxe.c:241: should have needle under -G or -S
[1] 65421 IOT instruction (core dumped) git log -S ""
$ git log -G ""
BUG: diffcore-pickaxe.c:241: should have needle under -G or -S
[1] 65457 IOT instruction (core dumped) git log -G ""
Well, it says BUG right there. It probably shouldn't crash. Relevant
backtrace for -S:
#3 0x00007ffff7ce7582 in __GI_abort () at abort.c:73
#4 0x00005555558689aa in BUG_vfl (file=<optimized out>, line=<optimized out>, fmt=0x5555558ed498 "should have needle under -G or -S", params=0x7fffffffbf70)
at /usr/src/debug/git/git-2.48.1/usage.c:318
#5 BUG_fl (file=<optimized out>, line=<optimized out>, fmt=0x5555558ed498 "should have needle under -G or -S") at /usr/src/debug/git/git-2.48.1/usage.c:335
#6 0x000055555571527f in diffcore_pickaxe (o=0x7fffffffca90) at /usr/src/debug/git/git-2.48.1/diffcore-pickaxe.c:241
#7 diffcore_std (options=0x7fffffffca90) at /usr/src/debug/git/git-2.48.1/diff.c:7079
#8 0x00005555558b2788 in log_tree_diff_flush.isra.0 (opt=0x7fffffffc4d0) at /usr/src/debug/git/git-2.48.1/log-tree.c:929
#9 0x000055555574b2e4 in log_tree_diff (opt=0x7fffffffc4d0, commit=0x5555559b7b80, log=0x7fffffffc300) at /usr/src/debug/git/git-2.48.1/log-tree.c:1120
#10 log_tree_commit (opt=0x7fffffffc4d0, commit=0x5555559b7b80) at /usr/src/debug/git/git-2.48.1/log-tree.c:1188
#11 0x00005555555e68c8 in cmd_log_walk_no_free (rev=<optimized out>) at builtin/log.c:528
#12 cmd_log_walk_no_free (rev=rev@entry=0x7fffffffc4d0) at builtin/log.c:506
#13 0x00005555555e74bf in cmd_log_walk (rev=0x7fffffffc4d0) at builtin/log.c:569
#14 cmd_log (argc=3, argv=0x5555559b0790, prefix=0x0, repo=<optimized out>) at builtin/log.c:950
#15 0x000055555555e56c in run_builtin (p=0x555555977f40 <commands.lto_priv+1440>, argc=<optimized out>, argv=<optimized out>, repo=0x555555986d40 <the_repo.lto_priv>)
at /usr/src/debug/git/git-2.48.1/git.c:480
#16 handle_builtin (args=args@entry=0x7fffffffd4a0) at /usr/src/debug/git/git-2.48.1/git.c:740
#17 0x000055555555ec34 in run_argv (args=0x7fffffffd4a0) at /usr/src/debug/git/git-2.48.1/git.c:807
#18 0x00005555555598a1 in cmd_main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/git/git-2.48.1/git.c:947
#19 main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/git/git-2.48.1/common-main.c:64
Thanks,
Jared
next reply other threads:[~2025-02-17 1:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-17 1:24 Jared Van Bortel [this message]
2025-02-17 1:58 ` Crash on empty pickaxe argument brian m. carlson
2025-02-17 17:57 ` [PATCH] diff: don't crash with empty argument to -G or -S brian m. carlson
2025-02-17 22:18 ` Elijah Newren
2025-02-18 18:16 ` Junio C Hamano
2025-02-18 19:29 ` brian m. carlson
-- strict thread matches above, loose matches on Subject: below --
2025-02-17 3:08 Crash on empty pickaxe argument deeina1208
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b59b75a1ad77f59cc8d81e2dd5cc9607e53b50af.camel@gmail.com \
--to=cebtenzzre@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).