Re: segmentation fault in execTuples.c#ExecStoreVirtualTuple

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Manuel Kniep <manuel(at)adjust(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: segmentation fault in execTuples.c#ExecStoreVirtualTuple
Date: 2015-01-15 23:57:13
Message-ID: 1281.1421366233@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> Manuel Kniep <manuel(at)adjust(dot)com> writes:
>> ok after lots of testing I could create a test case
>> which can be found here https://gist.github.com/rapimo/3c8c1b35270e5854c524
>> its written in ruby an depends on the gem activerecord pg and parallel

> Hm. I don't see a segfault from this. I do see the CREATE TEMP TABLE
> command failing with "ctid is NULL", which probably shouldn't be happening
> ... but no segfault.

The reason turns out to be that this is a dangling-pointer bug, and I was
using a memory-clobber-enabled build so it was pretty predictable what the
pointer would be pointing at. I've got no doubt that hard-to-reproduce
misbehavior, including segfaults, would ensue without CLOBBER_FREED_MEMORY
turned on.

You need this patch:
http://git.postgresql.org/gitweb/?p=postgresql.git;a=patch;h=34668c8eca065d745bf1166a92c9efc588e7aee2

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2015-01-16 00:06:51 Re: Bug in pg_dump
Previous Message Michael Paquier 2015-01-15 23:47:10 Re: Safe memory allocation functions