pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Segmentation fault with PG-12
15+ messages / 3 participants
[nested] [flat]

* Segmentation fault with PG-12
@ 2019-10-08 15:15  Andreas Joseph Krogh <andreas@visena.com>
  0 siblings, 1 reply; 15+ messages in thread

From: Andreas Joseph Krogh @ 2019-10-08 15:15 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

In our production-environment we get sig11 every now and then after upgrading 
to PG-12: 2019-10-08 15:45:29.654 CEST [8829-76] LOG: server process (PID 
20631) was terminated bysignal 11: Segmentation fault 
 2019-10-08 15:45:29.654 CEST [8829-77] DETAIL: Failed process was running: 
COMMIT
 2019-10-08 15:45:29.654 CEST [8829-78] LOG: terminating any other active 
server processes
Will running a debug-enabled build slow things noticably down? Is there a way 
to make it dump a stack-trace (or back-trace in C-land?) on sig11? -- Andreas 
Joseph Krogh CTO / Partner - Visena AS Mobile: +47 909 56 963 andreas@visena.com
 <mailto:andreas@visena.com> www.visena.com <https://www.visena.com;  
<https://www.visena.com; 

^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Segmentation fault with PG-12
@ 2019-10-08 15:24  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Andreas Joseph Krogh <andreas@visena.com>
  0 siblings, 2 replies; 15+ messages in thread

From: Tom Lane @ 2019-10-08 15:24 UTC (permalink / raw)
  To: Andreas Joseph Krogh <andreas@visena.com>; +Cc: pgsql-general@lists.postgresql.org

Andreas Joseph Krogh <andreas@visena.com> writes:
> Will running a debug-enabled build slow things noticably down?

gcc promises that the generated code is the same with or without debug.
I think clang does too.  With other compilers you may pay some penalty.

> Is there a way 
> to make it dump a stack-trace (or back-trace in C-land?) on sig11?

You should be able to get a core file from which you can extract a
stack trace (and other info) after the fact.

https://wiki.postgresql.org/wiki/Generating_a_stack_trace_of_a_PostgreSQL_backend

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Segmentation fault with PG-12
@ 2019-10-08 18:40  Andreas Joseph Krogh <andreas@visena.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 15+ messages in thread

From: Andreas Joseph Krogh @ 2019-10-08 18:40 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

På tirsdag 08. oktober 2019 kl. 17:24:21, skrev Tom Lane <tgl@sss.pgh.pa.us 
<mailto:tgl@sss.pgh.pa.us>>: Andreas Joseph Krogh <andreas@visena.com> writes:
 > Will running a debug-enabled build slow things noticably down?

 gcc promises that the generated code is the same with or without debug.
 I think clang does too. With other compilers you may pay some penalty. Nice, 
I'm using the ubuntu-packages, so I'll go ahead and installpostgresql-12-dbgsym
> Is there a way
 > to make it dump a stack-trace (or back-trace in C-land?) on sig11?

 You should be able to get a core file from which you can extract a
 stack trace (and other info) after the fact.

 
https://wiki.postgresql.org/wiki/Generating_a_stack_trace_of_a_PostgreSQL_backend
I'll look into that, thanks. -- Andreas Joseph Krogh CTO / Partner - Visena AS 
Mobile: +47 909 56 963 andreas@visena.com <mailto:andreas@visena.com> 
www.visena.com <https://www.visena.com;  <https://www.visena.com;

^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Segmentation fault with PG-12
@ 2019-10-09 11:21  Andreas Joseph Krogh <andreas@visena.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 1 reply; 15+ messages in thread

From: Andreas Joseph Krogh @ 2019-10-09 11:21 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-general@lists.postgresql.org

På tirsdag 08. oktober 2019 kl. 17:24:21, skrev Tom Lane <tgl@sss.pgh.pa.us 
<mailto:tgl@sss.pgh.pa.us>>: Andreas Joseph Krogh <andreas@visena.com> writes:
 > Will running a debug-enabled build slow things noticably down?

 gcc promises that the generated code is the same with or without debug.
 I think clang does too. With other compilers you may pay some penalty.

 > Is there a way
 > to make it dump a stack-trace (or back-trace in C-land?) on sig11?

 You should be able to get a core file from which you can extract a
 stack trace (and other info) after the fact.

 
https://wiki.postgresql.org/wiki/Generating_a_stack_trace_of_a_PostgreSQL_backend

 regards, tom lane Attached is output from "bt full". Is this helpful? 
Anything else I can do to help narrowing down the problem? Thanks. -- Andreas 
Joseph Krogh CTO / Partner - Visena AS Mobile: +47 909 56 963 andreas@visena.com
 <mailto:andreas@visena.com> www.visena.com <https://www.visena.com;  
<https://www.visena.com;

Attachments:

