Skip to content

Commit 113d359

Browse files
committed
Fix segmentation fault that commit ac22929 caused.
Commit ac22929 changed recoveryWakeupLatch so that it's reset to NULL at the end of recovery. This change could cause a segmentation fault in the buildfarm member 'elver'. Previously the latch was reset to NULL after calling ShutdownWalRcv(). But there could be a window between ShutdownWalRcv() and the actual exit of walreceiver. If walreceiver set the latch during that window, the segmentation fault could happen. To fix the issue, this commit changes walreceiver so that it sets the latch only when the latch has not been reset to NULL yet. Author: Fujii Masao Discussion: https://postgr.es/m/[email protected]
1 parent 560564d commit 113d359

File tree

1 file changed

+2
-1
lines changed
  • src/backend/access/transam

1 file changed

+2
-1
lines changed

src/backend/access/transam/xlog.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -12673,7 +12673,8 @@ CheckPromoteSignal(void)
1267312673
void
1267412674
WakeupRecovery(void)
1267512675
{
12676-
SetLatch(XLogCtl->recoveryWakeupLatch);
12676+
if (XLogCtl->recoveryWakeupLatch)
12677+
SetLatch(XLogCtl->recoveryWakeupLatch);
1267712678
}
1267812679

1267912680
/*

0 commit comments

Comments
 (0)