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 1iSLSU-0008Pe-EH for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Nov 2019 13:34:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iSLST-0004fj-7n for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Nov 2019 13:34:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iSLSS-0004fc-9i for pgsql-hackers@lists.postgresql.org; Wed, 06 Nov 2019 13:34:49 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iSLSO-0007sB-Fz for pgsql-hackers@lists.postgresql.org; Wed, 06 Nov 2019 13:34:47 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 9EC87603; Wed, 6 Nov 2019 08:34:41 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Wed, 06 Nov 2019 08:34:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=A1FUT37q89ZwcMGP1JsxuPMfJSNHsudc6TsmZiCok eU=; b=MarnJL8tO3ssHtiQubfLe6ipl9ohzBQYs5lIbEI67GWiqgtyAljk4OuK6 fTSiq2SJzIX1LoGSl8YWBFr2Sc6WcMXbAZg93DPwbSXwznhkdBbAJIlOlbkyHMht qUSzHEKQlKa6pIZWDbuFv3jMD+EoEnoqJEHc8Ho9f9ogcKJAGESDPYb4vn+FXRR8 Q09BM1jZmRFJoZ4Xr8Mm2G1Y8zoGRxzWcDTd4szt99DxfDLRXYsrVnJCa1o4Vl8H m8BFDEb7b085GKwHxmh/K0YSye0iHKrU/0ZDKBhvnrF7fbrojACJMDJXxKrBWpna lHfnxQGgo/gXEaxUARHNgRlL3QMiQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedruddujedgheegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhfhokffffgggjggtgfesth ejredttdefjeenucfhrhhomheprfgvthgvrhcugfhishgvnhhtrhgruhhtuceophgvthgv rhdrvghishgvnhhtrhgruhhtsedvnhguqhhurggurhgrnhhtrdgtohhmqeenucffohhmrg hinhepvdhnughquhgrughrrghnthdrtghomhenucfkphepleefrddvgedvrddugeejrdej leenucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhdrvghishgvnhhtrhgruhhtse dvnhguqhhurggurhgrnhhtrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from april.pezone.net (p5df2934f.dip0.t-ipconnect.de [93.242.147.79]) by mail.messagingengine.com (Postfix) with ESMTPA id E44103060057; Wed, 6 Nov 2019 08:34:39 -0500 (EST) Subject: Re: segmentation fault when cassert enabled To: Jehan-Guillaume de Rorthais , Tom Lane References: <20191025175929.7e90dbf5@firost> <18714.1572020918@sss.pgh.pa.us> <20191105172918.3e32a446@firost> Cc: pgsql-hackers@lists.postgresql.org From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: Date: Wed, 6 Nov 2019 14:34:38 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20191105172918.3e32a446@firost> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-11-05 17:29, Jehan-Guillaume de Rorthais wrote: > My best bet so far is that logicalrep_relmap_invalidate_cb is not called after > the DDL on the subscriber so the relmap cache is not invalidated. So we end up > with slot->tts_tupleDescriptor->natts superior than rel->remoterel->natts in > slot_store_cstrings, leading to the overflow on attrmap and the sigsev. It looks like something like that is happening. But it shouldn't. Different table schemas on publisher and subscriber are well supported, so this must be an edge case of some kind. Please continue investigating. > By the way, I noticed attrmap is declared as AttrNumber * in struct > LogicalRepRelMapEntry, AttrNumber being typedef'd as an int16. However, attrmap > is allocated based on sizeof(int) in logicalrep_rel_open: > > entry->attrmap = palloc(desc->natts * sizeof(int)); > > It doesn't look like a major problem, it just allocates more memory than > needed. Right. I have committed a fix for this. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services