Backend crash in 8.2.3 with plpgsql function

Поиск
Список
Период
Сортировка
От SM
Тема Backend crash in 8.2.3 with plpgsql function
Дата
Msg-id 6.2.5.6.2.20070314220511.02b7d6f8@elandnews.com
обсуждение исходный текст
Ответы Re: Backend crash in 8.2.3 with plpgsql function  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Backend crash in 8.2.3 with plpgsql function  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-bugs
I got a backend crash in Postgresql 8.2.3 with the plpgsql function.

The following statement in psql causes a signal 11:

psql=# create function testpl() returns void as 'begin return;
end;'language 'plpgsql';

The debug output is as follows:

DEBUG:  00000: StartTransactionCommand
LOCATION:  start_xact_command, postgres.c:2200
STATEMENT:  create function testpl() returns void as 'begin return;
end;'language 'plpgsql';
DEBUG:  00000: StartTransaction
LOCATION:  ShowTransactionState, xact.c:3985
STATEMENT:  create function testpl() returns void as 'begin return;
end;'language 'plpgsql';
DEBUG:  00000: name: unnamed; blockState:       DEFAULT; state:
INPROGR, xid/subid/cid: 163620/1/0, nestlvl: 1, children: <>
LOCATION:  ShowTransactionStateRec, xact.c:4010
STATEMENT:  create function testpl() returns void as 'begin return;
end;'language 'plpgsql';
DEBUG:  00000: ProcessUtility
LOCATION:  PortalRunUtility, pquery.c:1028
STATEMENT:  create function testpl() returns void as 'begin return;
end;'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:
DEBUG:  00000: reaping dead processes
LOCATION:  reaper, postmaster.c:2015
DEBUG:  00000: server process (PID 30164) was terminated by signal 11
LOCATION:  LogChildExit, postmaster.c:2430
LOG:  00000: server process (PID 30164) was terminated by signal 11
LOCATION:  LogChildExit, postmaster.c:2430
LOG:  00000: terminating any other active server processes
LOCATION:  HandleChildCrash, postmaster.c:2315
DEBUG:  00000: sending SIGQUIT to process 1155
LOCATION:  HandleChildCrash, postmaster.c:2366
DEBUG:  00000: sending SIGQUIT to process 4663
LOCATION:  HandleChildCrash, postmaster.c:2400
LOG:  00000: all server processes terminated; reinitializing

Here is the backtrace:

Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/libexec/ld.so...done.
Reading symbols from /usr/lib/libm.so.1.0...done.
Reading symbols from /usr/lib/libc.so.29.0...done.
Reading symbols from /usr/local/pgsql/lib/plpgsql.so...done.
#0  0x234c2a in hash_search (hashp=0x0, keyPtr=0xcfbfcc50, action=HASH_FIND,
     foundPtr=0x0) at dynahash.c:782
782             return hash_search_with_hash_value(hashp,
(gdb) bt
#0  0x234c2a in hash_search (hashp=0x0, keyPtr=0xcfbfcc50, action=HASH_FIND,
     foundPtr=0x0) at dynahash.c:782
#1  0x4038ac25 in plpgsql_HashTableLookup (func_key=0xcfbfcc50)
     at pl_comp.c:2092
#2  0x40387c8a in plpgsql_compile (fcinfo=0xcfbfce70, forValidator=1 '\001')
     at pl_comp.c:161
#3  0x40386851 in plpgsql_validator (fcinfo=0x0) at pl_handler.c:215
#4  0x231cea in OidFunctionCall1 (functionId=19370657, arg1=20155616)
     at fmgr.c:1407
#5  0x5db7c in ProcedureCreate (procedureName=0x344338 "testpl",
     procNamespace=2200, replace=0 '\000', returnsSet=0 '\000',
     returnType=2278, languageObjectId=19370658, languageValidator=19370657,
     prosrc=0x3443f0 "begin return; end;", probin=0xe8aad "-", isAgg=0 '\000',
     security_definer=0 '\000', isStrict=0 '\000', volatility=118 'v',
     parameterTypes=0xcfbfce70, allParameterTypes=0, parameterModes=0,
     parameterNames=0) at pg_proc.c:400
#6  0xe9013 in CreateFunction (stmt=0x3444d8) at functioncmds.c:652
#7  0x1ab569 in ProcessUtility (parsetree=0x3444d8, params=0x0, dest=0x344528,
     completionTag=0xcfbfd654 "") at utility.c:773
#8  0x1a9731 in PortalRunUtility (portal=0x386018, query=0x344228,
     dest=0x344528, completionTag=0xcfbfd654 "") at pquery.c:1063
#9  0x1a9861 in PortalRunMulti (portal=0x386018, dest=0x344528,
     altdest=0x344528, completionTag=0xcfbfd654 "") at pquery.c:1131
#10 0x1a9091 in PortalRun (portal=0x386018, count=2147483647, dest=0x344528,
     altdest=0x344528, completionTag=0xcfbfd654 "") at pquery.c:700
#11 0x1a3ceb in exec_simple_query (
     query_string=0x344018 "create function testpl() returns void as
'begin return; end;'language 'plpgsql';") at postgres.c:939
#12 0x1a7ced in PostgresMain (argc=4, argv=0x2e3448, username=0x2e3428 "pgsql")
     at postgres.c:3424
#13 0x17efe5 in BackendRun (port=0x2e4400) at postmaster.c:2931
#14 0x17e5a1 in BackendStartup (port=0x2e4400) at postmaster.c:2558
#15 0x17c10b in ServerLoop () at postmaster.c:1211
#16 0x17b937 in PostmasterMain (argc=3, argv=0xcfbfd984) at postmaster.c:963
#17 0x1399d9 in main (argc=3, argv=0xcfbfd984) at main.c:188

Regards,
-sm

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Gaetano Mendola
Дата:
Сообщение: Re: BUG #3132: I don't access to DB
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Backend crash in 8.2.3 with plpgsql function