BUG #16033: segmentation fault when runing update - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #16033: segmentation fault when runing update
Date
Msg-id 16033-6c9a1ddbdad9f296@postgresql.org
Whole thread Raw
Responses Re: BUG #16033: segmentation fault when runing update
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      16033
Logged by:          Miha Vrhovnik
Email address:      miha.vrhovnik@naviter.com
PostgreSQL version: 12rc1
Operating system:   Ubuntu 18.04.3
Description:

We are launching a ne service and decided to test the new 12rc1
It happens that from time to time the postgresql crashes with segmentation
fault.


When it crashes the query running is always of the following form:
UPDATE calculation SET updated_xy = NOW(), xy = $1, types =
array_distinct(array_cat(types, $2)), failed =
array_distinct(array_cat(failed, $3))

Now the array_distinct is defined as following:

CREATE OR REPLACE FUNCTION array_distinct(anyarray)
RETURNS anyarray AS $$
    SELECT ARRAY(SELECT DISTINCT unnest($1) ORDER BY 1)
$$ LANGUAGE sql;

everything of "importance" around the UPDATE sentence is
2019-10-02 12:03:03.137 UTC [1215] LOCATION:  LogChildExit,
postmaster.c:3680
2019-10-02 12:03:03.137 UTC [1215] LOG:  00000: terminating any other active
server processes
2019-10-02 12:03:03.137 UTC [1215] LOCATION:  HandleChildCrash,
postmaster.c:3400


pgsql-bugs by date:

Previous
From: Andrew Gierth
Date:
Subject: Re: BUG #16031: Group by returns duplicate groups
Next
From: Tom Lane
Date:
Subject: Re: BUG #16033: segmentation fault when runing update