From: Dennis Kaarsemaker <dennis@kaarsemaker.net>
To: git@vger.kernel.org
Subject: Segfault in git reflog
Date: Wed, 30 Dec 2015 10:24:01 +0100 [thread overview]
Message-ID: <20151230092400.GA9319@spirit> (raw)
I've hit a segfault in git reflog with latest git, reproducable in git.git:
spirit:~/code/git (master)$ ./git describe
v2.7.0-rc3
I've minimized the reflog to:
spirit:~/code/git (master)$ cat .git/logs/HEAD
2635c2b8bfc9aec07b7f023d8e3b3d02df715344 54bc41416c5d3ecb978acb0df80d57aa3e54494c Dennis Kaarsemaker <dennis@kaarsemaker.net> 1446765642 +0100
74c855f87d25a5b5c12d0485ec77c785a1c734c5 54bc41416c5d3ecb978acb0df80d57aa3e54494c Dennis Kaarsemaker <dennis@kaarsemaker.net> 1446765951 +0100 checkout: moving from 3c3d3f629a6176b401ebec455c5dd59ed1b5f910 to master
...which I realize looks a bit broken. I think at the time I was playing with
some patches that also caused segfaults, causing gaps in the reflog.
Nevertheless, I think segfaulting is bad. All objects in the reflog are
reachable.
gdb has the following to say:
spirit:~/code/git (master)$ gdb --args ./git --no-pager reflog
(gdb) run
Starting program: /home/dennis/code/git/git --no-pager reflog
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
28274d0 (HEAD -> master, tag: v2.7.0-rc3, upstream/master, peff/jk/tag-source-propagate, peff/jk/sigpipe-report, gitster/master) HEAD@{0}: checkout: moving from 3c3d3f629a6176b401ebec455c5dd59ed1b5f910 to master
Program received signal SIGSEGV, Segmentation fault.
copy_commit_list (list=0x4834dc7000000011) at commit.c:450
450 pp = commit_list_append(list->item, pp);
(gdb) bt
#0 copy_commit_list (list=0x4834dc7000000011) at commit.c:450
#1 0x000000000050705e in save_parents (commit=commit@entry=0x928a90, revs=0x7fffffffcb80) at revision.c:3044
#2 0x000000000050a54e in get_revision_1 (revs=revs@entry=0x7fffffffcb80) at revision.c:3119
#3 0x000000000050a710 in get_revision_1 (revs=<optimized out>) at revision.c:3112
#4 get_revision_internal (revs=0x7fffffffcb80) at revision.c:3248
#5 0x000000000050a99d in get_revision (revs=revs@entry=0x7fffffffcb80) at revision.c:3322
#6 0x0000000000446032 in cmd_log_walk (rev=rev@entry=0x7fffffffcb80) at builtin/log.c:344
#7 0x0000000000446bf8 in cmd_log_reflog (argc=1, argv=0x7fffffffd6a8, prefix=0x0) at builtin/log.c:626
#8 0x0000000000406126 in run_builtin (argv=0x7fffffffd6a8, argc=1, p=0x7bbec0 <commands+1920>) at git.c:350
#9 handle_builtin (argc=1, argv=0x7fffffffd6a8) at git.c:536
#10 0x0000000000405261 in run_argv (argv=0x7fffffffd4c8, argcp=0x7fffffffd4ac) at git.c:582
#11 main (argc=1, av=<optimized out>) at git.c:690
(gdb) p list
$1 = (struct commit_list *) 0x4834dc7000000011
(gdb) p list->item
Cannot access memory at address 0x4834dc7000000011
A bisect blames 53d00b3 (log: use true parents for diff even when rewriting),
which does indeed touch the code that seems to be segfaulting.
I've tried digging into this, but didn't get very far.
--
Dennis Kaarsemaker <dennis@kaarsemaker.net>
next reply other threads:[~2015-12-30 9:24 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-30 9:24 Dennis Kaarsemaker [this message]
2015-12-30 10:31 ` Segfault in git reflog Duy Nguyen
2015-12-30 11:17 ` Dennis Kaarsemaker
2015-12-30 11:26 ` Duy Nguyen
2015-12-30 11:28 ` Duy Nguyen
2015-12-30 12:28 ` Dennis Kaarsemaker
2015-12-30 13:19 ` Duy Nguyen
2015-12-30 15:22 ` [PATCH] reflog-walk: don't segfault on non-commit sha1's in the reflog Dennis Kaarsemaker
2015-12-30 21:20 ` Junio C Hamano
2015-12-30 21:33 ` Dennis Kaarsemaker
2015-12-30 21:41 ` Junio C Hamano
2015-12-30 21:49 ` Dennis Kaarsemaker
2015-12-30 22:17 ` [PATCH v2] " Dennis Kaarsemaker
2015-12-30 22:42 ` Junio C Hamano
2015-12-30 23:33 ` [PATCH v3] " Dennis Kaarsemaker
2015-12-31 0:02 ` Junio C Hamano
2015-12-31 8:57 ` Dennis Kaarsemaker
2015-12-31 15:43 ` Dennis Kaarsemaker
2016-01-05 21:12 ` [PATCH v4] " Dennis Kaarsemaker
2016-01-06 1:05 ` Eric Sunshine
2016-01-06 1:20 ` Dennis Kaarsemaker
2016-01-06 1:28 ` Eric Sunshine
2016-01-06 1:52 ` Eric Sunshine
2016-01-06 9:13 ` Dennis Kaarsemaker
2016-01-06 9:30 ` Duy Nguyen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151230092400.GA9319@spirit \
--to=dennis@kaarsemaker.net \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).