pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Joshua D. Drake <jd@commandprompt.com>
Cc: pgsql-admin@postgresql.org, Oleg Bartunov <oleg@sai.msu.su>
Cc: Teodor Sigaev <teodor@sigaev.ru>
Subject: Re: tsearch2 problem rank_cd() (possibly) crashing postgres
Date: Fri, 08 Dec 2006 11:12:54 -0500
Message-ID: <5964.1165594374@sss.pgh.pa.us> (raw)
In-Reply-To: <1165593203.12459.81.camel@localhost.localdomain>
References: <a97c77030612080255h131f708brb68495740219229a@mail.gmail.com>
	<Pine.LNX.4.64.0612081442320.16338@sn.sai.msu.ru>
	<5485.1165592831@sss.pgh.pa.us>
	<1165593203.12459.81.camel@localhost.localdomain>

"Joshua D. Drake" <jd@commandprompt.com> writes:
> On Fri, 2006-12-08 at 10:47 -0500, Tom Lane wrote:
>> Nonetheless, dumping core on bad input is not acceptable behavior ...

> Is it time to require test cases for contrib modules?

tsearch2 *has* a regression test.  ATM it sounds like the problem is
that the OP tried to use a new library with old pg_proc entries that
defined different parameter sets for the same-named C functions; a
situation that no regression test would have exercised anyway.

That change was probably unwise on Oleg and Teodor's part, but what's
done is done.  My point is that now that we know the failure mode, we
need to add some defenses.  The OP is certainly not the last DBA who
will make this mistake during 8.1->8.2 upgrade.

It looks to me like the problem is that with the old pg_proc entries,
an "int4" will get passed where the code is expecting "float4[]",
so it tries to dereference the int and crashes.  There doesn't seem
to be any real cheap defense --- we might have to add a
get_fn_expr_argtype() call into rank_cd, and anything else that's been
changed similarly.  But I don't think this is negotiable.  Backend
crashes are bad.

			regards, tom lane



view thread (15+ messages)  latest in thread

Message-ID: <5964.1165594374@sss.pgh.pa.us>
Permalink:  ../5964.1165594374@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/5964.1165594374@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jd@commandprompt.com, oleg@sai.msu.su, teodor@sigaev.ru
  Subject: Re: tsearch2 problem rank_cd() (possibly) crashing postgres
  In-Reply-To: <5964.1165594374@sss.pgh.pa.us>
  References: <a97c77030612080255h131f708brb68495740219229a@mail.gmail.com> <Pine.LNX.4.64.0612081442320.16338@sn.sai.msu.ru> <5485.1165592831@sss.pgh.pa.us> <1165593203.12459.81.camel@localhost.localdomain> <5964.1165594374@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox