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

From Tom Lane
Subject Re: Function call crashes server
Date
Msg-id 10268.1016687335@sss.pgh.pa.us
Whole thread Raw
In response to Function call crashes server  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Function call crashes server  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
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?)
        regards, tom lane


pgsql-hackers by date:

Previous
From: nconway@klamath.dyndns.org (Neil Conway)
Date:
Subject: Re: [GENERAL] Notify argument?
Next
From: Bruce Momjian
Date:
Subject: Re: Function call crashes server