gdb.txt (text/plain, 16.9K) download #0 slot_deform_heap_tuple (natts=24, offp=0x5598ec873d90, tuple=<optimized out>, slot=0x5598ec873d48) at ./build/../src/backend/executor/execTuples.c:895 isnull = 0x5598ec8733e8 tup = <optimized out> bp = <optimized out> tupleDesc = <optimized out> values = 0x5598ec875de8 off = <optimized out> slow = <optimized out> hasnulls = <optimized out> attnum = <optimized out> tp = <optimized out> tupleDesc = <optimized out> values = <optimized out> isnull = <optimized out> tup = <optimized out> hasnulls = <optimized out> attnum = <optimized out> tp = <optimized out> off = <optimized out> bp = <optimized out> slow = <optimized out> thisatt = <optimized out> #1 tts_buffer_heap_getsomeattrs (slot=0x5598ec873d48, natts=24) at ./build/../src/backend/executor/execTuples.c:676 bslot = 0x5598ec873d48 #2 0x00005598e94534ac in slot_getsomeattrs_int (slot=slot@entry=0x5598ec873d48, attnum=24) at ./build/../src/backend/executor/execTuples.c:1877 __errno_location = <optimized out> #3 0x00005598e94443f1 in slot_getsomeattrs (attnum=<optimized out>, slot=0x5598ec873d48) at ./build/../src/include/executor/tuptable.h:345 No locals. #4 ExecInterpExpr (state=0x5598ec8776b8, econtext=0x5598ec876ea8, isnull=<optimized out>) at ./build/../src/backend/executor/execExprInterp.c:441 op = <optimized out> resultslot = 0x0 innerslot = <optimized out> outerslot = <optimized out> scanslot = 0x0 dispatch_table = {0x5598e9443608 <ExecInterpExpr+168>, 0x5598e94443f8 <ExecInterpExpr+3736>, 0x5598e94443d0 <ExecInterpExpr+3696>, 0x5598e94443b0 <ExecInterpExpr+3664>, 0x5598e9444380 <ExecInterpExpr+3616>, 0x5598e9444350 <ExecInterpExpr+3568>, 0x5598e9444328 <ExecInterpExpr+3528>, 0x5598e9444318 <ExecInterpExpr+3512>, 0x5598e9444148 <ExecInterpExpr+3048>, 0x5598e94442e0 <ExecInterpExpr+3456>, 0x5598e9444300 <ExecInterpExpr+3488>, 0x5598e94442c8 <ExecInterpExpr+3432>, 0x5598e9444120 <ExecInterpExpr+3008>, 0x5598e94440f0 <ExecInterpExpr+2960>, 0x5598e94442a0 <ExecInterpExpr+3392>, 0x5598e9444270 <ExecInterpExpr+3344>, 0x5598e9444250 <ExecInterpExpr+3312>, 0x5598e9444240 <ExecInterpExpr+3296>, 0x5598e94441d8 <ExecInterpExpr+3192>, 0x5598e94441c0 <ExecInterpExpr+3168>, 0x5598e94441a8 <ExecInterpExpr+3144>, 0x5598e94435a8 <ExecInterpExpr+72>, 0x5598e94435af <ExecInterpExpr+79>, 0x5598e9444168 <ExecInterpExpr+3080>, 0x5598e94435d0 <ExecInterpExpr+112>, 0x5598e94435d7 <ExecInterpExpr+119>, 0x5598e94440b8 <ExecInterpExpr+2904>, 0x5598e94440b0 <ExecInterpExpr+2896>, 0x5598e9444088 <ExecInterpExpr+2856>, 0x5598e9444080 <ExecInterpExpr+2848>, 0x5598e9444070 <ExecInterpExpr+2832>, 0x5598e9444058 <ExecInterpExpr+2808>, 0x5598e9444028 <ExecInterpExpr+2760>, 0x5598e9444008 <ExecInterpExpr+2728>, 0x5598e9443fe0 <ExecInterpExpr+2688>, 0x5598e9443fd0 <ExecInterpExpr+2672>, 0x5598e9443fb8 <ExecInterpExpr+2648>, 0x5598e9443f60 <ExecInterpExpr+2560>, 0x5598e9443f90 <ExecInterpExpr+2608>, 0x5598e9443f38 <ExecInterpExpr+2520>, 0x5598e9443d98 <ExecInterpExpr+2104>, 0x5598e9443f20 <ExecInterpExpr+2496>, 0x5598e9443f08 <ExecInterpExpr+2472>, 0x5598e9443ef0 <ExecInterpExpr+2448>, 0x5598e9443ec0 <ExecInterpExpr+2400>, 0x5598e9443e28 <ExecInterpExpr+2248>, 0x5598e9443dc0 <ExecInterpExpr+2144>, 0x5598e9443d60 <ExecInterpExpr+2048>, 0x5598e9443e48 <ExecInterpExpr+2280>, 0x5598e9443ce8 <ExecInterpExpr+1928>, 0x5598e9443cd0 <ExecInterpExpr+1904>, 0x5598e9444598 <ExecInterpExpr+4152>, 0x5598e9443cb8 <ExecInterpExpr+1880>, 0x5598e9443ca0 <ExecInterpExpr+1856>, 0x5598e9443c78 <ExecInterpExpr+1816>, 0x5598e9443be8 <ExecInterpExpr+1672>, 0x5598e9443c18 <ExecInterpExpr+1720>, 0x5598e9443b98 <ExecInterpExpr+1592>, 0x5598e9443b80 <ExecInterpExpr+1568>, 0x5598e9443b68 <ExecInterpExpr+1544>, 0x5598e9443b50 <ExecInterpExpr+1520>, 0x5598e9443b38 <ExecInterpExpr+1496>, 0x5598e9443b18 <ExecInterpExpr+1464>, 0x5598e9443b00 <ExecInterpExpr+1440>, 0x5598e9443c00 <ExecInterpExpr+1696>, 0x5598e9443ae8 <ExecInterpExpr+1416>, 0x5598e9443e90 <ExecInterpExpr+2352>, 0x5598e9443aa0 <ExecInterpExpr+1344>, 0x5598e9443690 <ExecInterpExpr+304>, 0x5598e9443ad0 <ExecInterpExpr+1392>, 0x5598e9443ab8 <ExecInterpExpr+1368>, 0x5598e9443a88 <ExecInterpExpr+1320>, 0x5598e9443a48 <ExecInterpExpr+1256>, 0x5598e9443a70 <ExecInterpExpr+1296>, 0x5598e9443a10 <ExecInterpExpr+1200>, 0x5598e94439f8 <ExecInterpExpr+1176>, 0x5598e94439e0 <ExecInterpExpr+1152>, 0x5598e94439c0 <ExecInterpExpr+1120>, 0x5598e9443628 <ExecInterpExpr+200>, 0x5598e94438f8 <ExecInterpExpr+920>, 0x5598e9443980 <ExecInterpExpr+1056>, 0x5598e94438a0 <ExecInterpExpr+832>, 0x5598e9443940 <ExecInterpExpr+992>, 0x5598e94437f8 <ExecInterpExpr+664>, 0x5598e9443710 <ExecInterpExpr+432>, 0x5598e94436f8 <ExecInterpExpr+408>, 0x5598e94436e0 <ExecInterpExpr+384>, 0x5598e9443608 <ExecInterpExpr+168>} #5 0x00005598e942326b in ExecEvalExprSwitchContext (isNull=0x7ffdf2aae7a7, econtext=<optimized out>, state=<optimized out>) at ./build/../src/include/executor/executor.h:307 retDatum = <optimized out> oldContext = <optimized out> retDatum = <optimized out> oldContext = <optimized out> #6 ExecQual (econtext=<optimized out>, state=<optimized out>) at ./build/../src/include/executor/executor.h:376 ret = <optimized out> isnull = false ret = <optimized out> isnull = <optimized out> #7 TriggerEnabled (estate=estate@entry=0x5598eaeabdd0, trigger=trigger@entry=0x5598eaeac828, event=<optimized out>, modifiedCols=modifiedCols@entry=0x5598eb7d34b8, oldslot=0x5598ec876b88, newslot=0x5598ec873d48, relinfo=<optimized out>, relinfo=<optimized out>) at ./build/../src/backend/commands/trigger.c:3516 predicate = <optimized out> econtext = <optimized out> oldContext = <optimized out> i = <optimized out> relinfo = <optimized out> relinfo = <optimized out> oldslot = 0x5598ec876b88 modifiedCols = 0x5598eb7d34b8 estate = 0x5598eaeabdd0 newslot = 0x5598ec873d48 event = <optimized out> trigger = 0x5598eaeac828 i = <optimized out> modified = <optimized out> predicate = <optimized out> econtext = <optimized out> oldContext = <optimized out> i = <optimized out> tgqual = <optimized out> #8 0x00005598e9429813 in ExecBRUpdateTriggers (estate=estate@entry=0x5598eaeabdd0, epqstate=epqstate@entry=0x5598eb7d3110, relinfo=relinfo@entry=0x5598eaeac090, tupleid=tupleid@entry=0x7ffdf2aaea0a, fdw_trigtuple=fdw_trigtuple@entry=0x0, newslot=newslot@entry=0x5598ec873d48) at ./build/../src/backend/commands/trigger.c:3081 trigger = 0x5598eaeac828 oldtuple = <optimized out> trigdesc = 0x5598eaeac010 oldslot = 0x5598ec876b88 newtuple = 0x0 trigtuple = 0x5598ec876778 should_free_trig = false should_free_new = false LocTriggerData = {type = T_TriggerData, tg_event = 14, tg_relation = 0x5598eb2e7fa8, tg_trigtuple = 0x20, tg_newtuple = 0x20015598ec601e18, tg_trigger = 0x228, tg_trigslot = 0x248, tg_newslot = 0x5598ec872278, tg_oldtable = 0x0, tg_newtable = 0x0} i = 19 updatedCols = 0x5598eb7d34b8 lockmode = <optimized out> #9 0x00005598e946caed in ExecUpdate (mtstate=mtstate@entry=0x5598eb7d3018, tupleid=0x7ffdf2aaea0a, oldtuple=0x0, slot=0x5598ec873d48, planSlot=planSlot@entry=0x5598ec873468, epqstate=epqstate@entry=0x5598eb7d3110, estate=0x5598eaeabdd0, canSetTag=true) at ./build/../src/backend/executor/nodeModifyTable.c:1072 resultRelInfo = 0x5598eaeac090 resultRelationDesc = 0x5598eb2e7fa8 result = <optimized out> tmfd = {ctid = {ip_blkid = {bi_hi = 48592, bi_lo = 60138}, ip_posid = 21912}, xmax = 3968283752, cmax = 21912, traversed = 128} recheckIndexes = 0x0 saved_tcs_map = 0x0 __func__ = "ExecUpdate" #10 0x00005598e946dd79 in ExecModifyTable (pstate=0x5598eb7d3018) at ./build/../src/backend/executor/nodeModifyTable.c:2223 node = 0x5598eb7d3018 proute = 0x0 estate = 0x5598eaeabdd0 operation = CMD_UPDATE saved_resultRelInfo = 0x0 resultRelInfo = 0x5598eaeac090 subplanstate = 0x5598ec601c08 junkfilter = 0x5598ec876088 slot = <optimized out> planSlot = 0x5598ec873468 tupleid = <optimized out> tuple_ctid = {ip_blkid = {bi_hi = 3, bi_lo = 36252}, ip_posid = 22} oldtupdata = {t_len = 3941252560, t_self = {ip_blkid = {bi_hi = 21912, bi_lo = 0}, ip_posid = 0}, t_tableOid = 0, t_data = 0x7ffdf2aaea50} oldtuple = <optimized out> __func__ = "ExecModifyTable" #11 0x00005598e944725d in ExecProcNode (node=0x5598eb7d3018) at ./build/../src/include/executor/executor.h:239 No locals. #12 ExecutePlan (execute_once=<optimized out>, dest=0x5598eb932038, direction=<optimized out>, numberTuples=0, sendTuples=<optimized out>, operation=CMD_UPDATE, use_parallel_mode=<optimized out>, planstate=0x5598eb7d3018, estate=0x5598eaeabdd0) at ./build/../src/backend/executor/execMain.c:1646 slot = <optimized out> current_tuple_count = 0 slot = <optimized out> current_tuple_count = <optimized out> #13 standard_ExecutorRun (queryDesc=0x5598eccf9c18, direction=<optimized out>, count=0, execute_once=<optimized out>) at ./build/../src/backend/executor/execMain.c:364 estate = 0x5598eaeabdd0 operation = CMD_UPDATE dest = 0x5598eb932038 sendTuples = <optimized out> oldcontext = <optimized out> __func__ = "standard_ExecutorRun" #14 0x00005598e95a3ec5 in ProcessQuery (plan=<optimized out>, sourceText=0x5598eb931dd0 "UPDATE origo_email_delivery SET folder_id=$1, created=$2\nWHERE entity_id IN ($3)\nRETURNING entity_id", params=0x5598eb931e80, queryEnv=0x0, dest=0x5598eb932038, completionTag=0x7ffdf2aaeb90 "") at ./build/../src/backend/tcop/pquery.c:161 queryDesc = 0x5598eccf9c18 #15 0x00005598e95a4103 in PortalRunMulti (portal=portal@entry=0x5598eae277a0, isTopLevel=isTopLevel@entry=true, setHoldSnapshot=setHoldSnapshot@entry=true, dest=dest@entry=0x5598eb932038, altdest=0x5598e9b49c00 <donothingDR>, completionTag=completionTag@entry=0x7ffdf2aaeb90 "") at ./build/../src/backend/tcop/pquery.c:1283 pstmt = 0x5598eb4b8b40 active_snapshot_set = true stmtlist_item = 0x5598eb4b8b20 #16 0x00005598e95a43c2 in FillPortalStore (portal=portal@entry=0x5598eae277a0, isTopLevel=isTopLevel@entry=true) at ./build/../src/backend/tcop/pquery.c:1030 treceiver = 0x5598eb932038 completionTag = "\000\353\252\362\375\177\000\000f\221o\351\230U\000\000\370\031M\231D\177\000\000\020\215K\353\230U\000\000\320\353\252\362\375\177\000\000?<k\351\230U\000\000\020\037\223\353\230U\000\000\310J\004\353\230U\000" __func__ = "FillPortalStore" #17 0x00005598e95a4f5f in PortalRun (portal=portal@entry=0x5598eae277a0, count=count@entry=5000, isTopLevel=isTopLevel@entry=true, run_once=<optimized out>, dest=dest@entry=0x5598ead9a850, altdest=altdest@entry=0x5598ead9a850, completionTag=0x7ffdf2aaf020 "") at ./build/../src/backend/tcop/pquery.c:765 save_exception_stack = 0x7ffdf2aaeef0 save_context_stack = 0x0 local_sigjmp_buf = {{__jmpbuf = {0, 7709727683193285437, 3, 94115275677280, 94115264100256, 0, 7709727683153439549, 4482281864764795709}, __mask_was_saved = 0, __saved_mask = {__val = {139932367421736, 140728674741520, 94115275677136, 100, 623927117367069, 140728674741552, 94115239309042, 140724603453440, 112, 94115263521584, 94115275677280, 94115273415056, 0, 140728674741584, 94115239780433, 3}}}} result = <optimized out> nprocessed = <optimized out> saveTopTransactionResourceOwner = 0x5598eade7728 saveTopTransactionContext = 0x5598eb89f250 saveActivePortal = 0x0 saveResourceOwner = 0x5598eade7728 savePortalContext = 0x0 saveMemoryContext = 0x5598ead9a330 __func__ = "PortalRun" #18 0x00005598e95a2541 in exec_execute_message (max_rows=5000, portal_name=0x5598ead9a440 "bda") at ./build/../src/backend/tcop/postgres.c:2090 completed = <optimized out> execute_is_fetch = false completionTag = "\000ELECT 1\000\061\000\000\230U\000\000\240\360\252\362\375\177\000\000\243\245m\351\230U\000\000\003\000\000\000\000\000\000\000\362.h\351T\000\000\000\300\270\331\352\230U\000\000\000\000\000\000\000\004\000" save_log_statement_stats = false was_logged = false dest = DestRemoteExecute receiver = 0x5598ead9a850 portal = 0x5598eae277a0 sourceText = 0x5598eb931dd0 "UPDATE origo_email_delivery SET folder_id=$1, created=$2\nWHERE entity_id IN ($3)\nRETURNING entity_id" prepStmtName = 0x5598eb931e60 "cached-26ada7f9" portalParams = 0x5598eb931e80 is_xact_command = <optimized out> msec_str = "P\360\252\362\375\177\000\000P\360\252\362\375\177\000\000\060\360\252\362\375\177\000\000V:H\351\230U\000" dest = <optimized out> receiver = <optimized out> portal = <optimized out> completed = <optimized out> completionTag = <optimized out> sourceText = <optimized out> prepStmtName = <optimized out> portalParams = <optimized out> save_log_statement_stats = <optimized out> is_xact_command = <optimized out> execute_is_fetch = <optimized out> was_logged = <optimized out> msec_str = <optimized out> __errno_location = <optimized out> __errno_location = <optimized out> __errno_location = <optimized out> __errno_location = <optimized out> __errno_location = <optimized out> #19 PostgresMain (argc=<optimized out>, argv=argv@entry=0x5598eadd22e0, dbname=<optimized out>, username=<optimized out>) at ./build/../src/backend/tcop/postgres.c:4297 portal_name = 0x5598ead9a440 "bda" max_rows = <optimized out> firstchar = <optimized out> input_message = {data = 0x5598ead9a440 "bda", len = 8, maxlen = 1024, cursor = 8} local_sigjmp_buf = {{__jmpbuf = {140728674741936, 7709727683268782909, 1, 94115263750856, 94115263750880, 140728674742800, 7709727683172313917, 4482281862789147453}, __mask_was_saved = 1, __saved_mask = {__val = {0, 140728674746062, 140728674746010, 140728674746322, 0, 0, 140728674742800, 140728674742208, 10797087918629389056, 140728674742368, 94115239888639, 206158430256, 140728674742392, 140728674742192, 10797087918629389056, 74}}}} send_ready_for_query = false disable_idle_in_transaction_timeout = false __func__ = "PostgresMain" #20 0x00005598e952906b in BackendRun (port=0x5598eadc0570, port=0x5598eadc0570) at ./build/../src/backend/postmaster/postmaster.c:4431 av = 0x5598eadd22e0 maxac = <optimized out> ac = 1 i = 1 av = <optimized out> maxac = <optimized out> ac = <optimized out> i = <optimized out> __errno_location = <optimized out> __errno_location = <optimized out> __errno_location = <optimized out> #21 BackendStartup (port=0x5598eadc0570) at ./build/../src/backend/postmaster/postmaster.c:4122 bn = <optimized out> pid = <optimized out> bn = <optimized out> pid = <optimized out> __errno_location = <optimized out> __errno_location = <optimized out> save_errno = <optimized out> __errno_location = <optimized out> __errno_location = <optimized out> #22 ServerLoop () at ./build/../src/backend/postmaster/postmaster.c:1704 port = <optimized out> i = <optimized out> rmask = {fds_bits = {64, 0 <repeats 15 times>}} selres = <optimized out> now = <optimized out> readmask = {fds_bits = {448, 0 <repeats 15 times>}} nSockets = <optimized out> last_lockfile_recheck_time = 1570582948 last_touch_time = 1570580782 __func__ = "ServerLoop" #23 0x00005598e952a043 in PostmasterMain (argc=5, argv=0x5598ead93060) at ./build/../src/backend/postmaster/postmaster.c:1377 opt = <optimized out> status = <optimized out> userDoption = <optimized out> listen_addr_saved = <optimized out> i = <optimized out> output_config_variable = <optimized out> __func__ = "PostmasterMain" #24 0x00005598e92a0cb6 in main (argc=5, argv=0x5598ead93060) at ./build/../src/backend/main/main.c:228 No locals.
^ permalink raw reply [nested|flat] 15+ messages in thread

