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

git log --graph --no-graph can cause segfault

From
Emily Klassen <forivall@gmail.com>
Date
Feb 8, 2025, 03:34 UTC
Message-ID
<CADY4h_qagYhSP2kz=zNSjfskN1ODxLf1DjEME6BdYw6j-JEAhA@mail.gmail.com>
> What did you do before the bug happened? (Steps to reproduce your issue)

$ git config --get alias.l log --pretty=oneline --abbrev-commit --decorate --graph

$ git --no-pager l --reverse --no-graph --name-status e83c516331 Initial revision of "git", the information manager from hell error: git died of signal 11

> What did you expect to happen? (Expected behavior)
I expect the commit listing to display successfully.
> What happened instead? (Actual behavior)

Git seems to have crashed. My best guess is that some state gets set with the first `--graph` flag which is not cleared with the `--no-graph` flag.

> What's different between what you expected and what actually happened?
Git crashed.
> Anything else you want to add:
I also tried to manually expand the alias with

$ git --no-pager log --pretty=oneline --abbrev-commit --decorate --graph HEAD --reverse --no-graph --name-status e83c516331 Initial revision of "git", the information manager from hell

$ echo $? 139

Which indicates a segfault.
The below command works properly

$ git log --pretty=oneline --abbrev-commit --decorate HEAD --reverse --name-status

but obviously, the intent is to be able to use my `l` alias with the `--reverse` flag by disabling `--graph`. My workaround is to create a `lr` alias which replaces `--graph` with `--reverse`.

I also tested "git log --graph --no-graph --name-only" and "--patch" and "--name-status", and all of those failed, without even specifying "--reverse"

Also verified by building `git` from the `next` branch.
> 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.48.1 cpu: arm64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh feature: fsmonitor--daemon libcurl: 8.7.1 zlib: 1.2.12 uname: Darwin 24.3.0 Darwin Kernel Version 24.3.0: Thu Jan 2 20:24:16 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6000 arm64 compiler info: clang: 16.0.0 (clang-1600.0.26.6) libc info: no libc information available $SHELL (typically, interactive shell): /bin/zsh

[Enabled Hooks]
~ Emily Marigold Klassen
Next: Đoàn Trần Công Danh
Message 1 of 3 in “git log --graph --no-graph can cause segfault”
  1. Emily KlassenFeb 8, 2025
  2. Đoàn Trần Công DanhFeb 8, 2025
  3. Emily KlassenFeb 8, 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.