From: Junio C Hamano <gitster@pobox.com>
To: Daniel Stenberg <daniel@haxx.se>
Cc: git@vger.kernel.org
Subject: Re: git master describe segfault
Date: Mon, 21 Mar 2016 12:31:16 -0700 [thread overview]
Message-ID: <xmqqzitrljaz.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1603211025330.20859@tvnag.unkk.fr> (Daniel Stenberg's message of "Mon, 21 Mar 2016 10:35:05 +0100 (CET)")
Daniel Stenberg <daniel@haxx.se> writes:
> 0. I'm on a Linux box: a reasonably updated Debian unstable.
>
> 1. I'm up to date with the latest git master branch of gecko-dev:
> https://github.com/mozilla/gecko-dev (counting a little over 467K
> commits)
>
> 2. I built the current git off the master branch (v2.8.0-rc3-12-g047057b)
>
> 3. In the gecko-dev dir, I run 'git describe --contains f495d0cc2'
>
> The outcome is what looks like a fine stack smash due to very very
> extensive recursion:
>
> $ gdb --args ../git/git describe --contains f495d0cc2
> (gdb) run
> Program received signal SIGSEGV, Segmentation fault.
> 0x00007ffff7bccf73 in ?? () from /lib/x86_64-linux-gnu/libz.so.1
> ...
> #12 0x0000000000464662 in name_rev (commit=0x170df20,
> tip_name=0x8e9170 "B2G_1_0_0_20130115070201", generation=87254,
> distance=87254, deref=0) at builtin/name-rev.c:30
> #13 0x00000000004647de in name_rev (commit=0x170dee0,
> tip_name=0x8e9170 "B2G_1_0_0_20130115070201", generation=87253,
> distance=87253, deref=0) at builtin/name-rev.c:72
> #14 0x00000000004647de in name_rev (commit=0x170dea0,
> tip_name=0x8e9170 "B2G_1_0_0_20130115070201", generation=87252,
> distance=87252, deref=0) at builtin/name-rev.c:72
> #15 0x00000000004647de in name_rev (commit=0x170de60,
> tip_name=0x8e9170 "B2G_1_0_0_20130115070201", generation=87251,
> distance=87251, deref=0) at builtin/name-rev.c:72
> #16 0x00000000004647de in name_rev (commit=0x170de20,
> tip_name=0x8e9170 "B2G_1_0_0_20130115070201", generation=87250,
> distance=87250, deref=0) at builtin/name-rev.c:72
> #17 0x00000000004647de in name_rev (commit=0x170dde0,
> tip_name=0x8e9170 "B2G_1_0_0_20130115070201", generation=87249,
> distance=87249, deref=0) at builtin/name-rev.c:72
It does look bad. name_rev() naively recurses quite a lot and
easily runs out of stack space, it seems (rewriting the recursion
to iterative implementation may help). I haven't looked at this
code carefully for quite a while, but I suspect piece of memory
pointed at by new_name variable may also be leaking.
prev parent reply other threads:[~2016-03-21 19:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-21 9:35 git master describe segfault Daniel Stenberg
2016-03-21 19:31 ` Junio C Hamano [this message]
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=xmqqzitrljaz.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=daniel@haxx.se \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.