* Re: Segmentation fault with PG-12
@ 2019-10-09 14:16  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Andreas Joseph Krogh <andreas@visena.com>
  0 siblings, 2 replies; 15+ messages in thread

From: Tom Lane @ 2019-10-09 14:16 UTC (permalink / raw)
  To: Andreas Joseph Krogh <andreas@visena.com>; +Cc: pgsql-general@lists.postgresql.org; Andres Freund <andres@anarazel.de>

Andreas Joseph Krogh <andreas@visena.com> writes:
> Attached is output from "bt full". Is this helpful? 

Well, it shows that the failure is occurring while trying to evaluate
a variable in a trigger's WHEN clause during
"UPDATE origo_email_delivery SET folder_id=$1, created=$2\nWHERE entity_id IN ($3)\nRETURNING entity_id"
And I'd bet that the root cause is something to do with Andres' tuple slot
work.  But (at least to my eye) it's not apparent exactly what's wrong.

Can you show us the table definition and associated trigger definitions
for origo_email_delivery?

This doesn't seem to correlate with your original report, btw,
as that claimed the crash was during COMMIT.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Segmentation fault with PG-12
@ 2019-10-09 14:36  Andreas Joseph Krogh <andreas@visena.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 1 reply; 15+ messages in thread

From: Andreas Joseph Krogh @ 2019-10-09 14:36 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-general@lists.postgresql.org; Andres Freund <andres@anarazel.de>

