va_copy() problem

Sepherosa Ziehau sepherosa at gmail.com
Tue Nov 13 17:51:43 PST 2007


On 13 Nov 2007 18:41:03 GMT, Johannes Hofmann <Johannes.Hofmann at gmx.de> wrote:
> Johannes Hofmann <Johannes.Hofmann at gmx.de> wrote:
> > Joerg Sonnenberger <joerg at britannica.bec.de> wrote:
> >> On Mon, Nov 12, 2007 at 08:53:46PM +0000, Johannes Hofmann wrote:
> >>> Joerg Sonnenberger <joerg at britannica.bec.de> wrote:
> >>> > On Mon, Nov 12, 2007 at 06:58:30PM +0000, Johannes Hofmann wrote:
> >>> >>               va_copy(va1, va);
> >>> >>               n = vsnprintf(s->str + s->len, s->size - s->len, format, va);
> >>> >>               va_end(va1);
> >>> >
> >>> > va -> va1 in the call to vsnprintf. Also consider using vasprintf.
> >>>
> >>> Ooops, you are right of course.
> >>> But unfortunately it still crashes badly...
> >>
> >> Works fine after the change on both NetBSD current and DragonFly 1.8.
> >>
> >
> > Thanks for testing this. Just tried it on my system booted from yesterdays
> > LATEST-Devel snapshot and it works there too.
> > I'm now checking my system. Perhaps some stale header files or weird
> > kernel option...
> >
>
>
> Ufff, I think I've found the problem. If libc is compiled with gcc41
> it does not work. If I compile it with gcc34 it works fine.
> The snapshots on chlamydia are compiled with gcc34, that's why it
> worked there.
> Can someone please confirm that it does not work with a gcc41-compiled
> libc?

Could you try compiling your program with -fno-builtin-vsnprintf?

Best Regards,
sephe

> Note, that you need to fix the typo spotted by Joerg!
>
> Johannes
>



-- 
Live Free or Die





More information about the Users mailing list