Re: BUG #12918: Segfault in BackendIdGetTransactionIds

From: David Gould <daveg(at)sonic(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Vladimir Borodin <root(at)simply(dot)name>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #12918: Segfault in BackendIdGetTransactionIds
Date: 2015-04-01 06:48:28
Message-ID: 20150331234828.5270fd12@engels
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, 30 Mar 2015 13:00:01 -0400
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Vladimir Borodin <root(at)simply(dot)name> writes:
> > I’ve also tried to revert dd1a3bcc where this function appeared but couldn’t 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.
>
> 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=<value optimized out>, xid=0x7f5d56ae1598, xmin=0x7f5d56ae159c)
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=<value optimized out>, xid=0x7f5d56ae1598, xmin=0x7f5d56ae159c)
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=0x7fffd2e78f50) at pgstatfuncs.c:591
#4 0x00000000005977ec in ExecMakeTableFunctionResult (funcexpr=0x17fdae0, econtext=0x17fd770, argContext=<value optimized out>,
expectedDesc=0x17ffd70, randomAccess=0 '\000') at execQual.c:2193
#5 0x00000000005a91f2 in FunctionNext (node=0x17fd660) at nodeFunctionscan.c:95
#6 0x00000000005982ce in ExecScanFetch (node=0x17fd660, accessMtd=0x5a8f40 <FunctionNext>, recheckMtd=0x5a8870 <FunctionRecheck>)
at execScan.c:82
#7 ExecScan (node=0x17fd660, accessMtd=0x5a8f40 <FunctionNext>, recheckMtd=0x5a8870 <FunctionRecheck>) at execScan.c:167
#8 0x00000000005913c8 in ExecProcNode (node=0x17fd660) at execProcnode.c:426
#9 0x000000000058ff32 in ExecutePlan (queryDesc=0x17f81f0, direction=<value optimized out>, count=1) at execMain.c:1486
#10 standard_ExecutorRun (queryDesc=0x17f81f0, direction=<value optimized out>, count=1) at execMain.c:319
#11 0x00007f69a7d3867b in explain_ExecutorRun (queryDesc=0x17f81f0, direction=ForwardScanDirection, count=1) at auto_explain.c:243
#12 0x00007f69a7b33965 in pgss_ExecutorRun (queryDesc=0x17f81f0, direction=ForwardScanDirection, count=1)
at pg_stat_statements.c:873
#13 0x000000000059bd6c in postquel_getnext (fcinfo=<value optimized out>) at functions.c:853
#14 fmgr_sql (fcinfo=<value optimized out>) at functions.c:1148
#15 0x0000000000595f85 in ExecMakeFunctionResultNoSets (fcache=0x17ed920, econtext=0x17ed730, isNull=0x17ee2a8 " ",
isDone=<value optimized out>) at execQual.c:2023
#16 0x0000000000591e53 in ExecTargetList (projInfo=<value optimized out>, isDone=0x7fffd2e798fc) at execQual.c:5304
#17 ExecProject (projInfo=<value optimized out>, isDone=0x7fffd2e798fc) at execQual.c:5519
#18 0x00000000005a98fb in ExecResult (node=0x17ed620) at nodeResult.c:155
#19 0x0000000000591478 in ExecProcNode (node=0x17ed620) at execProcnode.c:373
#20 0x000000000058ff32 in ExecutePlan (queryDesc=0x166c610, direction=<value optimized out>, count=0) at execMain.c:1486
#21 standard_ExecutorRun (queryDesc=0x166c610, direction=<value optimized out>, count=0) at execMain.c:319
#22 0x00007f69a7d3867b in explain_ExecutorRun (queryDesc=0x166c610, direction=ForwardScanDirection, count=0) at auto_explain.c:243
#23 0x00007f69a7b33965 in pgss_ExecutorRun (queryDesc=0x166c610, direction=ForwardScanDirection, count=0)
at pg_stat_statements.c:873
#24 0x00000000005b39d0 in _SPI_pquery (plan=0x7fffd2e79d10, paramLI=0x0, snapshot=<value optimized out>, crosscheck_snapshot=0x0,
read_only=0 '\000', fire_triggers=1 '\001', tcount=0) at spi.c:2372
#25 _SPI_execute_plan (plan=0x7fffd2e79d10, paramLI=0x0, snapshot=<value optimized out>, crosscheck_snapshot=0x0,
read_only=0 '\000', fire_triggers=1 '\001', tcount=0) at spi.c:2160
#26 0x00000000005b4076 in SPI_execute (src=0x15f6054 "SELECT get_app_name() AS a", read_only=0 '\000', tcount=0) at spi.c:386
#27 0x00007f5d5672f702 in PLy_spi_execute_query (query=0x15f6054 "SELECT get_app_name() AS a", limit=0) at plpy_spi.c:357

-dg

--
David Gould 510 282 0869 daveg(at)sonic(dot)net
If simplicity worked, the world would be overrun with insects.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2015-04-01 06:56:52 Re: BUG #12918: Segfault in BackendIdGetTransactionIds
Previous Message Maxim Boguk 2015-04-01 04:33:04 Re: BUG #12933: Custom prepared plan vs partitioning.