På onsdag 09. oktober 2019 kl. 16:16:37, skrev Tom Lane <tgl@sss.pgh.pa.us 
<mailto:tgl@sss.pgh.pa.us>>: Andreas Joseph Krogh <andreas@visena.com> writes:
 > Attached is output from "bt full". Is this helpful?

 Well, it shows that the failure is occurring while trying to evaluate
 a variable in a trigger's WHEN clause during
 "UPDATE origo_email_delivery SET folder_id=$1, created=$2\nWHERE entity_id IN 
($3)\nRETURNING entity_id"
 And I'd bet that the root cause is something to do with Andres' tuple slot
 work. But (at least to my eye) it's not apparent exactly what's wrong.

 Can you show us the table definition and associated trigger definitions
 for origo_email_delivery?

 This doesn't seem to correlate with your original report, btw,
 as that claimed the crash was during COMMIT.

 regards, tom lane FWIW: It doesn't always happen when that UPDATE-statement 
is issued, so it's not reproducable. We'll see what the next core-dump gives us.
Is it OK if I send you the table/trigger-definitions off-list? -- Andreas 
Joseph Krogh CTO / Partner - Visena AS Mobile: +47 909 56 963 andreas@visena.com
 <mailto:andreas@visena.com> www.visena.com <https://www.visena.com;  
