Re: BUG #3860: xpath crashes backend when is querying xmlagg result

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Sokolov Yura <funny(dot)falcon(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org, Peter Eisentraut <peter_e(at)gmx(dot)net>, Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: BUG #3860: xpath crashes backend when is querying xmlagg result
Date: 2008-01-11 03:48:17
Message-ID: 5395.1200023297@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-patches

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> Tom Lane escribi:
>> One thing I was wondering about earlier today is whether libxml isn't
>> expecting NULL-return-on-failure from the malloc-substitute routine.
>> If we take control away from it unexpectedly, I wouldn't be a bit
>> surprised if its data structures are left corrupt. This might lead to
>> failures during cleanup.

> Hmm, this is a very good point. I quick look at the source shows that
> they are not very consistent on its own checking for memory allocation
> errors. For example, see a bug I just reported:
> http://bugzilla.gnome.org/show_bug.cgi?id=508662

Ugh. So we're pretty much damned if we do and damned if we don't.

Given what you showed, it is certain that we are at risk if we return
NULL, whereas it is merely hypothetical that we are at risk if we
longjmp. So let's stick to the palloc infrastructure for now.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2008-01-11 05:08:14 Re: BUG #3865: ERROR: failed to build any 8-way joins
Previous Message Alvaro Herrera 2008-01-11 03:41:40 Re: BUG #3860: xpath crashes backend when is querying xmlagg result

Browse pgsql-patches by date

  From Date Subject
Next Message Simon Riggs 2008-01-11 08:26:31 Re: Revised patch for fixing archiver shutdown behavior
Previous Message Alvaro Herrera 2008-01-11 03:41:40 Re: BUG #3860: xpath crashes backend when is querying xmlagg result