Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1enkQe-0007V7-PY for pgsql-bugs@arkaria.postgresql.org; Mon, 19 Feb 2018 12:20:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1enkQd-0005RC-JH for pgsql-bugs@arkaria.postgresql.org; Mon, 19 Feb 2018 12:20:19 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1enkQd-0005Qs-A6 for pgsql-bugs@lists.postgresql.org; Mon, 19 Feb 2018 12:20:19 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1enkQa-0006bk-GS for pgsql-bugs@postgresql.org; Mon, 19 Feb 2018 12:20:18 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id A1987B3E0D5A for ; Mon, 19 Feb 2018 05:20:14 -0700 (MST) Date: Mon, 19 Feb 2018 05:20:14 -0700 (MST) From: Sudalai To: pgsql-bugs@postgresql.org Message-ID: <1519042814659-0.post@n3.nabble.com> Subject: Segmentation Fault in logical decoding get/peek API MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi everyone, PostgreSQL backend crashing with segmentation fault 11, while consuming big transaction changes using pg_logical_slot_(peek|get)_changes. We are using postgresql version 9.5.10. About the big transaction : pg_xlog_dump shows 161426 records, and it spread across 3 WAL files. BackTace of the backend : Program received signal SIGSEGV, Segmentation fault. ReorderBufferCommit (rb=0xd17dc8, xid=, commit_lsn=7224098593984, end_lsn=, commit_time=, origin_id=, origin_lsn=0) at /home/test/compile/../postgresql-9.5.10/src/backend/replication/logical/reorderbuffer.c:1380 1380 change->action = REORDER_BUFFER_CHANGE_INSERT; #0 ReorderBufferCommit (rb=0xd17dc8, xid=, commit_lsn=7224098593984, end_lsn=, commit_time=, origin_id=, origin_lsn=0) at /home/test/compile/../postgresql-9.5.10/src/backend/replication/logical/reorderbuffer.c:1380 #1 0x0000000000675cd1 in DecodeCommit (ctx=0xcffdb8, record=) at /home/test/compile/../postgresql-9.5.10/src/backend/replication/logical/decode.c:549 #2 DecodeXactOp (ctx=0xcffdb8, record=) at /home/test/compile/../postgresql-9.5.10/src/backend/replication/logical/decode.c:234 #3 LogicalDecodingProcessRecord (ctx=0xcffdb8, record=) at /home/test/compile/../postgresql-9.5.10/src/backend/replication/logical/decode.c:111 #4 0x00000000006772e5 in pg_logical_slot_get_changes_guts (fcinfo=0x7ffea1ef0b90, confirm=0 '\000', binary=0 '\000') at /home/test/compile/../postgresql-9.5.10/src/backend/replication/logical/logicalfuncs.c:442 #5 0x00000000005c4074 in ExecMakeTableFunctionResult (funcexpr=0xce55a0, econtext=0xce5190, argContext=, expectedDesc=0xce6360, randomAccess=0 '\000') at /home/test/compile/../postgresql-9.5.10/src/backend/executor/execQual.c:2189 #6 0x00000000005d8652 in FunctionNext (node=0xce5080) at /home/test/compile/../postgresql-9.5.10/src/backend/executor/nodeFunctionscan.c:95 #7 0x00000000005c4d73 in ExecScanFetch (node=0xce5080, accessMtd=0x5d83a0 , recheckMtd=0x5d7cd0 ) at /home/test/compile/../postgresql-9.5.10/src/backend/executor/execScan.c:95 #8 ExecScan (node=0xce5080, accessMtd=0x5d83a0 , recheckMtd=0x5d7cd0 ) at /home/test/compile/../postgresql-9.5.10/src/backend/executor/execScan.c:145 #9 0x00000000005bd808 in ExecProcNode (node=0xce5080) at /home/test/compile/../postgresql-9.5.10/src/backend/executor/execProcnode.c:442 #10 0x00000000005caca6 in fetch_input_tuple (aggstate=0xce4808) at /home/test/compile/../postgresql-9.5.10/src/backend/executor/nodeAgg.c:487 #11 0x00000000005cc286 in agg_retrieve_direct (node=) at /home/test/compile/../postgresql-9.5.10/src/backend/executor/nodeAgg.c:1683 #12 ExecAgg (node=) at /home/test/compile/../postgresql-9.5.10/src/backend/executor/nodeAgg.c:1508 #13 0x00000000005bd748 in ExecProcNode (node=0xce4808) at /home/test/compile/../postgresql-9.5.10/src/backend/executor/execProcnode.c:496 #14 0x00000000005bbfdf in ExecutePlan (queryDesc=0xce93a8, direction=, count=0) at /home/test/compile/../postgresql-9.5.10/src/backend/executor/execMain.c:1549 #15 standard_ExecutorRun (queryDesc=0xce93a8, direction=, count=0) at /home/test/compile/../postgresql-9.5.10/src/backend/executor/execMain.c:337 #16 0x00000000006c1f57 in PortalRunSelect (portal=0xd2b9c8, forward=, count=0, dest=) at /home/test/compile/../postgresql-9.5.10/src/backend/tcop/pquery.c:942 #17 0x00000000006c31c7 in PortalRun (portal=0xd2b9c8, count=9223372036854775807, isTopLevel=1 '\001', dest=0xced478, altdest=0xced478, completionTag=0x7ffea1ef1440 "") at /home/test/compile/../postgresql-9.5.10/src/backend/tcop/pquery.c:786 #18 0x00000000006bff50 in exec_simple_query (query_string=0xccd7e8 "select count(*) from pg_logical_slot_peek_changes('pg_slotnew',null,1000);") at /home/test/compile/../postgresql-9.5.10/src/backend/tcop/postgres.c:1096 #19 0x00000000006c157c in PostgresMain (argc=, argv=, dbname=0xc36100 "sasdb", username=) at /home/test/compile/../postgresql-9.5.10/src/backend/tcop/postgres.c:4049 #20 0x0000000000665d1c in BackendRun (argc=, argv=) at /home/test/compile/../postgresql-9.5.10/src/backend/postmaster/postmaster.c:4264 #21 BackendStartup (argc=, argv=) at /home/test/compile/../postgresql-9.5.10/src/backend/postmaster/postmaster.c:3938 #22 ServerLoop (argc=, argv=) at /home/test/compile/../postgresql-9.5.10/src/backend/postmaster/postmaster.c:1703 #23 PostmasterMain (argc=, argv=) at /home/test/compile/../postgresql-9.5.10/src/backend/postmaster/postmaster.c:1311 #24 0x00000000005f4309 in main (argc=3, argv=0xc34b60) at /home/test/compile/../postgresql-9.5.10/src/backend/main/main.c:228 Is it a bug? Is any way i could avoid this? If you guys need any information for debugging, kindly let me know. Thanks in advance, Sudalai ----- sudalai -- Sent from: http://www.postgresql-archive.org/PostgreSQL-bugs-f2117394.html