Re: segmentation fault when cassert enabled - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: segmentation fault when cassert enabled
Date
Msg-id c75077cd-a1a7-9a2d-5dc6-4d3d8acfaafa@2ndquadrant.com
Whole thread Raw
In response to Re: segmentation fault when cassert enabled  (Jehan-Guillaume de Rorthais <jgdr@dalibo.com>)
Responses Re: segmentation fault when cassert enabled  (Jehan-Guillaume de Rorthais <jgdr@dalibo.com>)
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: "曾文旌(义从)"
Date:
Subject: Re: [Proposal] Global temporary tables
Next
From: Andrew Dunstan
Date:
Subject: Re: TAP tests aren't using the magic words for Windows file access