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

Re: [PATCH v2] blame: avoid checking if a file exists on the working tree if a revision is provided

From
Stefan Beller <sbeller@google.com>
Date
Nov 17, 2015, 23:00 UTC
Message-ID
<CAGZ79kbM7ZezVFSt7oHYppd=CcgoQMCyYqXB6H1k-rK82kzUPg@mail.gmail.com>
In-Reply-To
<20151117224809.GE27862@sigill.intra.peff.net>
On Tue, Nov 17, 2015 at 2:48 PM, Jeff King <peff@peff.net> wrote:
Show 17 quoted lines
> On Tue, Nov 17, 2015 at 12:11:25AM -0500, Eric Sunshine wrote:
>
>> > blame content even if the path provided does match an existing
>> > blob on said revision.
>>
>> git-blame documentation does not advertise "blame <file> <rev>" as a
>> valid invocation. It does advertise "blame <rev> -- <file>", and this
>> case already works correctly even when <file> does not exist in the
>> worktree.
>
> Hmm. Out of curiosity I tried:
>
>   git blame v2.4.0 -- t/t6031-merge-recursive.sh
>
> and it segfaults. This bisects to Max's recent 1b0d400 (blame: extract
> find_single_final, 2015-10-30), but I do not see anything obviously
> wrong with it from a quick glance.

it did not fail when running through gdb, so I conclude it is a memory issue (like using an uninitialized pointer, or memory allocation too small).

valgrind produces:

==18444== Process terminating with default action of signal 11 (SIGSEGV) ==18444== General Protection Fault ==18444== at 0x4032121: strcmp (valgrind/memcheck/mc_replace_strmem.c:725) ==18444== by 0x41A86F: get_origin (/usr/local/google/home/sbeller/OSS/git/builtin/blame.c:483) ==18444== by 0x4201EF: cmd_blame (/usr/local/google/home/sbeller/OSS/git/builtin/blame.c:2763) ==18444== by 0x405896: run_builtin (/usr/local/google/home/sbeller/OSS/git/git.c:350) ==18444== by 0x405AA4: handle_builtin (/usr/local/google/home/sbeller/OSS/git/git.c:536) ==18444== by 0x405BC0: run_argv (/usr/local/google/home/sbeller/OSS/git/git.c:582) ==18444== by 0x405DB8: main (/usr/local/google/home/sbeller/OSS/git/git.c:690) ==18444==

Show 6 quoted lines
>
> -Peff
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous: Jeff KingNext: Eric Sunshine
Message 4 of 9 in “blame: avoid checking if a file exists on the working tree if a revision is provided”
  1. blame: avoid checking if a file exists on the working tree if a revision is providedEdmundo Carmona Antoranz, Nov 17, 2015
  2. Eric SunshineNov 17, 2015
  3. Jeff KingNov 17, 2015
  4. Stefan BellerNov 17, 2015
  5. Eric SunshineNov 17, 2015
  6. Jeff KingNov 17, 2015
  7. Eric SunshineNov 20, 2015
  8. Edmundo Carmona AntoranzNov 17, 2015
  9. Edmundo Carmona AntoranzNov 17, 2015

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.