Thread: Creating trigger function with argument(s) gets backend crash.

Creating trigger function with argument(s) gets backend crash.

From
Satoshi Nagayasu
Date:
Hi all,

When I attempted to create a trigger function with argument(s),
the backend got crashed.

I know this operation is wrong, however I think the backend crash
mustn't be occured, it should be a syntax error or something like that.

Is this a bug, or just my mistake(or misunderstanding)?

Now I'm working on CVS tree retreived on 2005/07/01.

Thanks.
------------------------------------------------------------
snaga=# CREATE FUNCTION t1_trig_func(integer) RETURNS trigger
snaga-# AS '
snaga'# BEGIN
snaga'#   RAISE NOTICE ''foo'';
snaga'# END
snaga'# ' LANGUAGE 'plpgsql';
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!> \q
------------------------------------------------------------

--
NAGAYASU Satoshi <nagayasus@nttdata.co.jp>

Re: Creating trigger function with argument(s) gets backend crash.

From
Michael Fuhr
Date:
On Wed, Jul 06, 2005 at 05:59:24PM +0900, Satoshi Nagayasu wrote:
>
> When I attempted to create a trigger function with argument(s),
> the backend got crashed.

Same here with the most recent HEAD.  Here's a stack trace:

#0  0xfed2f648 in plpgsql_compile (fcinfo=0xffbfdf38, forValidator=-32 'à')
    at pl_comp.c:688
#1  0xfed2d2a0 in plpgsql_validator (fcinfo=0x3bf5a4) at pl_handler.c:236
#2  0x00212b08 in OidFunctionCall1 (functionId=3929508, arg1=4290765752) at fmgr.c:1410

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

Re: Creating trigger function with argument(s) gets backend crash.

From
Bruce Momjian
Date:
Satoshi Nagayasu wrote:
> Hi all,
>
> When I attempted to create a trigger function with argument(s),
> the backend got crashed.
>
> I know this operation is wrong, however I think the backend crash
> mustn't be occured, it should be a syntax error or something like that.
>
> Is this a bug, or just my mistake(or misunderstanding)?
>
> Now I'm working on CVS tree retreived on 2005/07/01.
>
> Thanks.
> ------------------------------------------------------------
> snaga=# CREATE FUNCTION t1_trig_func(integer) RETURNS trigger
> snaga-# AS '
> snaga'# BEGIN
> snaga'#   RAISE NOTICE ''foo'';
> snaga'# END
> snaga'# ' LANGUAGE 'plpgsql';
> server closed the connection unexpectedly
>         This probably means the server terminated abnormally
>         before or while processing the request.
> The connection to the server was lost. Attempting reset: Failed.
> !> \q

Yea, funny things is I saw the same crash last week when playing with
something, and I assumed creating a function shouldn't make it crash,
but I wasn't sure, so I didn't report it.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: Creating trigger function with argument(s) gets backend crash.

From
Tom Lane
Date:
Satoshi Nagayasu <nagayasus@nttdata.co.jp> writes:
> When I attempted to create a trigger function with argument(s),
> the backend got crashed.
> Is this a bug, or just my mistake(or misunderstanding)?

Definitely a bug; existing releases don't do that.  Thanks for the
report.

            regards, tom lane