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

rebase -i segmentation fault and another problem

From
Zbyszek Szmek <zbyszek@in.waw.pl>
Date
Sep 27, 2010, 14:23 UTC
Message-ID
<20100927142327.GW6756@in.waw.pl>

Hi, I get a core dump when trying to remove a commit from the tip of a branch which was merged with a branch with a different root. Sorry if this is unclear - picture might help:

 *-*-m-r
    /
 z-*
(m is merge point, and r is the commit to be removed,
 z is initial commit on the other branch).
A simple 'git reset --hard HEAD^' works, I know. But:

$ git rebase --interactive HEAD~2 Segmentation fault (core dumped)

Could not apply 532e7e0... z

The core files comes from 'git cherry-pick ...', and indeed it's enough to run this command directly:

$ git-cherry-pick --ff 532e7e0 [2] 9582 segmentation fault (core dumped) git-cherry-pick --ff 532e7e0

gdb: Program terminated with signal 11, Segmentation fault. #0 do_pick_commit (argc=3, argv=<value optimized out>) at builtin/revert.c:445 445 if (allow_ff && !hashcmp(parent->object.sha1, head))

(gdb) bt #0 do_pick_commit (argc=3, argv=<value optimized out>) at builtin/revert.c:445 #1 revert_or_cherry_pick (argc=3, argv=<value optimized out>) at builtin/revert.c:576 #2 0x000000000040499a in run_builtin (argc=3, argv=0x7fff86b20ba8) at git.c:275 #3 handle_internal_command (argc=3, argv=0x7fff86b20ba8) at git.c:431 #4 0x0000000000404f9f in main (argc=3, argv=0x7fff86b20ba8) at git.c:516

Repo which shows this behaviour can be created with:
git init repo1; cd repo1
touch a; git add a; git commit -m a
cd ..
git init repo2; cd repo2
touch b; git add b; git commit -m b
cd ../repo1
git pull ../repo2
touch c; git add c; git commit -m c
git rebase --interactive HEAD~2
 (just save without doing anything -> segmentation fault)

$ git --version git version 1.7.3 (compiled from git/master)

--------------------------------------------------------

Another small problem with git rebase --interactive: in the same repo, running git rebase HEAD~1 and removing the only commit on the list doesn't do anything (repo is unchanged). The expected behaviour would be to remove the tip of branch...

Best, Zbyszek

Next: Brandon Casey
Message 1 of 4 in “rebase -i segmentation fault and another problem”
  1. Zbyszek SzmekSep 27, 2010
  2. Brandon CaseySep 27, 2010
  3. builtin/revert.c: don't dereference a NULL pointerBrandon Casey, Sep 27, 2010
  4. Zbyszek SzmekSep 28, 2010

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.