Re: BUG #15448: server process (PID 22656) was terminated by exception 0xC0000005

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: tillmann73(at)yahoo(dot)de, pgsql-bugs(at)lists(dot)postgresql(dot)org, PG Bug reporting form <noreply(at)postgresql(dot)org>
Cc: andrew(dot)dunstan(at)2ndquadrant(dot)com
Subject: Re: BUG #15448: server process (PID 22656) was terminated by exception 0xC0000005
Date: 2018-10-23 02:00:56
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers


On 2018/10/22 21:34, PG Bug reporting form wrote:
> The following bug has been logged on the website:
> Bug reference: 15448
> Logged by: Tillmann Schulz
> Email address: tillmann73(at)yahoo(dot)de
> PostgreSQL version: 11.0
> Operating system: Windows
> Description:
> I have a reproducable error when running two junit test cases in sequence
> from Java with Postgres 11.0.1. With postgres 10 everything worked fine.
> The error occurs at
> 2018-10-22 14:06:59.651 CEST [22696] LOG: server process (PID 22656) was
> terminated by exception 0xC0000005
> 2018-10-22 14:06:59.651 CEST [22696] DETAIL: Failed process was running:
> delete from c5_member

Thanks for the report and the log.

(Today I learned that exception 0xC0000005 is the Windows equivalent of
"segmentation fault".)

> Aft that, postgres is in recovery mode. Shortly after that the database is
> availiably again.
> The complete log of both testcases is:

After observing the test case in the provided log, I managed to reproduce
it with the following:

create table foo (a int primary key, b int);
create table bar (a int references foo on delete cascade, b int);
insert into foo values (1, 1);
insert into foo values (2, 2);
alter table foo add c int;
alter table foo drop c;
delete from foo;
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.

Analyzing this crash, I located the bug down to GetTupleForTrigger(), but
perhaps it's really in heap_expand_tuple() / expand_tuple(), where the
value of trigger tuple's t_self is being switched from a valid one to an
invalid value.

In heaptuple.c: expand_tuple()


FWIW, attached patch fixes this for me. Adding Andrew whose recent commit
7636e5c60f [1] seems to have introduced the heap_expan_tuple call in
GetTupleForTrigger. Maybe, he can better judge a fix for this.



Attachment Content-Type Size
GetTupleForTrigger-fix.patch text/plain 456 bytes

In response to


Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2018-10-23 03:16:06 Re: BUG #15448: server process (PID 22656) was terminated by exception 0xC0000005
Previous Message PG Bug reporting form 2018-10-22 19:41:30 BUG #15452: 10.5 and reproducible "ERROR: could not read block 0 in file..." when creating functional index

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2018-10-23 02:02:02 Re: Speeding up INSERTs and UPDATEs to partitioned tables
Previous Message Michael Paquier 2018-10-23 01:43:38 Re: pgsql: Avoid duplicate XIDs at recovery when building initial snapshot