Fix 004.watchdog test crash on IBM Z hardware.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Wed, 27 May 2020 06:24:07 +0000 (15:24 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Wed, 27 May 2020 06:24:07 +0000 (15:24 +0900)
commitcd32f6ab91d77ccdb253da5da3e2e1b6f3c933bf
tree0f2bb67b6242711a11446613bcbf176c4dd4aa70
parentf7244a88442839d844ccef47068fd26b851a3774
Fix 004.watchdog test crash on IBM Z hardware.

When watchdog copies primary node id on the master watchdog node, it
did not consider the case that primary node id on the shared memory
(Req_info->primary_node_id) is remaining in the initial value (-2),
which causes out of range subscript access to backend info
array. Interestingly accessing array[-2] does not crash on intel
architecture but does crash IBM Z hardware. Anyway the reason why the
value remains in -2 is that the regression test is performed in raw
mode. I think the code block handling the primary node id should only
be executed in streaming or logical replication mode.

Bug report and patch provided by gregn123, slightly modified by me.
Mantis bug report: https://www.pgpool.net/mantisbt/view.php?id=614
src/main/pgpool_main.c