git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Segmentation fault in git cherry-pick
@ 2018-01-31 21:43 Ayke van Laethem
  2018-01-31 22:06 ` Elijah Newren
  0 siblings, 1 reply; 3+ messages in thread
From: Ayke van Laethem @ 2018-01-31 21:43 UTC (permalink / raw)
  To: git

Hi all,

I've found a segmentation fault in git.

Here, fabsf is a branch that I'm trying to get the topmost commit from.
After the failed cherry-pick, the change is added to the local working
tree, but the commit isn't applied and .git/index.lock still exists.

Version: 2.11.0 (Debian stretch)

~/src/micropython/ports/nrf$ valgrind git cherry-pick fabsf
==23286== Memcheck, a memory error detector
==23286== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==23286== Using Valgrind-3.12.0.SVN and LibVEX; rerun with -h for copyright info
==23286== Command: git cherry-pick fabsf
==23286==
==23286== Invalid read of size 4
==23286==    at 0x21A348: add_index_entry_with_check (read-cache.c:1012)
==23286==    by 0x21A348: add_index_entry (read-cache.c:1061)
==23286==    by 0x1FAE85: merge_content (merge-recursive.c:1727)
==23286==    by 0x1FBAAC: process_entry (merge-recursive.c:1885)
==23286==    by 0x1FBAAC: merge_trees (merge-recursive.c:1948)
==23286==    by 0x23E2F7: do_recursive_merge (sequencer.c:389)
==23286==    by 0x23E2F7: do_pick_commit (sequencer.c:757)
==23286==    by 0x23FB52: single_pick (sequencer.c:1329)
==23286==    by 0x23FB52: sequencer_pick_revisions (sequencer.c:1378)
==23286==    by 0x1874CE: run_sequencer (revert.c:178)
==23286==    by 0x187927: cmd_cherry_pick (revert.c:203)
==23286==    by 0x11A204: run_builtin (git.c:373)
==23286==    by 0x11A204: handle_builtin (git.c:572)
==23286==    by 0x11A5A1: run_argv (git.c:630)
==23286==    by 0x11A5A1: cmd_main (git.c:707)
==23286==    by 0x1195D1: main (common-main.c:40)
==23286==  Address 0x38 is not stack'd, malloc'd or (recently) free'd
==23286==
==23286==
==23286== Process terminating with default action of signal 11 (SIGSEGV)
==23286==  Access not within mapped region at address 0x38
==23286==    at 0x21A348: add_index_entry_with_check (read-cache.c:1012)
==23286==    by 0x21A348: add_index_entry (read-cache.c:1061)
==23286==    by 0x1FAE85: merge_content (merge-recursive.c:1727)
==23286==    by 0x1FBAAC: process_entry (merge-recursive.c:1885)
==23286==    by 0x1FBAAC: merge_trees (merge-recursive.c:1948)
==23286==    by 0x23E2F7: do_recursive_merge (sequencer.c:389)
==23286==    by 0x23E2F7: do_pick_commit (sequencer.c:757)
==23286==    by 0x23FB52: single_pick (sequencer.c:1329)
==23286==    by 0x23FB52: sequencer_pick_revisions (sequencer.c:1378)
==23286==    by 0x1874CE: run_sequencer (revert.c:178)
==23286==    by 0x187927: cmd_cherry_pick (revert.c:203)
==23286==    by 0x11A204: run_builtin (git.c:373)
==23286==    by 0x11A204: handle_builtin (git.c:572)
==23286==    by 0x11A5A1: run_argv (git.c:630)
==23286==    by 0x11A5A1: cmd_main (git.c:707)
==23286==    by 0x1195D1: main (common-main.c:40)

Note: I'm not subscribed to this mailing list.

--
Ayke

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Segmentation fault in git cherry-pick
  2018-01-31 21:43 Segmentation fault in git cherry-pick Ayke van Laethem
@ 2018-01-31 22:06 ` Elijah Newren
  2018-02-03 18:56   ` Ayke van Laethem
  0 siblings, 1 reply; 3+ messages in thread
From: Elijah Newren @ 2018-01-31 22:06 UTC (permalink / raw)
  To: Ayke van Laethem; +Cc: Git Mailing List

On Wed, Jan 31, 2018 at 1:43 PM, Ayke van Laethem
<aykevanlaethem@gmail.com> wrote:
> Hi all,
>
> I've found a segmentation fault in git.
>
> Here, fabsf is a branch that I'm trying to get the topmost commit from.
> After the failed cherry-pick, the change is added to the local working
> tree, but the commit isn't applied and .git/index.lock still exists.
>
> Version: 2.11.0 (Debian stretch)
>
> ~/src/micropython/ports/nrf$ valgrind git cherry-pick fabsf
> ==23286== Memcheck, a memory error detector
> ==23286== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
> ==23286== Using Valgrind-3.12.0.SVN and LibVEX; rerun with -h for copyright info
> ==23286== Command: git cherry-pick fabsf
> ==23286==
> ==23286== Invalid read of size 4
> ==23286==    at 0x21A348: add_index_entry_with_check (read-cache.c:1012)
> ==23286==    by 0x21A348: add_index_entry (read-cache.c:1061)
> ==23286==    by 0x1FAE85: merge_content (merge-recursive.c:1727)

This looks like the stack trace in
https://github.com/git-for-windows/git/issues/952, which was fixed by
Johannes Schindelin in commit
55e9f0e5c ("merge-recursive: handle NULL in add_cacheinfo()
correctly", 2016-11-26).  Could you retry with a newer version of git?

Elijah

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Segmentation fault in git cherry-pick
  2018-01-31 22:06 ` Elijah Newren
@ 2018-02-03 18:56   ` Ayke van Laethem
  0 siblings, 0 replies; 3+ messages in thread
From: Ayke van Laethem @ 2018-02-03 18:56 UTC (permalink / raw)
  To: Elijah Newren; +Cc: Git Mailing List

> This looks like the stack trace in
> https://github.com/git-for-windows/git/issues/952, which was fixed by
> Johannes Schindelin in commit
> 55e9f0e5c ("merge-recursive: handle NULL in add_cacheinfo()
> correctly", 2016-11-26).  Could you retry with a newer version of git?

A newer version (2.14.2 from Debian stretch-backports) fixes the
issue. I can now do my cherry-pick.
Thank you!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-02-03 18:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-31 21:43 Segmentation fault in git cherry-pick Ayke van Laethem
2018-01-31 22:06 ` Elijah Newren
2018-02-03 18:56   ` Ayke van Laethem

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).