pgsql: Fix logical_decoding_timelines test crashes

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix logical_decoding_timelines test crashes
Date: 2016-04-01 19:48:10
Message-ID: E1am53C-0000D8-Vo@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix logical_decoding_timelines test crashes

In the test_slot_timelines test module, we were abusing passing NULL
values which was received as zeroes in x86, but this breaks in ARM
(buildfarm member hamster) by crashing instead. Fix the breakage by
marking these functions as STRICT; the InvalidXid value that was
previously implicit in NULL values (on x86 at least) can now be passed
as 0. Failing to follow the fmgr protocol to check for NULLs beforehand
was causing ARM to fail, as evidenced by segmentation faults in
buildfarm member hamster.

In order to use the new functionality in the test script, use COALESCE
in the right spot to avoid forwarding NULL values.

This was diagnosed from the hamster crash by Craig Ringer, who also
proposed a different patch (checking for NULL values explicitely in the
C function code, and keeping the non-strictness in the C functions).
I decided to go with this approach instead.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/82c83b337202fa0f5b235bdfaeb992a5cee40ed5

Modified Files
--------------
.../test_slot_timelines/expected/load_extension.out | 2 +-
.../modules/test_slot_timelines/sql/load_extension.sql | 2 +-
.../test_slot_timelines/test_slot_timelines--1.0.sql | 8 ++++----
.../modules/test_slot_timelines/test_slot_timelines.c | 6 +++---
src/test/recovery/t/006_logical_decoding_timelines.pl | 17 ++++++++++-------
5 files changed, 19 insertions(+), 16 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2016-04-01 19:48:35 pgsql: Omit null rows when applying the Haas-Stokes estimator for ndist
Previous Message Teodor Sigaev 2016-04-01 17:11:57 pgsql: Fixes in bloom contrib module missed during review