postgresql signal 5生成core分析

发布时间 2023-03-24 09:24:45作者: lightdb

postgresql signal 5生成core,如下:

[zjh@hs-10-20-30-193 data]$ gdb lightdb core.49666 
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-120.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/zjh/stage/lightdb-x/bin/lightdb...done.
[New LWP 49666]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `lightdb: zjh postgres [local] SELECT         '.
Program terminated with signal 5, Trace/breakpoint trap.
#0  0x00000000008e148a in AllocSetAlloc (context=0x1c2a220, size=40) at aset.c:721
721    {
warning: File "/usr/local/lib64/libstdc++.so.6.0.24-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load:/usr/bin/mono-gdb.py".
To enable execution of this file add
    add-auto-load-safe-path /usr/local/lib64/libstdc++.so.6.0.24-gdb.py
line to your configuration file "/home/zjh/.gdbinit".
To completely disable this security protection add
    set auto-load safe-path /
line to your configuration file "/home/zjh/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
    info "(gdb)Auto-loading safe path"
Missing separate debuginfos, use: debuginfo-install cyrus-sasl-lib-2.1.26-23.el7.x86_64 glibc-2.17-326.el7_9.x86_64 keyutils-libs-1.5.8-3.el7.x86_64 krb5-libs-1.15.1-50.el7.x86_64 libcom_err-1.42.9-19.el7.x86_64 libcurl-7.29.0-59.el7_9.1.x86_64 libicu-50.2-4.el7_7.x86_64 libidn-1.28-4.el7.x86_64 libpmem-1.5.1-2.1.el7.x86_64 libselinux-2.5-15.el7.x86_64 libssh2-1.8.0-4.el7.x86_64 libxml2-2.9.1-6.el7.5.x86_64 lz4-1.8.3-1.el7.x86_64 nspr-4.32.0-1.el7_9.x86_64 nss-3.53.1-7.el7_9.x86_64 nss-softokn-freebl-3.67.0-3.el7_9.x86_64 nss-util-3.67.0-1.el7_9.x86_64 openldap-2.4.44-23.el7_9.x86_64 openssl-libs-1.0.2k-21.el7_9.x86_64 pcre-8.32-17.el7.x86_64 xz-libs-5.2.2-1.el7.x86_64 zlib-1.2.7-19.el7_9.x86_64
(gdb) bt
#0  0x00000000008e148a in AllocSetAlloc (context=0x1c2a220, size=40) at aset.c:721
#1  0x00000000008e7889 in palloc (size=size@entry=40) at mcxt.c:963
#2  0x00000000006a914a in expression_tree_mutator (node=node@entry=0x1d5e3f8, mutator=mutator@entry=0x7010d0 <eval_const_expressions_mutator>, context=context@entry=0x7fff375ec230)
    at nodeFuncs.c:2649
#3  0x0000000000701118 in eval_const_expressions_mutator (node=0x1d5e3f8, context=0x7fff375ec230) at clauses.c:3609
#4  0x0000000000701c09 in eval_const_expressions_mutator (node=0x1d5e4e8, context=0x7fff375ec230) at clauses.c:2853
#5  0x00000000006a923e in expression_tree_mutator (node=0x1d5e498, mutator=mutator@entry=0x7010d0 <eval_const_expressions_mutator>, context=context@entry=0x7fff375ec230) at nodeFuncs.c:3096
#6  0x0000000000702d73 in simplify_function (funcid=67, result_type=16, result_typmod=result_typmod@entry=-1, result_collid=0, input_collid=100, args_p=args_p@entry=0x7fff375ec1c0, 
    funcvariadic=funcvariadic@entry=false, process_args=process_args@entry=true, allow_non_const=allow_non_const@entry=true, context=context@entry=0x7fff375ec230) at clauses.c:3981
#7  0x00000000007012c6 in eval_const_expressions_mutator (node=node@entry=0x1d5e588, context=context@entry=0x7fff375ec230) at clauses.c:2592
#8  0x00000000007025ef in eval_const_expressions (root=root@entry=0x1d64d48, node=node@entry=0x1d5e588) at clauses.c:2336
#9  0x00000000006fdf0f in preprocess_rownum (root=root@entry=0x1d64d48, parse=parse@entry=0x1c2be28) at preprownum_lt.c:342
#10 0x00000000006ecde0 in subquery_planner (glob=glob@entry=0x1d65368, parse=parse@entry=0x1c2be28, parent_root=parent_root@entry=0x0, hasRecursion=hasRecursion@entry=false, 
    tuple_fraction=tuple_fraction@entry=0) at planner.c:694
#11 0x00000000006f07b7 in standard_planner (parse=0x1c2be28, query_string=query_string@entry=0x0, cursorOptions=2048, boundParams=0x0) at planner.c:416
#12 0x00007fa3a90244dd in distributed_planner (parse=0x1c2be28, query_string=<optimized out>, cursorOptions=<optimized out>, boundParams=<optimized out>) at planner/distributed_planner.c:303
#13 0x00007fa3a6214949 in pgss_planner (parse=0x1c2be28, query_string=0x1c2a338 "select * from temp2 a2,temp1 a1 left join temp3 a3 on a1.aid=a3.cid where a1.aid=a3.cid;", 
    cursorOptions=2048, boundParams=0x0) at pg_stat_statements.c:952
#14 0x00007fa3a59df0b5 in pg_hint_plan_planner (parse=<optimized out>, query_string=<optimized out>, cursorOptions=<optimized out>, boundParams=<optimized out>) at pg_hint_plan.c:7279
#15 0x00000000007a963c in pg_plan_query (querytree=querytree@entry=0x1c2be28, 
    query_string=query_string@entry=0x1c2a338 "select * from temp2 a2,temp1 a1 left join temp3 a3 on a1.aid=a3.cid where a1.aid=a3.cid;", cursorOptions=cursorOptions@entry=2048, 
    boundParams=boundParams@entry=0x0) at postgres.c:888
#16 0x00000000007a9733 in pg_plan_queries (querytrees=0x1d6b548, 
    query_string=query_string@entry=0x1c2a338 "select * from temp2 a2,temp1 a1 left join temp3 a3 on a1.aid=a3.cid where a1.aid=a3.cid;", cursorOptions=cursorOptions@entry=2048, 
    boundParams=boundParams@entry=0x0) at postgres.c:979
#17 0x00000000007a9a03 in exec_simple_query (query_string=0x1c2a338 "select * from temp2 a2,temp1 a1 left join temp3 a3 on a1.aid=a3.cid where a1.aid=a3.cid;") at postgres.c:1179
#18 0x00000000007aaf5b in PostgresMain (argc=<optimized out>, argv=argv@entry=0x1c8b8c8, dbname=0x1c26da8 "postgres", username=<optimized out>) at postgres.c:4496
#19 0x000000000048b031 in BackendRun (port=<optimized out>, port=<optimized out>) at postmaster.c:4982
#20 BackendStartup (port=0x1c83a10) at postmaster.c:4666
#21 ServerLoop () at postmaster.c:1929
#22 0x0000000000733c2e in PostmasterMain (argc=argc@entry=3, argv=argv@entry=0x1c24d20) at postmaster.c:1563
#23 0x000000000048bfdd in main (argc=3, argv=0x1c24d20) at main.c:231

http://cn.voidcc.com/question/p-avelxtcn-sd.html

https://cloud.tencent.com/developer/ask/sof/1312340/answer/1811592