From: Erik Faye-Lund <kusmabite@googlemail.com>
To: Thomas Rast <trast@student.ethz.ch>
Cc: Junio C Hamano <gitster@pobox.com>,
git@vger.kernel.org, Johannes Sixt <j6t@kdbg.org>
Subject: Re: [PATCH next] fast-import: revert die_nicely() to vsnprintf
Date: Fri, 11 Jun 2010 15:18:10 +0200 [thread overview]
Message-ID: <AANLkTikIQeY1ZieEkev_zjDSVI9W1NpfhiyTNCaToeys@mail.gmail.com> (raw)
In-Reply-To: <29df1a625a82bd2d3fcee92068b3a15f56435c66.1276199549.git.trast@student.ethz.ch>
On Thu, Jun 10, 2010 at 9:55 PM, Thomas Rast <trast@student.ethz.ch> wrote:
> ebaa79f (Make report() from usage.c public as vreportf() and use it.,
> 2010-03-06) changed fast-import's die_nicely() to use vreportf().
>
> This requires some more care though. First it forgot that we also
> need to reformat the message for the crash report. Second, vreportf()
> uses vsnprintf(), which does not call va_end(). This leaves the
> va_list passed to it in an undefined state. Therefore we need to make
> a copy of this va_list so that we can reuse it.
>
> Signed-off-by: Thomas Rast <trast@student.ethz.ch>
> ---
>
> Another valgrind catch. I think that'll be the last one for today.
> Thanks for your attention.
>
>
> fast-import.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/fast-import.c b/fast-import.c
> index c0728c2..1fa5de4 100644
> --- a/fast-import.c
> +++ b/fast-import.c
> @@ -483,12 +483,14 @@ static void dump_marks(void);
> static NORETURN void die_nicely(const char *err, va_list params)
> {
> static int zombie;
> + va_list saved_params;
> + va_copy(saved_params, params);
Ugh. We don't use the va_copy for portability reasons; it's C99, and
impossible to implement in a portable way on non-C99 systems.
--
Erik "kusma" Faye-Lund
next prev parent reply other threads:[~2010-06-11 13:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-10 19:55 [PATCH next] fast-import: revert die_nicely() to vsnprintf Thomas Rast
2010-06-11 13:18 ` Erik Faye-Lund [this message]
2010-06-11 15:02 ` [PATCH v2] fast-import: die_nicely() back to vsnprintf (reverts part of ebaa79f) Thomas Rast
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=AANLkTikIQeY1ZieEkev_zjDSVI9W1NpfhiyTNCaToeys@mail.gmail.com \
--to=kusmabite@googlemail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j6t@kdbg.org \
--cc=kusmabite@gmail.com \
--cc=trast@student.ethz.ch \
/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).