pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: tgl@sss.pgh.pa.us
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: segmentation fault when cassert enabled
Date: Tue, 12 Nov 2019 18:00:43 +0100
Message-ID: <20191112180043.6ee7d1b6@firost> (raw)
In-Reply-To: <20191028.164702.1704313690000434195.horikyota.ntt@gmail.com>
References: <20191025175929.7e90dbf5@firost>
	<18714.1572020918@sss.pgh.pa.us>
	<20191028.164702.1704313690000434195.horikyota.ntt@gmail.com>

On Mon, 28 Oct 2019 16:47:02 +0900 (JST)
Kyotaro Horiguchi <horikyota.ntt@gmail.com> wrote:

> At Fri, 25 Oct 2019 12:28:38 -0400, Tom Lane <tgl@sss.pgh.pa.us> wrote in 
> > Jehan-Guillaume de Rorthais <jgdr@dalibo.com> writes:  
> > > When investigating for the bug reported in thread "logical replication -
> > > negative bitmapset member not allowed", I found a way to seg fault
> > > postgresql only when cassert is enabled.
> > > ...
> > > I hadn't time to digg further yet. However, I don't understand why this
> > > crash is triggered when cassert is enabled.  
> > 
> > Most likely, it's not so much assertions that provoke the crash as
> > CLOBBER_FREED_MEMORY, ie the actual problem here is use of already-freed
> > memory.  
> 
> Agreed.
> 
> By the way I didn't get a crash by Jehan's script with the
> --enable-cassert build of the master HEAD of a few days ago.

I am now working with HEAD and I can confirm I am able to make it crash 99% of
the time using my script.
It feels like a race condition between cache invalidation and record
processing from worker.c. Make sure you have enough write activity during the
test.

> FWIW I sometimes got SEGVish crashes or mysterious misbehavor when
> some structs were changed and I didn't do "make clean". Rarely I
> needed "make distclean". (Yeah, I didn't ususally turn on
> --enable-depend..)

I'm paranoid, I always do:

* make distclean
* git reset; git clean -df
* ./configure && make install

Regards,





view thread (17+ messages)  latest in thread

Message-ID: <20191112180043.6ee7d1b6@firost>
Permalink:  ../20191112180043.6ee7d1b6@firost/
Also on:    postgresql.org/message-id/20191112180043.6ee7d1b6@firost

 · 

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: jgdr@dalibo.com, horikyota.ntt@gmail.com, tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org
  Subject: Re: segmentation fault when cassert enabled
  In-Reply-To: <20191112180043.6ee7d1b6@firost>

* 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