git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Crash on empty pickaxe argument

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Feb 17, 2025, 01:58 UTC
Message-ID
<Z7KX2y-dXaZuPrW4@tapette.crustytoothpaste.net>
In-Reply-To
<b59b75a1ad77f59cc8d81e2dd5cc9607e53b50af.camel@gmail.com>
On 2025-02-17 at 01:24:14, Jared Van Bortel wrote:
> Hi all,
Hi,
Show 19 quoted lines
> 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:

Thanks for the report. I agree this is a bug and we shouldn't crash. I think the right thing to do here is reject empty arguments since those aren't actually very useful, so I'm in the process of writing a patch to do that now, which I'll send out either later this evening or tomorrow, depending on when CI finishes running.

-- 
brian m. carlson (they/them or he/him)
Toronto, Ontario, CA
Previous: Jared Van BortelNext: brian m. carlson
Message 2 of 6 in “Crash on empty pickaxe argument”
  1. Jared Van BortelFeb 17, 2025
  2. brian m. carlsonFeb 17, 2025
  3. diff: don't crash with empty argument to -G or -Sbrian m. carlson, Feb 17, 2025
  4. Elijah NewrenFeb 17, 2025
  5. Junio C HamanoFeb 18, 2025
  6. brian m. carlsonFeb 18, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.