segmentation fault in pg head with SQL function.

From: Prabhat Sahu <prabhat(dot)sahu(at)enterprisedb(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: segmentation fault in pg head with SQL function.
Date: 2018-03-16 06:05:13
Message-ID: CANEvxPqxAj6nNHVcaXxpTeEFPmh24Whu+23emgjiuKrhJSct0A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I found a segmentation fault on pg master Head with below steps and
stacktrace.

postgres=# CREATE OR REPLACE FUNCTION func1() RETURNS VOID
LANGUAGE SQL
AS $$
select 10;
$$;
CREATE FUNCTION

postgres=# select func1();
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

-- stack trace:
[edb(at)localhost bin]$ gdb -q -c data/core.31498 postgres
Reading symbols from
/home/edb/PG/PGsrcNew/postgresql/inst/bin/postgres...done.
[New LWP 31498]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib64/libthread_db.so.1".
Core was generated by `postgres: edb postgres [local] SELECT
'.
Program terminated with signal 6, Aborted.
#0 0x00007fb376a001f7 in raise () from /usr/lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install
glibc-2.17-196.el7.x86_64 keyutils-libs-1.5.8-3.el7.x86_64
krb5-libs-1.15.1-8.el7.x86_64 libcom_err-1.42.9-10.el7.x86_64
libselinux-2.5-11.el7.x86_64 openssl-libs-1.0.2k-8.el7.x86_64
pcre-8.32-17.el7.x86_64 zlib-1.2.7-17.el7.x86_64
(gdb) bt
#0 0x00007fb376a001f7 in raise () from /usr/lib64/libc.so.6
#1 0x00007fb376a018e8 in abort () from /usr/lib64/libc.so.6
#2 0x0000000000a01368 in ExceptionalCondition (conditionName=0xbea4a0
"!(exprType(newexpr) == result_type)", errorType=0xbe98c6
"FailedAssertion",
fileName=0xbe9916 "clauses.c", lineNumber=4627) at assert.c:54
#3 0x00000000007d1611 in inline_function (funcid=16384, result_type=2278,
result_collid=0, input_collid=0, args=0x0, funcvariadic=0 '\000',
func_tuple=0x7fb377ebc918,
context=0x7fff01e5fca0) at clauses.c:4627
#4 0x00000000007d0781 in simplify_function (funcid=16384,
result_type=2278, result_typmod=-1, result_collid=0, input_collid=0,
args_p=0x7fff01e5eb70, funcvariadic=0 '\000',
process_args=1 '\001', allow_non_const=1 '\001',
context=0x7fff01e5fca0) at clauses.c:4095
#5 0x00000000007ce15f in eval_const_expressions_mutator (node=0x2a88cf8,
context=0x7fff01e5fca0) at clauses.c:2676
#6 0x000000000073727b in expression_tree_mutator (node=0x2a88d88,
mutator=0x7cdc5c <eval_const_expressions_mutator>, context=0x7fff01e5fca0)
at nodeFuncs.c:2854
#7 0x00000000007d007c in eval_const_expressions_mutator (node=0x2a88d88,
context=0x7fff01e5fca0) at clauses.c:3671
#8 0x0000000000737464 in expression_tree_mutator (node=0x2a88d50,
mutator=0x7cdc5c <eval_const_expressions_mutator>, context=0x7fff01e5fca0)
at nodeFuncs.c:2903
#9 0x00000000007d007c in eval_const_expressions_mutator (node=0x2a88d50,
context=0x7fff01e5fca0) at clauses.c:3671
#10 0x00000000007cdc09 in eval_const_expressions (root=0x2a88f00,
node=0x2a88d50) at clauses.c:2474
#11 0x00000000007ae7cb in preprocess_expression (root=0x2a88f00,
expr=0x2a88d50, kind=1) at planner.c:996
#12 0x00000000007adf40 in subquery_planner (glob=0x2a88b68,
parse=0x2a888e0, parent_root=0x0, hasRecursion=0 '\000', tuple_fraction=0)
at planner.c:687
#13 0x00000000007ad541 in standard_planner (parse=0x2a888e0,
cursorOptions=256, boundParams=0x0) at planner.c:385
#14 0x00000000007ad2d2 in planner (parse=0x2a888e0, cursorOptions=256,
boundParams=0x0) at planner.c:243
#15 0x000000000089980c in pg_plan_query (querytree=0x2a888e0,
cursorOptions=256, boundParams=0x0) at postgres.c:807
#16 0x0000000000899939 in pg_plan_queries (querytrees=0x2a88ec8,
cursorOptions=256, boundParams=0x0) at postgres.c:873
#17 0x0000000000899c08 in exec_simple_query (query_string=0x2a87a28 "select
func1();") at postgres.c:1048
#18 0x000000000089dfb0 in PostgresMain (argc=1, argv=0x2ab3550,
dbname=0x2ab33b0 "postgres", username=0x2a84428 "edb") at postgres.c:4144
#19 0x00000000007feed4 in BackendRun (port=0x2aab390) at postmaster.c:4409
#20 0x00000000007fe64d in BackendStartup (port=0x2aab390) at
postmaster.c:4081
#21 0x00000000007fab64 in ServerLoop () at postmaster.c:1754
#22 0x00000000007fa19d in PostmasterMain (argc=5, argv=0x2a82330) at
postmaster.c:1362
#23 0x0000000000731fb8 in main (argc=5, argv=0x2a82330) at main.c:228
(gdb)

--

With Regards,

Prabhat Kumar Sahu
Skype ID: prabhat.sahu1984
EnterpriseDB Corporation

The Postgres Database Company

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Narendra Pradeep U U 2018-03-16 06:42:11 Re: Ambigous Plan - Larger Table on Hash Side
Previous Message Tsunakawa, Takayuki 2018-03-16 06:02:25 RE: [bug fix] Cascaded standby cannot start after a clean shutdown