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

Segfault in git when using git logs

From
Sathyajith Bhat <sathya@sathyasays.com>
Date
Nov 2, 2020, 13:59 UTC
Message-ID
<CAMsWJsyPVQWV++gc2YJriEOEWBELa_xj2G0NWFMSgNYt47swiQ@mail.gmail.com>
Hi,

My code editor kept crashing repeatedly and when poked in syslogs, I found that git was segfaulting. I can repro this easily (steps below). This is the first time I'm reporting a bug here so I apologize if I've gotten anything wrong.

Below is the output from git bugreport

Thank you for filling out a Git bug report! Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)

Try to find commit logs for a file. I can repro this on a new repo as well as an existing repo.

Simple repro steps
        mkdir git_segfault_test && cd git_segfault_test && echo
"Hello" > hello.log
        git init && git add hello.log && git commit -m "init commit"
Now, use git log to show commit logs using command
        git log  --follow -L 1,1:hello.log -- hello.log

What did you expect to happen? (Expected behavior) Git should not segfault

What happened instead? (Actual behavior) Git segfaulted

What's different between what you expected and what actually happened?

Anything else you want to add: Note that I am not calling the git log commands directly, my editor VS Code was repeatedly crashing and I searched in syslog and found this error.

Please review the rest of the bug report below. You can delete any lines you don't wish to share.

[System Info] git version: git version 2.29.2 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Linux 5.9.2-arch1-1 #1 SMP PREEMPT Thu, 29 Oct 2020 17:01:28 +0000 x86_64 compiler info: gnuc: 10.2 libc info: glibc: 2.32 $SHELL (typically, interactive shell): /usr/bin/zsh

[Enabled Hooks]
 -- Sathya
http://sathyabh.at | http://sbhat.me
Author, Practical Docker with Python & AWS Community Hero
Next: Jeff King
Message 1 of 23 in “Segfault in git when using git logs”
  1. Sathyajith BhatNov 2, 2020
  2. Jeff KingNov 2, 2020
  3. Junio C HamanoNov 2, 2020
  4. SZEDER GáborNov 3, 2020
  5. Christian CouderNov 3, 2020
  6. Elijah NewrenNov 3, 2020
  7. Jeff KingNov 3, 2020
  8. Junio C HamanoNov 3, 2020
  9. Jeff KingNov 3, 2020
  10. Junio C HamanoNov 3, 2020
  11. Jeff KingNov 4, 2020
  12. Junio C HamanoNov 4, 2020
  13. Re*: Segfault in git when using git logsJunio C Hamano, Nov 4, 2020
  14. Jeff KingNov 4, 2020
  15. Junio C HamanoNov 4, 2020
  16. log: diagnose -L used with pathspec as an errorJunio C Hamano, Nov 4, 2020
  17. Jeff KingNov 4, 2020
  18. Derrick StoleeNov 3, 2020
  19. Sathyajith BhatNov 3, 2020
  20. Jeff KingNov 3, 2020
  21. Derrick StoleeNov 3, 2020
  22. Derrick StoleeNov 3, 2020
  23. Sathyajith BhatNov 4, 2020

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.