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

Crash when using git blame on untracked file

From
Simon Ruderich <simon@ruderich.org>
Date
Aug 27, 2016, 17:53 UTC
Message-ID
<20160827175336.bphgkb6zclvwfntk@ruderich.org>
Hello,

I'm seeing the following crash with Git 2.9.3 on Debian sid (amd64):

    $ git init foo
    $ cd foo
    $ touch x
    $ git add x
    $ git commit -m test
    $ touch x.conf
    $ git blame x.conf
    segmentation fault
I've tested it on Debian stable's 2.1.4 which works fine:
    $ git blame x.conf
    fatal: no such path 'x.conf' in HEAD

It requires the blamed file to be present, but in some cases it works only if the file e.g. "x" is already tracked in Git and the other file is called "x.conf" (".conf"-suffix). But in an empty repo it seems to happen always.

Sadly Debian's git has no dbg-package, so the stacktrace is not very useful:

    #0  __strcmp_sse2_unaligned () at ../sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S:31
    #1  0x000000000041ad7a in ?? ()
    #2  0x0000000000406171 in ?? ()
    #3  0x0000000000405321 in ?? ()
    #4  0x00007ffff6f9f700 in __libc_start_main (main=0x4051c0, argc=0x3, argv=0x7fffffffe1a8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe198)
        at ../csu/libc-start.c:291
    #5  0x00000000004057d9 in ?? ()

Regards Simon

-- 
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9
Next: Thomas Gummerer
Message 1 of 5 in “Crash when using git blame on untracked file”
  1. Simon RuderichAug 27, 2016
  2. Thomas GummererAug 27, 2016
  3. Junio C HamanoAug 29, 2016
  4. blame: fix segfault on untracked filesThomas Gummerer, Aug 29, 2016
  5. Junio C HamanoAug 29, 2016

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.