Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iXma2-00019c-7B for pgsql-bugs@arkaria.postgresql.org; Thu, 21 Nov 2019 13:33:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iXma0-0005H5-W0 for pgsql-bugs@arkaria.postgresql.org; Thu, 21 Nov 2019 13:33:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iXma0-0005Gu-Nk for pgsql-bugs@lists.postgresql.org; Thu, 21 Nov 2019 13:33:04 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iXmZo-0002JR-H2 for pgsql-bugs@lists.postgresql.org; Thu, 21 Nov 2019 13:33:04 +0000 Received: by mail-wr1-x442.google.com with SMTP id z7so1005888wrl.13 for ; Thu, 21 Nov 2019 05:32:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=ub8SkEVJNArvkbU/K3aeziZ97lOQoNJLG9SvxCxSHNg=; b=xXL8YW9LSmxAKK2gw1ZN85u24sg/RJEBvtCno0SUPDfPYxJbUJ+pmOWXOxevYcwtL+ gKzOBW90hwWeCjoS47LdHripOkCccVVLnD2L1LFULQMXV4rw4NEa8wtCbj02D0bS3OJT yHHgygnSXnLW7YSkEXHsDjBXtYKjdCVHDKnYoJwFxhQ+ZPN6QLvlCcne5kv4+igLw7Wu ce4EMN3llF9yecwr8UnU2UjEgtqP9fPSYWK4DuHFgu+dcf7RhiAOjQOybLBUx7u7RZfy 5wAD5BdE8K/4MYzY94rbLQGm/GhlrbMa80cAR+9V1I3i3LTH6HUOsEFq7yzMGUkvxvg2 TjyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=ub8SkEVJNArvkbU/K3aeziZ97lOQoNJLG9SvxCxSHNg=; b=ucJE/Rh+ePHd0uAIfC4ZxSd3eAgXvrpuWW0lGaiciYdJoy9WNcKtuR7CE6jZnUiQ7+ 6FW5UUwLWTZt1FbMW12ixU4cJk6F7FVVygZ818wlWzq0aPwrlzfhCte0gv+JDeZdnZxr WIa3uFtPBNHA1+XA+xqkXQZNj9U9mu14m8LdTH2nW9OXAfRPNpwmJ++0EoZQqaOfa0nF d6KYaoh180OtDc06btre/ohLMr5/Rog7Fcn1om4xVIGojAzijg6fQ48mMz58qFd8RDOs 9YzySw5O432e7xDgCPC5S4jQ1ezlUKstLqOdOlgk3Z2riro9V/3V6NG5ctH/GPT1o07D 7qRA== X-Gm-Message-State: APjAAAUhbRUFkCyC3/wojZ7z7T4bgWUJqAQ7o6PXxRPRSO0OXJDq6oIj GCP8SPfC8OiJ9HQujw4ow6aKtQ== X-Google-Smtp-Source: APXvYqxZOCHDQDBV4rXhi+4qqyZASh+DI7XMBZ67AZakuThGkPZozjZqySqlp795V+cK2NlTz0aOOA== X-Received: by 2002:adf:e886:: with SMTP id d6mr3911410wrm.112.1574343162070; Thu, 21 Nov 2019 05:32:42 -0800 (PST) Received: from localhost (static-84-42-175-93.net.upcbroadband.cz. [84.42.175.93]) by smtp.gmail.com with ESMTPSA id 2sm3283538wrq.31.2019.11.21.05.32.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Nov 2019 05:32:38 -0800 (PST) Date: Thu, 21 Nov 2019 14:32:37 +0100 From: Tomas Vondra To: =?utf-8?Q?Ond=C5=99ej?= Jirman Cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16129: Segfault in tts_virtual_materialize in logical replication worker Message-ID: <20191121133237.vgxoilemblaqmstu@development> References: <16129-a0c0f48e71741e5f@postgresql.org> <20191121103940.gpadc7xmssl63sad@development> <20191121115326.arierrbeok6we5sv@core.my.home> <20191121125913.4dhhwpbw67vqx37o@core.my.home> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191121125913.4dhhwpbw67vqx37o@core.my.home> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, Nov 21, 2019 at 01:59:13PM +0100, Ondřej Jirman wrote: >On Thu, Nov 21, 2019 at 12:53:26PM +0100, postgresql wrote: >> Hello, >> >> On Thu, Nov 21, 2019 at 11:39:40AM +0100, Tomas Vondra wrote: >> > On Thu, Nov 21, 2019 at 01:14:18AM +0000, PG Bug reporting form wrote: >> > > Replication of one of my databases (running on ARMv7 machine) started >> > > segfaulting on the subscriber side (x86_64) like this: >> > > >> > > #0 0x00007fc259739917 in __memmove_sse2_unaligned_erms () from >> > > /usr/lib/libc.so.6 >> > > #1 0x000055d033e93d44 in memcpy (__len=620701425, __src=, >> > > __dest=0x55d0356da804) at /usr/include/bits/string_fortified.h:34 >> > > #2 tts_virtual_materialize (slot=0x55d0356da3b8) at execTuples.c:235 >> > > #3 0x000055d033e94d32 in ExecFetchSlotHeapTuple >> > > (slot=slot@entry=0x55d0356da3b8, materialize=materialize@entry=true, >> > > shouldFree=shouldFree@entry=0x7fff0e7cf387) at execTuples.c:1624 >> >> I forgot to add that publisher is still PostgreSQL 11.5. >> > >I can also add that I have data checksumming enabled on both ends, and >it did not detect any corruption: > ># pg_verify_checksums -D /var/lib/postgres/data >Checksum scan completed >Data checksum version: 1 >Files scanned: 1751 >Blocks scanned: 86592 >Bad checksums: 0 > ># pg_checksums /var/lib/postgres/data >Checksum operation completed >Files scanned: 22777 >Blocks scanned: 3601527 >Bad checksums: 0 >Data checksum version: 1 > >WAL log on the publisher is also dumpable to a state hours after the issues >started: > >I've put the dump here, if it's of any use: https://megous.com/dl/tmp/wal_dump.txt > >Dump ends with: > >pg_waldump: FATAL: error in WAL record at 2/BBE0E538: invalid record length at 2/BBE0E5A8: wanted 24, got 0 > >But that seems normal. I get that error on my other database clusters, too. > >I managed to extract the failing logical decoding data from the publisher, if >that helps: > > >SELECT * FROM pg_logical_slot_peek_binary_changes('l5_hometv', NULL, NULL, 'proto_version', '1', 'publication_names', 'pub'); > > 2/BBD86EA0 | 56395 | \x4200000002bbd880b800023acd790ce5510000dc4b > 2/BBD87E90 | 56395 | \x5200004a687075626c696300766964656f73006400080169640000000017ffffffff007469746c650000000019ffffffff00636f7665725f696d6167650000000011ffffffff006d657461646174610000000edafffffff >f0063617465676f72790000000017ffffffff007075626c6973686564000000043affffffff006164646564000000045affffffff00706c617965640000000010ffffffff > 2/BBD87E90 | 56395 | \x5500004a684e0008740000000438333933740000005650617a6465726b613a204f206dc3a964696120736520706f7665646520626f6a2e204b64796279206ec3a17320706f6c6974696369206d696c6f76616c692c20627 >96c6f206279206ec49b636f20c5a17061746ec49b7574000001397b226964223a20226430313064343430303965323131656162323539616331663662323230656538222c202264617465223a2022323031392d31312d3138222c20226e616d65223a20 >2250617a6465726b613a204f206dc3a964696120736520706f7665646520626f6a2e204b64796279206ec3a17320706f6c6974696369206d696c6f76616c692c2062796c6f206279206ec49b636f20c5a17061746ec49b222c2022696d616765223a202 >268747470733a2f2f63646e2e7873642e637a2f726573697a652f63353535656239633131353333313632386164666539396237343534353731655f657874726163743d302c302c313931392c313038305f726573697a653d3732302c3430355f2e6a70 >673f686173683d6362316362623836336230353361613561333761346666616439303865303431227d7400000003323432740000000a323031392d31312d3138740000001a323031392d31312d31382031323a35303a30312e383136333736740000000 >174 > 2/BBD880E8 | 56395 | \x430000000002bbd880b800000002bbd880e800023acd790ce551 > Can you show the whole transaction? From the WAL dump it seems it just did a single UPDATE: rmgr: Heap len (rec/tot): 59/ 4075, tx: 56395, lsn: 2/BBD86EA0, prev 2/BBD86E68, desc: LOCK off 2: xid 56395: flags 0 LOCK_ONLY EXCL_LOCK blkref #0: rel 1663/19030/19048 fork main blk 415 (FPW); hole: offset: 56, length: 4176 rmgr: Heap len (rec/tot): 523/ 523, tx: 56395, lsn: 2/BBD87E90, prev 2/BBD86EA0, desc: HOT_UPDATE off 2 xmax 56395 ; new off 9 xmax 0 blkref #0: rel 1663/19030/19048 fork main blk 415 rmgr: Transaction len (rec/tot): 46/ 46, tx: 56395, lsn: 2/BBD880B8, prev 2/BBD87E90, desc: COMMIT 2019-11-20 23:28:47.016273 CET Which fields does it update? regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services