Re: [PATCH next] fast-import: revert die_nicely() to vsnprintf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 10, 2010 at 9:55 PM, Thomas Rast <trast@xxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxx>
> ---
>
> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]