From: Erik Faye-Lund <kusmabite@gmail.com>
To: "Git Mailing List" <git@vger.kernel.org>,
msysGit <msysgit@googlegroups.com>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: Breakage in master?
Date: Thu, 2 Feb 2012 13:14:19 +0100 [thread overview]
Message-ID: <CABPQNSbWu0r_gKGvCHk567pUtQiyDOCO8vFfrzPMFW1eUaj1nw@mail.gmail.com> (raw)
Something strange is going on in Junio's current 'master' branch
(f3fb075). "git show" has started to error out on Windows with a
complaint about our vsnprintf:
---8<---
$ git show
commit f3fb07509c2e0b21b12a598fcd0a19a92fc38a9d
Author: Junio C Hamano <gitster@pobox.com>
Date: Tue Jan 31 22:31:35 2012 -0800
Update draft release notes to 1.7.10
Signed-off-by: Junio C Hamano <gitster@pobox.com>
fatal: BUG: your vsnprintf is broken (returned -1)
---8<---
"git status" is also behaving strange:
---8<---
$ git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# ←[31mcompat/vcbuild/include/sys/resource.h←[m
# ←[31mtemp.patch←[m
# ←[31mtest.c←[m
# ←[31mtest.patch←[m
nothing added to commit but untracked files present (use "git add" to track)
---8<---
Yeah, the ANSI color codes are being printed verbatim, even though
compat/winansi.c is supposed to convert these. "git -p status" works
fine, as it pipes the ANSI codes directly through less.
But here's the REALLY puzzling part: If I add a simple, unused
function to diff-lib.c, like this:
---8<---
diff --git a/diff-lib.c b/diff-lib.c
index fc0dff3..914a224 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -82,6 +82,11 @@ static int match_stat_with_submodule(struct
diff_options *diffopt,
return changed;
}
+static unsigned int foo(const char *a, unsigned int b)
+{
+ return b;
+}
+
int run_diff_files(struct rev_info *revs, unsigned int option)
{
int entries, i;
---8<---
"git status" starts to error out with that same vsnprintf complaint!
---8<---
$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
fatal: BUG: your vsnprintf is broken (returned -1)
---8<---
Here's the stack-trace:
---8<---
Breakpoint 1, die (err=0x5268ec "BUG: your vsnprintf is broken (returned %d)")
at usage.c:81
81 void NORETURN die(const char *err, ...)
(gdb) bt
#0 die (err=0x5268ec "BUG: your vsnprintf is broken (returned %d)")
at usage.c:81
#1 0x00466314 in strbuf_vaddf (sb=0x28fb54,
fmt=0x533ef4 " (use \"git checkout -- <file>...\" to discard changes in wor
king directory)", ap=0x28fbac "+\025\026\002") at strbuf.c:221
#2 0x004cbb6f in status_vprintf (s=0x28fc38, at_bol=0,
color=0x46c4f2 "\205└t\n\203─\020[^╔├\215v",
fmt=0x533ef4 " (use \"git checkout -- <file>...\" to discard changes in wor
king directory)", ap=0x28fbac "+\025\026\002", trail=0x533a89 "\n")
at wt-status.c:44
#3 0x004cbe6b in status_printf_ln (s=0x28fc38, color=0x28fc70 "",
fmt=0x533ef4 " (use \"git checkout -- <file>...\" to discard changes in wor
king directory)") at wt-status.c:87
#4 0x004cced1 in wt_status_print (s=0x28fc38) at wt-status.c:176
#5 0x0041922e in cmd_status (argc=1, argv=0x319b4, prefix=0x0)
at builtin/commit.c:1254
#6 0x004019d6 in handle_internal_command (argc=<value optimized out>,
argv=<value optimized out>) at git.c:308
#7 0x00401c26 in main (argc=2, argv=0x319b0) at git.c:513
(gdb)
---8<---
This smells a bit like a smashed stack to me. Both issues happens in
roughly the same area of the call stack, and when adding an unused
function changes behavior, something really odd is going on ;)
I've bisected the issues down to 5e9637c (i18n: add infrastructure for
translating Git with gettext). Trying to apply my unused-function
patch on top of this commit starts giving the same "fatal: BUG: your
vsnprintf is broken (returned -1)" error. It's ancestor, bc1bbe0(Git
1.7.8-rc2), does not yield any of the issues.
I'm at a loss here. Does anyone have a hunch about what's going on?
next reply other threads:[~2012-02-02 12:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-02 12:14 Erik Faye-Lund [this message]
2012-02-02 17:46 ` Breakage in master? Jeff King
2012-02-03 12:28 ` Erik Faye-Lund
2012-02-03 13:55 ` Joel C. Salomon
2012-02-03 14:05 ` Erik Faye-Lund
2012-02-03 14:22 ` Joel C. Salomon
2012-02-04 21:55 ` Erik Faye-Lund
2012-02-05 14:46 ` Fwd: " Erik Faye-Lund
2012-02-02 18:57 ` [msysGit] " Johannes Schindelin
2012-02-02 20:15 ` Torsten Bögershausen
2012-02-02 20:45 ` Johannes Sixt
2012-02-09 6:03 ` svnpenn
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=CABPQNSbWu0r_gKGvCHk567pUtQiyDOCO8vFfrzPMFW1eUaj1nw@mail.gmail.com \
--to=kusmabite@gmail.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=msysgit@googlegroups.com \
/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).