Re: Function call crashes server - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Function call crashes server
Date
Msg-id 200203210513.g2L5DXq08345@candle.pha.pa.us
Whole thread Raw
In response to Re: Function call crashes server  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Function call crashes server  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.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@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Function call crashes server
Next
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] Notify argument?