{"thread":{"id":"62922","subject":"git log --graph --no-graph can cause segfault","startedAt":"2025-02-08T03:34:23Z","lastAt":"2025-02-08T05:52:04Z","messageCount":3,"participants":["Emily Klassen","Đoàn Trần Công Danh"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"512126","messageId":"CADY4h_qagYhSP2kz=zNSjfskN1ODxLf1DjEME6BdYw6j-JEAhA@mail.gmail.com","threadId":"62922","inReplyTo":null,"subject":"git log --graph --no-graph can cause segfault","fromName":"Emily Klassen","fromEmail":"forivall@gmail.com","sentAt":"2025-02-08T03:34:11Z","receivedAt":"2025-02-08T03:34:23Z","isPatch":false,"sender":{"key":"forivall@gmail.com","avatar":"https://gravatar.com/avatar/ce462c1645ae87217dd3cd48cbbf0ba7599d95cfcdd482db34ac1f78912a392d?d=mp&s=160"},"body":"> What did you do before the bug happened? (Steps to reproduce your issue)\n\n$ git config --get alias.l\nlog --pretty=oneline --abbrev-commit --decorate --graph\n\n$ git --no-pager l --reverse --no-graph --name-status\ne83c516331 Initial revision of \"git\", the information manager from hell\nerror: git died of signal 11\n\n> What did you expect to happen? (Expected behavior)\n\nI expect the commit listing to display successfully.\n\n> What happened instead? (Actual behavior)\n\nGit seems to have crashed. My best guess is that some state gets set with the\nfirst `--graph` flag which is not cleared with the `--no-graph` flag.\n\n> What's different between what you expected and what actually happened?\n\nGit crashed.\n\n> Anything else you want to add:\n\nI also tried to manually expand the alias with\n\n$ git --no-pager log --pretty=oneline --abbrev-commit --decorate\n--graph HEAD --reverse --no-graph --name-status\ne83c516331 Initial revision of \"git\", the information manager from hell\n\n$ echo $?\n139\n\nWhich indicates a segfault.\n\nThe below command works properly\n\n$ git log --pretty=oneline --abbrev-commit --decorate HEAD --reverse\n--name-status\n\nbut obviously, the intent is to be able to use my `l` alias with the\n`--reverse` flag by disabling `--graph`. My workaround is to create a `lr`\nalias which replaces `--graph` with `--reverse`.\n\nI also tested \"git log --graph --no-graph --name-only\" and \"--patch\"\nand \"--name-status\", and all of those failed, without even specifying\n\"--reverse\"\n\nAlso verified by building `git` from the `next` branch.\n\n> Please review the rest of the bug report below.\n> You can delete any lines you don't wish to share.\n\n\n[System Info]\ngit version:\ngit version 2.48.1\ncpu: arm64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nfeature: fsmonitor--daemon\nlibcurl: 8.7.1\nzlib: 1.2.12\nuname: Darwin 24.3.0 Darwin Kernel Version 24.3.0: Thu Jan  2 20:24:16\nPST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6000 arm64\ncompiler info: clang: 16.0.0 (clang-1600.0.26.6)\nlibc info: no libc information available\n$SHELL (typically, interactive shell): /bin/zsh\n\n\n[Enabled Hooks]\n\n~ Emily Marigold Klassen\n"},{"id":"512127","messageId":"Z6bhS7THkV2ovXfQ@danh.dev","threadId":"62922","inReplyTo":"CADY4h_qagYhSP2kz=zNSjfskN1ODxLf1DjEME6BdYw6j-JEAhA@mail.gmail.com","subject":"Re: git log --graph --no-graph can cause segfault","fromName":"Đoàn Trần Công Danh","fromEmail":"congdanhqx@gmail.com","sentAt":"2025-02-08T04:44:59Z","receivedAt":"2025-02-08T04:45:02Z","isPatch":false,"sender":{"key":"congdanhqx@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42673067?v=4"},"body":"On 2025-02-07 19:34:11-0800, Emily Klassen <forivall@gmail.com> wrote:\n> > What did you do before the bug happened? (Steps to reproduce your issue)\n> \n> $ git config --get alias.l\n> log --pretty=oneline --abbrev-commit --decorate --graph\n> \n> $ git --no-pager l --reverse --no-graph --name-status\n> e83c516331 Initial revision of \"git\", the information manager from hell\n> error: git died of signal 11\n> \n> > What did you expect to happen? (Expected behavior)\n> \n> I expect the commit listing to display successfully.\n> \n> > What happened instead? (Actual behavior)\n> \n> Git seems to have crashed. My best guess is that some state gets set with the\n> first `--graph` flag which is not cleared with the `--no-graph` flag.\n> \n> > What's different between what you expected and what actually happened?\n> \n> Git crashed.\n\nGiven commands yields: \"fatal: Out of memory, realloc failed\" in my\nsystem. But it's fixed by jk/combine-diff-cleanup, which is merged\ninto master.\n\nWould you try to run from master branch to see if your problem has\nbeen fixed?\n\n-- \nDanh\n"},{"id":"512128","messageId":"CADY4h_rOxG3eMR46SCL2Db4L6+++Tt5Ky6w5R8PPgofC+0iFxg@mail.gmail.com","threadId":"62922","inReplyTo":"Z6bhS7THkV2ovXfQ@danh.dev","subject":"Re: git log --graph --no-graph can cause segfault","fromName":"Emily Klassen","fromEmail":"forivall@gmail.com","sentAt":"2025-02-08T05:51:53Z","receivedAt":"2025-02-08T05:52:04Z","isPatch":false,"sender":{"key":"forivall@gmail.com","avatar":"https://gravatar.com/avatar/ce462c1645ae87217dd3cd48cbbf0ba7599d95cfcdd482db34ac1f78912a392d?d=mp&s=160"},"body":"Yup, I built on `next` and it's still resulting in the segfault.\nHowever, I did end up figuring out the issue, and I'm sending a proper\npatch momentarily. Basically \"revs->diffopt.output_prefix_data\" needs\nto be nulled in the \"--no-graph\" argument parser in revision.c\n\n~ Emily Marigold Klassen\n\n\n\n\nOn Fri, Feb 7, 2025 at 8:45 PM Đoàn Trần Công Danh <congdanhqx@gmail.com> wrote:\n>\n> On 2025-02-07 19:34:11-0800, Emily Klassen <forivall@gmail.com> wrote:\n> > > What did you do before the bug happened? (Steps to reproduce your issue)\n> >\n> > $ git config --get alias.l\n> > log --pretty=oneline --abbrev-commit --decorate --graph\n> >\n> > $ git --no-pager l --reverse --no-graph --name-status\n> > e83c516331 Initial revision of \"git\", the information manager from hell\n> > error: git died of signal 11\n> >\n> > > What did you expect to happen? (Expected behavior)\n> >\n> > I expect the commit listing to display successfully.\n> >\n> > > What happened instead? (Actual behavior)\n> >\n> > Git seems to have crashed. My best guess is that some state gets set with the\n> > first `--graph` flag which is not cleared with the `--no-graph` flag.\n> >\n> > > What's different between what you expected and what actually happened?\n> >\n> > Git crashed.\n>\n> Given commands yields: \"fatal: Out of memory, realloc failed\" in my\n> system. But it's fixed by jk/combine-diff-cleanup, which is merged\n> into master.\n>\n> Would you try to run from master branch to see if your problem has\n> been fixed?\n>\n> --\n> Danh\n"}]}