<https://www.visena.com;

^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Segmentation fault with PG-12
@ 2019-10-09 14:42  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Andreas Joseph Krogh <andreas@visena.com>
  0 siblings, 0 replies; 15+ messages in thread

From: Tom Lane @ 2019-10-09 14:42 UTC (permalink / raw)
  To: Andreas Joseph Krogh <andreas@visena.com>; +Cc: pgsql-general@lists.postgresql.org; Andres Freund <andres@anarazel.de>

Andreas Joseph Krogh <andreas@visena.com> writes:
> Is it OK if I send you the table/trigger-definitions off-list?

Sure, but please share with Andres [cc'ed] as well.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Segmentation fault with PG-12
@ 2019-10-10 05:25  Andres Freund <andres@anarazel.de>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 2 replies; 15+ messages in thread

From: Andres Freund @ 2019-10-10 05:25 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Andreas Joseph Krogh <andreas@visena.com>; pgsql-general@lists.postgresql.org

On 2019-10-09 10:16:37 -0400, Tom Lane wrote:
> Andreas Joseph Krogh <andreas@visena.com> writes:
> > Attached is output from "bt full". Is this helpful? 
> 
> Well, it shows that the failure is occurring while trying to evaluate
> a variable in a trigger's WHEN clause during
> "UPDATE origo_email_delivery SET folder_id=$1, created=$2\nWHERE entity_id IN ($3)\nRETURNING entity_id"
> And I'd bet that the root cause is something to do with Andres' tuple slot
> work.  But (at least to my eye) it's not apparent exactly what's wrong.

It looks like this could "just" be another report of #16036, which was
already fixed in:

commit d986d4e87f61c68f52c68ebc274960dc664b7b4e
Author: Andres Freund <andres@anarazel.de>
Date:   2019-10-04 11:59:34 -0700

    Fix crash caused by EPQ happening with a before update trigger present.


> This doesn't seem to correlate with your original report, btw,
> as that claimed the crash was during COMMIT.

That however, would be confusing, unless there's some deferred trigger
that causes another update, which then fires a before update trigger
causing the problem.

Greetings,

Andres Freund





^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Segmentation fault with PG-12
@ 2019-10-10 07:05  Andreas Joseph Krogh <andreas@visena.com>
  parent: Andres Freund <andres@anarazel.de>
  1 sibling, 1 reply; 15+ messages in thread

From: Andreas Joseph Krogh @ 2019-10-10 07:05 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-general@lists.postgresql.org; Torstein Tauno Svendsen <torstei@visena.com>

På torsdag 10. oktober 2019 kl. 07:25:26, skrev Andres Freund <
andres@anarazel.de <mailto:andres@anarazel.de>>: On 2019-10-09 10:16:37 -0400, 
Tom Lane wrote:
 > Andreas Joseph Krogh <andreas@visena.com> writes:
 > > Attached is output from "bt full". Is this helpful?
 >
 > Well, it shows that the failure is occurring while trying to evaluate
 > a variable in a trigger's WHEN clause during
 > "UPDATE origo_email_delivery SET folder_id=$1, created=$2\nWHERE entity_id 
IN ($3)\nRETURNING entity_id"
 > And I'd bet that the root cause is something to do with Andres' tuple slot
 > work. But (at least to my eye) it's not apparent exactly what's wrong.

 It looks like this could "just" be another report of #16036, which was
 already fixed in:

 commit d986d4e87f61c68f52c68ebc274960dc664b7b4e
 Author: Andres Freund <andres@anarazel.de>
 Date: 2019-10-04 11:59:34 -0700

 Fix crash caused by EPQ happening with a before update trigger present.

(Tom: This mail is only viewable as text/html, to if you're reading the 
text/plain version it will seem "hashed") Aha, that whould be 
60e97d63e5d19098e11fa32431a20eea820e2ae9 in REL_12_STABLE We'll build and run 
HEAD of REL_12_STABLE, and report back. > This doesn't seem to correlate with 
your original report, btw,
 > as that claimed the crash was during COMMIT.

 That however, would be confusing, unless there's some deferred trigger
 that causes another update, which then fires a before update trigger
 causing the problem.

 Greetings,

 Andres Freund We have a deferred trigger which updates origo_email_delivery: 
CREATE OR REPLACE FUNCTIONorigo_index_email_props_tf() RETURNS TRIGGER AS $$ 
declare v_prop origo_email_message_property; BEGIN v_prop := NEW; UPDATE 
origo_email_delivery SET is_seen = v_prop.is_seen, followup_id = 
v_prop.followup_id, is_replied = v_prop.is_replied, is_forwarded = 
v_prop.is_forwarded, is_draft = v_prop.is_draft, is_done = v_prop.is_done, 
is_flagged = v_prop.is_flagged, modseq =greatest(modseq, v_prop.modseq) WHERE 
message_id = v_prop.message_idAND owner_id = v_prop.owner_id; RETURN NEW; END; 
$$LANGUAGE plpgsql; CREATE CONSTRAINT TRIGGER origo_index_email_props_t AFTER 
INSERT OR UPDATE ON origo_email_message_property DEFERRABLE INITIALLY DEFERRED  
FOR EACH ROWEXECUTE PROCEDURE origo_index_email_props_tf(); .. and then trigger 
the following UPDATE-trigger: CREATE TRIGGER origo_email_delivery_update_t 
BEFORE UPDATE ON origo_email_delivery FOR EACH ROW  WHEN (OLD.folder_id <> NEW
.folder_idOR NEW.is_deleted <> OLD.is_deleted) EXECUTE PROCEDURE 
origo_email_delivery_update_tf(); Maybe that will trigger the bug. Thanks. -- 
Andreas Joseph Krogh CTO / Partner - Visena AS Mobile: +47 909 56 963 
andreas@visena.com <mailto:andreas@visena.com> www.visena.com 
<https://www.visena.com;  <https://www.visena.com;

^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Segmentation fault with PG-12
@ 2019-10-10 07:18  Andres Freund <andres@anarazel.de>
  parent: Andreas Joseph Krogh <andreas@visena.com>
  0 siblings, 1 reply; 15+ messages in thread

From: Andres Freund @ 2019-10-10 07:18 UTC (permalink / raw)
  To: Andreas Joseph Krogh <andreas@visena.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-general@lists.postgresql.org; Torstein Tauno Svendsen <torstei@visena.com>

On 2019-10-10 09:05:06 +0200, Andreas Joseph Krogh wrote:
> (Tom: This mail is only viewable as text/html, to if you're reading the 
> text/plain version it will seem "hashed")

I'm totally not ok with that btw.





^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Segmentation fault with PG-12
@ 2019-10-10 09:50  Andreas Joseph Krogh <andreas@visena.com>
  parent: Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 15+ messages in thread

From: Andreas Joseph Krogh @ 2019-10-10 09:50 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-general@lists.postgresql.org; Torstein Tauno Svendsen <torstei@visena.com>

We had another crash today, and it appears to be the same: #0 
slot_deform_heap_tuple (natts=26, offp=0x5598eba0b968,
 tuple=<optimized out>, slot=0x5598eba0b920)
 at ./build/../src/backend/executor/execTuples.c:895 -- Andreas Joseph Krogh 

^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Segmentation fault with PG-12
@ 2019-10-10 19:32  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Andres Freund <andres@anarazel.de>
  1 sibling, 2 replies; 15+ messages in thread

From: Tom Lane @ 2019-10-10 19:32 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: Andreas Joseph Krogh <andreas@visena.com>; pgsql-general@lists.postgresql.org

Andres Freund <andres@anarazel.de> writes:
> On 2019-10-09 10:16:37 -0400, Tom Lane wrote:
>> Well, it shows that the failure is occurring while trying to evaluate
>> a variable in a trigger's WHEN clause during
>> "UPDATE origo_email_delivery SET folder_id=$1, created=$2\nWHERE entity_id IN ($3)\nRETURNING entity_id"
>> And I'd bet that the root cause is something to do with Andres' tuple slot
>> work.  But (at least to my eye) it's not apparent exactly what's wrong.

> It looks like this could "just" be another report of #16036, which was
> already fixed in:
> commit d986d4e87f61c68f52c68ebc274960dc664b7b4e
> Author: Andres Freund <andres@anarazel.de>
> Date:   2019-10-04 11:59:34 -0700
>     Fix crash caused by EPQ happening with a before update trigger present.

Bingo.  I can reproduce the crash (using concurrent updates of the same
table row, in the schema Andreas sent off-list) on the predecessor of
that commit, but on that commit it's fine.

Andreas, that's a pretty simple patch if you're in a position to
build from source ...

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Segmentation fault with PG-12
@ 2019-10-10 19:46  Andreas Joseph Krogh <andreas@visena.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 15+ messages in thread

From: Andreas Joseph Krogh @ 2019-10-10 19:46 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Andres Freund <andres@anarazel.de>; pgsql-general@lists.postgresql.org


På torsdag 10. oktober 2019 kl. 21:32:38, skrev Tom Lane <tgl@sss.pgh.pa.us 
<mailto:tgl@sss.pgh.pa.us>>: 
Andres Freund <andres@anarazel.de> writes:
 > On 2019-10-09 10:16:37 -0400, Tom Lane wrote:
 >> Well, it shows that the failure is occurring while trying to evaluate
 >> a variable in a trigger's WHEN clause during
 >> "UPDATE origo_email_delivery SET folder_id=$1, created=$2\nWHERE entity_id 
IN ($3)\nRETURNING entity_id"
 >> And I'd bet that the root cause is something to do with Andres' tuple slot
 >> work. But (at least to my eye) it's not apparent exactly what's wrong.

 > It looks like this could "just" be another report of #16036, which was
 > already fixed in:
 > commit d986d4e87f61c68f52c68ebc274960dc664b7b4e
 > Author: Andres Freund <andres@anarazel.de>
 > Date: 2019-10-04 11:59:34 -0700
 > Fix crash caused by EPQ happening with a before update trigger present.

 Bingo. I can reproduce the crash (using concurrent updates of the same
 table row, in the schema Andreas sent off-list) on the predecessor of
 that commit, but on that commit it's fine. 


That's great! 


Andreas, that's a pretty simple patch if you're in a position to
 build from source ...

 regards, tom lane 


Yes, we've built a new .deb-package from 
f224c7c11ea7be2751e3342e11317070ffb5622d in REL_12_STABLE which we'll deploy 
tonight. 
Thanks! 


-- 
Andreas Joseph Krogh 

^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Segmentation fault with PG-12
@ 2019-10-10 20:21  Andres Freund <andres@anarazel.de>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 1 reply; 15+ messages in thread

From: Andres Freund @ 2019-10-10 20:21 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Andreas Joseph Krogh <andreas@visena.com>; pgsql-general@lists.postgresql.org

On 2019-10-10 15:32:38 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > On 2019-10-09 10:16:37 -0400, Tom Lane wrote:
> >> Well, it shows that the failure is occurring while trying to evaluate
> >> a variable in a trigger's WHEN clause during
> >> "UPDATE origo_email_delivery SET folder_id=$1, created=$2\nWHERE entity_id IN ($3)\nRETURNING entity_id"
> >> And I'd bet that the root cause is something to do with Andres' tuple slot
> >> work.  But (at least to my eye) it's not apparent exactly what's wrong.
> 
> > It looks like this could "just" be another report of #16036, which was
> > already fixed in:
> > commit d986d4e87f61c68f52c68ebc274960dc664b7b4e
> > Author: Andres Freund <andres@anarazel.de>
> > Date:   2019-10-04 11:59:34 -0700
> >     Fix crash caused by EPQ happening with a before update trigger present.
> 
> Bingo.  I can reproduce the crash (using concurrent updates of the same
> table row, in the schema Andreas sent off-list) on the predecessor of
> that commit, but on that commit it's fine.

Cool, and thanks for checking.





^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Segmentation fault with PG-12
@ 2019-10-12 11:36  Andreas Joseph Krogh <andreas@visena.com>
  parent: Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 15+ messages in thread

From: Andreas Joseph Krogh @ 2019-10-12 11:36 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-general@lists.postgresql.org


På torsdag 10. oktober 2019 kl. 22:21:13, skrev Andres Freund <
andres@anarazel.de <mailto:andres@anarazel.de>>: 
On 2019-10-10 15:32:38 -0400, Tom Lane wrote:
 > Andres Freund <andres@anarazel.de> writes:
 > > On 2019-10-09 10:16:37 -0400, Tom Lane wrote:
 > >> Well, it shows that the failure is occurring while trying to evaluate
 > >> a variable in a trigger's WHEN clause during
 > >> "UPDATE origo_email_delivery SET folder_id=$1, created=$2\nWHERE 
entity_id IN ($3)\nRETURNING entity_id"
 > >> And I'd bet that the root cause is something to do with Andres' tuple 
slot
 > >> work. But (at least to my eye) it's not apparent exactly what's wrong.
 >
 > > It looks like this could "just" be another report of #16036, which was
 > > already fixed in:
 > > commit d986d4e87f61c68f52c68ebc274960dc664b7b4e
 > > Author: Andres Freund <andres@anarazel.de>
 > > Date: 2019-10-04 11:59:34 -0700
 > > Fix crash caused by EPQ happening with a before update trigger present.
 >
 > Bingo. I can reproduce the crash (using concurrent updates of the same
 > table row, in the schema Andreas sent off-list) on the predecessor of
 > that commit, but on that commit it's fine.

 Cool, and thanks for checking. 


No crashes in production after deploying the fix. 


-- 
Andreas Joseph Krogh 

^ permalink  raw  reply  [nested|flat] 15+ messages in thread


end of thread, other threads:[~2019-10-12 11:36 UTC | newest]

Thread overview: 15+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-10-08 15:15 Segmentation fault with PG-12 Andreas Joseph Krogh <andreas@visena.com>
2019-10-08 15:24 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-10-08 18:40   ` Andreas Joseph Krogh <andreas@visena.com>
2019-10-09 11:21   ` Andreas Joseph Krogh <andreas@visena.com>
2019-10-09 14:16     ` Tom Lane <tgl@sss.pgh.pa.us>
2019-10-09 14:36       ` Andreas Joseph Krogh <andreas@visena.com>
2019-10-09 14:42         ` Tom Lane <tgl@sss.pgh.pa.us>
2019-10-10 05:25       ` Andres Freund <andres@anarazel.de>
2019-10-10 07:05         ` Andreas Joseph Krogh <andreas@visena.com>
2019-10-10 07:18           ` Andres Freund <andres@anarazel.de>
2019-10-10 09:50             ` Andreas Joseph Krogh <andreas@visena.com>
2019-10-10 19:32         ` Tom Lane <tgl@sss.pgh.pa.us>
2019-10-10 19:46           ` Andreas Joseph Krogh <andreas@visena.com>
2019-10-10 20:21           ` Andres Freund <andres@anarazel.de>
2019-10-12 11:36             ` Andreas Joseph Krogh <andreas@visena.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox