Fix missing initialization of delayChkptEnd

From: 蔡梦娟(玊于) <mengjuan(dot)cmj(at)alibaba-inc(dot)com>
To: "pgsql-hackers" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: "robertmhaas" <robertmhaas(at)gmail(dot)com>
Subject: Fix missing initialization of delayChkptEnd
Date: 2023-06-05 11:44:05
Message-ID: 9c3d2a49-db5f-43cb-840b-d58f9a684295.mengjuan.cmj@alibaba-inc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi, all
I got a coredump when testing with the REL_14_STABLE branch, which is as below:
I noticed that in commit 10520f4346876aad4941797c2255a21bdac74739, int delayChkpt has been changed back to bool delayChkpt + bool delayChkptEnd. However, the initialization to delayChkptEnd is missed in function InitProcess. When autovacuum_proc1 is in RelationTruncate, the delayChkptEnd will be set as true. If autovacuum_proc1 receives a cancel signal and handles it at this time, autovacuum_proc1 will exit without reseting delayChkptEnd in its error handling process. After that, if autovacuum_proc2 reuses this PGPROC structure, the above error will occur.
I add a patch to fix this bug in the attachment, hope you can check it.
Thanks & Best Regard

Attachment Content-Type Size
0001-Fix-missing-initialization-of-delayChkptEnd.patch application/octet-stream 1017 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Morris de Oryx 2023-06-05 11:58:20 Re: [BUG] pg_dump does not properly deal with BEGIN ATOMIC function
Previous Message Jelte Fennema 2023-06-05 11:43:42 Re: Adding SHOW CREATE TABLE