Re: \x output blowing up

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: \x output blowing up
Date: 2005-09-24 23:18:16
Message-ID: 200509242318.j8ONIGh06226@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


Well, it seems we are going to have to fix it somehow for 8.1. It is
not crashing here so I can't work up a patch. Can you submit a minimal
fix for 8.1? Thanks.

---------------------------------------------------------------------------

Martijn van Oosterhout wrote:
-- Start of PGP signed section.
> On Sat, Sep 24, 2005 at 11:45:08PM +0200, Martijn van Oosterhout wrote:
> > Hi,
> >
> > On CVS tip, whenever I do \x output, it dies with an internal error in
> > glibc on free. If you run it under valgrind, it complains about these
> > lines of code:
>
> <snip>
>
> Ok, I worked out the direct cause, pg_wcswidth only returns the length
> upto the first newline and the line it breaks on is the multiline
> definition in "_pg_expandarray".
>
> The quick fix should be to only allocate memory if it's going to call
> format_numeric_locale(), since then you know it's a number. It makes
> the code slightly more convoluated but it should be slightly more
> efficient.
>
> I actually have a working psql that handles and displays newlines
> properly, but it's too late for 8.1. It fixes all these issues
> properly.
>
> Have a nice day,
> --
> Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> > Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> > tool for doing 5% of the work and then sitting around waiting for someone
> > else to do the other 95% so you can sue them.
-- End of PGP section, PGP failed!

--
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

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-09-24 23:21:19 Re: Discarding relations from FSM
Previous Message Bruce Momjian 2005-09-24 23:13:11 Re: Discarding relations from FSM

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2005-09-25 03:19:05 Re: PL/Python error checking
Previous Message Martijn van Oosterhout 2005-09-24 22:13:40 Re: \x output blowing up