Skip site navigation (1) Skip section navigation (2)

Re: snprintf causes regression tests to fail

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Nicolai Tufar <ntufar(at)gmail(dot)com>,Magnus Hagander <mha(at)sollentuna(dot)net>, pgsql-hackers(at)postgresql(dot)org,pgsql-hackers-win32(at)postgresql(dot)org
Subject: Re: snprintf causes regression tests to fail
Date: 2005-03-02 04:31:19
Message-ID: 200503020431.j224VJf16679@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-hackers-win32pgsql-patches
Bruce Momjian wrote:
> Tom Lane wrote:
> > Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > > Tom Lane wrote:
> > >> Does it help if you flip the order of the snprintf and vsnprintf
> > >> functions in snprintf.c?
> > 
> > > Yes, it fixes the problem and I have applied the reordering with a
> > > comment.
> > 
> > Fascinating.
> > 
> > > I will start working on fixing the large fmtpar allocations now.
> > 
> > Quite honestly, this code is not worth micro-optimizing because it
> > is fundamentally broken.  See my other comments in this thread.
> 
> I am working on something that just counts the '%' characters in the
> format string and allocates an array that size.
> 
> > Can we find a BSD-license implementation that follows the spec?
> 
> I would think NetBSD would be our best bet.  I will download it and take
> a look.

Oops, I remember now that NetBSD doesn't support it. I think FreeBSD does.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to

Responses

pgsql-hackers by date

Next:From: Robert TreatDate: 2005-03-02 04:44:04
Subject: Re: logging as inserts
Previous:From: Bruce MomjianDate: 2005-03-02 04:23:08
Subject: Re: snprintf causes regression tests to fail

pgsql-patches by date

Next:From: Bruce MomjianDate: 2005-03-02 05:22:14
Subject: Re: [pgsql-hackers-win32] [HACKERS] snprintf causes regression tests
Previous:From: Bruce MomjianDate: 2005-03-02 04:23:08
Subject: Re: snprintf causes regression tests to fail

pgsql-hackers-win32 by date

Next:From: Bruce MomjianDate: 2005-03-02 05:22:14
Subject: Re: [pgsql-hackers-win32] [HACKERS] snprintf causes regression tests
Previous:From: Bruce MomjianDate: 2005-03-02 04:23:08
Subject: Re: snprintf causes regression tests to fail

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group