pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: segmentation fault when cassert enabled
Date: Wed, 6 Nov 2019 14:34:38 +0100
Message-ID: <c75077cd-a1a7-9a2d-5dc6-4d3d8acfaafa@2ndquadrant.com> (raw)
In-Reply-To: <20191105172918.3e32a446@firost>
References: <20191025175929.7e90dbf5@firost>
	<18714.1572020918@sss.pgh.pa.us>
	<20191105172918.3e32a446@firost>

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





view thread (17+ messages)  latest in thread

Message-ID: <c75077cd-a1a7-9a2d-5dc6-4d3d8acfaafa@2ndquadrant.com>
Permalink:  ../c75077cd-a1a7-9a2d-5dc6-4d3d8acfaafa@2ndquadrant.com/
Also on:    postgresql.org/message-id/c75077cd-a1a7-9a2d-5dc6-4d3d8acfaafa@2ndquadrant.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: peter.eisentraut@2ndquadrant.com, jgdr@dalibo.com, tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org
  Subject: Re: segmentation fault when cassert enabled
  In-Reply-To: <c75077cd-a1a7-9a2d-5dc6-4d3d8acfaafa@2ndquadrant.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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