Re: BUG #12918: Segfault in BackendIdGetTransactionIds - Mailing list pgsql-bugs

From David Gould
Subject Re: BUG #12918: Segfault in BackendIdGetTransactionIds
Date
Msg-id 20150331234828.5270fd12@engels
Whole thread Raw
In response to Re: BUG #12918: Segfault in BackendIdGetTransactionIds  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #12918: Segfault in BackendIdGetTransactionIds
List pgsql-bugs
On Mon, 30 Mar 2015 13:00:01 -0400
Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Vladimir Borodin <root@simply.name> writes:
> > I=E2=80=99ve also tried to revert dd1a3bcc where this function appeared=
 but couldn=E2=80=99t do it :( If you would be able to make a build without=
 this commit (if it is easier than fix it in right way), I could install it=
 on several production hosts to test it.
>=20
> Try this.

Nice to see a patch, in advance of need ;-) Thanks!

We have had a couple segfaults recently but once we enabled core files it
stopped happening. Until just now. I can build with the
patch, but if a 9.4.2 is immanent it would be nice to know before
scheduling an extra round of downtimes.

This is apparently from a python trigger calling get_app_name(). I
can provide the rest of the stack if it would be useful.

Program terminated with signal 11, Segmentation fault.
#0  0x000000000066148b in BackendIdGetTransactionIds (backendID=3D<value op=
timized out>, xid=3D0x7f5d56ae1598, xmin=3D0x7f5d56ae159c)
    at sinvaladt.c:426
426     sinvaladt.c: No such file or directory.
        in sinvaladt.c
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.149.el6_6.=
5.x86_64 zlib-1.2.3-29.el6.x86_64
(gdb) bt
#0  0x000000000066148b in BackendIdGetTransactionIds (backendID=3D<value op=
timized out>, xid=3D0x7f5d56ae1598, xmin=3D0x7f5d56ae159c)
    at sinvaladt.c:426
#1  0x000000000061f064 in pgstat_read_current_status () at pgstat.c:2871
#2  0x000000000061f0e9 in pgstat_fetch_stat_numbackends () at pgstat.c:2342
#3  0x00000000006ef373 in pg_stat_get_activity (fcinfo=3D0x7fffd2e78f50) at=
 pgstatfuncs.c:591
#4  0x00000000005977ec in ExecMakeTableFunctionResult (funcexpr=3D0x17fdae0=
, econtext=3D0x17fd770, argContext=3D<value optimized out>,=20
    expectedDesc=3D0x17ffd70, randomAccess=3D0 '\000') at execQual.c:2193
#5  0x00000000005a91f2 in FunctionNext (node=3D0x17fd660) at nodeFunctionsc=
an.c:95
#6  0x00000000005982ce in ExecScanFetch (node=3D0x17fd660, accessMtd=3D0x5a=
8f40 <FunctionNext>, recheckMtd=3D0x5a8870 <FunctionRecheck>)
    at execScan.c:82
#7  ExecScan (node=3D0x17fd660, accessMtd=3D0x5a8f40 <FunctionNext>, rechec=
kMtd=3D0x5a8870 <FunctionRecheck>) at execScan.c:167
#8  0x00000000005913c8 in ExecProcNode (node=3D0x17fd660) at execProcnode.c=
:426
#9  0x000000000058ff32 in ExecutePlan (queryDesc=3D0x17f81f0, direction=3D<=
value optimized out>, count=3D1) at execMain.c:1486
#10 standard_ExecutorRun (queryDesc=3D0x17f81f0, direction=3D<value optimiz=
ed out>, count=3D1) at execMain.c:319
#11 0x00007f69a7d3867b in explain_ExecutorRun (queryDesc=3D0x17f81f0, direc=
tion=3DForwardScanDirection, count=3D1) at auto_explain.c:243
#12 0x00007f69a7b33965 in pgss_ExecutorRun (queryDesc=3D0x17f81f0, directio=
n=3DForwardScanDirection, count=3D1)
    at pg_stat_statements.c:873
#13 0x000000000059bd6c in postquel_getnext (fcinfo=3D<value optimized out>)=
 at functions.c:853
#14 fmgr_sql (fcinfo=3D<value optimized out>) at functions.c:1148
#15 0x0000000000595f85 in ExecMakeFunctionResultNoSets (fcache=3D0x17ed920,=
 econtext=3D0x17ed730, isNull=3D0x17ee2a8 " ",=20
    isDone=3D<value optimized out>) at execQual.c:2023
#16 0x0000000000591e53 in ExecTargetList (projInfo=3D<value optimized out>,=
 isDone=3D0x7fffd2e798fc) at execQual.c:5304
#17 ExecProject (projInfo=3D<value optimized out>, isDone=3D0x7fffd2e798fc)=
 at execQual.c:5519
#18 0x00000000005a98fb in ExecResult (node=3D0x17ed620) at nodeResult.c:155
#19 0x0000000000591478 in ExecProcNode (node=3D0x17ed620) at execProcnode.c=
:373
#20 0x000000000058ff32 in ExecutePlan (queryDesc=3D0x166c610, direction=3D<=
value optimized out>, count=3D0) at execMain.c:1486
#21 standard_ExecutorRun (queryDesc=3D0x166c610, direction=3D<value optimiz=
ed out>, count=3D0) at execMain.c:319
#22 0x00007f69a7d3867b in explain_ExecutorRun (queryDesc=3D0x166c610, direc=
tion=3DForwardScanDirection, count=3D0) at auto_explain.c:243
#23 0x00007f69a7b33965 in pgss_ExecutorRun (queryDesc=3D0x166c610, directio=
n=3DForwardScanDirection, count=3D0)
    at pg_stat_statements.c:873
#24 0x00000000005b39d0 in _SPI_pquery (plan=3D0x7fffd2e79d10, paramLI=3D0x0=
, snapshot=3D<value optimized out>, crosscheck_snapshot=3D0x0,=20
    read_only=3D0 '\000', fire_triggers=3D1 '\001', tcount=3D0) at spi.c:23=
72
#25 _SPI_execute_plan (plan=3D0x7fffd2e79d10, paramLI=3D0x0, snapshot=3D<va=
lue optimized out>, crosscheck_snapshot=3D0x0,=20
    read_only=3D0 '\000', fire_triggers=3D1 '\001', tcount=3D0) at spi.c:21=
60
#26 0x00000000005b4076 in SPI_execute (src=3D0x15f6054 "SELECT get_app_name=
() AS a", read_only=3D0 '\000', tcount=3D0) at spi.c:386
#27 0x00007f5d5672f702 in PLy_spi_execute_query (query=3D0x15f6054 "SELECT =
get_app_name() AS a", limit=3D0) at plpy_spi.c:357

-dg

--=20
David Gould              510 282 0869         daveg@sonic.net
If simplicity worked, the world would be overrun with insects.

pgsql-bugs by date:

Previous
From: Maxim Boguk
Date:
Subject: Re: BUG #12933: Custom prepared plan vs partitioning.
Next
From: Tom Lane
Date:
Subject: Re: BUG #12918: Segfault in BackendIdGetTransactionIds