Re: Segfault on exclusion constraint violation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: Pg Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Segfault on exclusion constraint violation
Date: 2015-02-02 14:38:57
Message-ID: 14736.1422887937@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Heikki Linnakangas <hlinnakangas(at)vmware(dot)com> writes:
> 9.4 and master segfaults, if an insertion would need to wait for another
> transaction to finish because of an exclusion constraint. To reproduce:
> ...
> This only happens with assertions enabled. The culprit is commit
> f88d4cfc9d417dac2ee41a8f5e593898e56fd2bd, which added the 'ctid'
> argument to XactLockTableWait. check_exclusion_constraint calls
> index_endscan() just before XactLockTableWait, but that free's the
> memory the ctid points to.

> I'll write up a patch to change those call sites to use local variables.
> Hopefully it's trivial enough to still include in 9.4.1, although time
> is really running out..

If the only known bad consequence requires assertions enabled, I think
it would be more prudent to *not* try to fix this in haste.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Heikki Linnakangas 2015-02-02 15:01:26 Re: Segfault on exclusion constraint violation
Previous Message Heikki Linnakangas 2015-02-02 14:35:45 Re: Segfault on exclusion constraint violation