Re: Function call crashes server

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Function call crashes server
Date: 2002-03-21 05:13:33
Message-ID: 200203210513.g2L5DXq08345@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > If I do this as any user:
> > SELECT update_pg_pwd();
> > it crashes all backends and causes a server-wide restart. Is this
> > acceptable behavior?
>
> There are a number of things we might blame this on, all having to do
> with the overuse of type OID zero to mean too many different things.
> But my attention is currently focused on this tidbit in ExecTypeFromTL:
>
> TupleDescInitEntry(typeInfo,
> resdom->resno,
> resdom->resname,
> /* fix for SELECT NULL ... */
> (restype ? restype : UNKNOWNOID),
> resdom->restypmod,
> 0,
> false);
>
> Had ExecTypeFromTL rejected restype = 0 rather than substituting
> UNKNOWNOID (a pretty durn random response, IMHO), we'd not see this
> crash.
>
> The "fix for SELECT NULL" appears to have been committed by you
> on 7 Dec 1996. Care to explain it?
>
> (AFAICT, "SELECT NULL" does not produce a zero at this point now,
> though perhaps it did in 1996. Or was there some other case you
> were defending against back then?)

That was 6 months into the Internet-based project. We were just
patching things to prevent crashes. My guess is that I was trying to
fix the much more common case of "SELECT NULL" and had no idea how it
would affect functions that return no value. Feel free to wack it
around.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-03-21 05:14:53 Re: [GENERAL] Notify argument?
Previous Message Tom Lane 2002-03-21 05:08:55 Re: Function call crashes server