Re: [BUGS] BUG #14808: V10-beta4, backend abort - Mailing list pgsql-bugs

From Tom Lane
Subject Re: [BUGS] BUG #14808: V10-beta4, backend abort
Date
Msg-id 3702.1504976930@sss.pgh.pa.us
Whole thread Raw
In response to Re: [BUGS] BUG #14808: V10-beta4, backend abort  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: [BUGS] BUG #14808: V10-beta4, backend abort
Re: [BUGS] BUG #14808: V10-beta4, backend abort
List pgsql-bugs
Michael Paquier <michael.paquier@gmail.com> writes:
> Crash is confirmed here so I am adding an open item. I have not dug
> into the issue seriously, but at short glance we have a code path
> trying to access something that has already been free'd:

I think this can be blamed on commit c46c0e52.

What is happening is that the AFTER triggers are queuing more triggers,
which have TransitionCaptureStates associated, but 
ExecEndModifyTable thinks it can DestroyTransitionCaptureState
unconditionally.  When the subsidiary triggers eventually get executed,
their ats_transition_capture pointers are pointing at garbage.

My first instinct is to get rid of DestroyTransitionCaptureState
altogether, on the grounds that the TransitionCaptureState will
go away at transaction cleanup and we can't really get rid of it
any sooner than that.

The other question that seems pretty relevant is why the subsidiary
triggers, which are the constraint triggers associated with the
tables' foreign keys, are getting queued with TransitionCaptureState
pointers in the first place.  This seems horridly expensive and
unnecessary.  It also directly contradicts the claim in
MakeTransitionCaptureState that constraint triggers cannot have
transition tables.
        regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

pgsql-bugs by date:

Previous
From: Keith
Date:
Subject: Re: [BUGS] BUG #14804: Postgres user lost his superuser authority
Next
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #14809: Heap Corruption with deeply nested triggers.