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

bug: Segfault with git diff

From
JRjake roggenbuck <roggenbuckjake@gmail.com>
Date
May 19, 2024, 03:02 UTC
Message-ID
<CAEUC8gmgq_yViedLGHOeSyvR9rQK+O-8Fh9wzds=2+326ngUjw@mail.gmail.com>
> Thank you for filling out a Git bug report!
> Please answer the following questions to help us understand your issue.
I have found a segfault when running git diff.
> What did you do before the bug happened? (Steps to reproduce your issue)
1. After running `git diff`, git showed me that object files were empty.
2. I deleted the empty object files, and ran `git diff` again.
3. I continued deleting the empty files until `git diff` segfaulted.
> What did you expect to happen? (Expected behavior)
An error message of some type or a graceful exit.
> What happened instead? (Actual behavior)
A segmentation fault.
`Segmentation fault (core dumped)`
> What's different between what you expected and what actually happened?
Instead of closing gracefully, there was a segmentation fault.
> Anything else you want to add:

git log displays: fatal: bad object HEAD

git branch displays: fatal: missing object 7610511b1b4db888e8e6bb8d0ff158f932961345 for refs/heads/main

Neither log nor branch causes the segfault.

[System Info] git version: git version 2.45.1 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Linux 6.7.3-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 01 Feb 2024 10:30:35 +0000 x86_64 compiler info: gnuc: 14.1 libc info: glibc: 2.39 $SHELL (typically, interactive shell): /bin/bash

[Enabled Hooks]

Best, Jake Roggenbuck

Next: Jake Roggenbuck
Message 1 of 7 in “bug: Segfault with git diff”
  1. jake roggenbuckMay 19, 2024
  2. 0/1 Exit on invalid diff status of diff_filepairJake Roggenbuck, Jan 8, 2025
  3. 1/1 Exit on invalid diff status of diff_filepairJake Roggenbuck, Jan 8, 2025
  4. Jake RoggenbuckApr 30, 2025
  5. Jake RoggenbuckApr 30, 2025
  6. Eric SunshineMay 1, 2025
  7. Junio C HamanoMay 1, 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.