PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID15943
PG Version12beta2
OSUbuntu 18.04
Opened2019-08-08 04:44:43+00
Reported byAlexander Lakhin
StatusNew

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      15943
Logged by:          Alexander Lakhin
Email address:      (redacted)
PostgreSQL version: 12beta2
Operating system:   Ubuntu 18.04
Description:        

When running under valgrind (sitting on the master branch):
printf "SELECT pg_notify('notify_async1',NULL); %.0s" `seq 2048` | psql

I get the following error:
==00:00:00:12.885 19648== Syscall param write(buf) points to uninitialised
byte(s)
==00:00:00:12.885 19648==    at 0x5054281: write (write.c:27)
==00:00:00:12.885 19648==    by 0x2687F0: SlruPhysicalWritePage
(slru.c:851)
==00:00:00:12.885 19648==    by 0x268E95: SlruInternalWritePage
(slru.c:543)
==00:00:00:12.885 19648==    by 0x2690F1: SlruSelectLRUPage (slru.c:1095)
==00:00:00:12.885 19648==    by 0x269777: SimpleLruZeroPage (slru.c:269)
==00:00:00:12.885 19648==    by 0x31DABA: asyncQueueAddEntries
(async.c:1379)
==00:00:00:12.885 19648==    by 0x31F130: PreCommit_Notify (async.c:845)
==00:00:00:12.885 19648==    by 0x273C19: CommitTransaction (xact.c:2128)
==00:00:00:12.885 19648==    by 0x274A10: CommitTransactionCommand
(xact.c:2921)
==00:00:00:12.885 19648==    by 0x53BD7D: finish_xact_command
(postgres.c:2597)
==00:00:00:12.885 19648==    by 0x53E2F3: exec_simple_query
(postgres.c:1256)
==00:00:00:12.885 19648==    by 0x540545: PostgresMain (postgres.c:4256)
==00:00:00:12.885 19648==  Address 0xf4f95bf is in a rw- anonymous segment
==00:00:00:12.885 19648==  Uninitialised value was created by a stack
allocation
==00:00:00:12.885 19648==    at 0x31D967: asyncQueueAddEntries
(async.c:1306)

Increasing the count to 8192 produces another one, slightly different
stack:
==00:00:00:29.999 19648== Syscall param write(buf) points to uninitialised
byte(s)
==00:00:00:29.999 19648==    at 0x5054281: write (write.c:27)
==00:00:00:29.999 19648==    by 0x2687F0: SlruPhysicalWritePage
(slru.c:851)
==00:00:00:29.999 19648==    by 0x268E95: SlruInternalWritePage
(slru.c:543)
==00:00:00:29.999 19648==    by 0x26A1BD: SimpleLruTruncate (slru.c:1234)
==00:00:00:29.999 19648==    by 0x31D5A5: asyncQueueAdvanceTail
(async.c:2022)
==00:00:00:29.999 19648==    by 0x31F231: ProcessCompletedNotifies
(async.c:1132)
==00:00:00:29.999 19648==    by 0x5403D1: PostgresMain (postgres.c:4176)
==00:00:00:29.999 19648==    by 0x4B16D9: BackendRun (postmaster.c:4431)
==00:00:00:29.999 19648==    by 0x4B481B: BackendStartup
(postmaster.c:4122)
==00:00:00:29.999 19648==    by 0x4B4B32: ServerLoop (postmaster.c:1704)
==00:00:00:29.999 19648==    by 0x4B5F70: PostmasterMain
(postmaster.c:1377)
==00:00:00:29.999 19648==    by 0x406428: main (main.c:228)
==00:00:00:29.999 19648==  Address 0xf4fb5bf is in a rw- anonymous segment
==00:00:00:29.999 19648==  Uninitialised value was created by a stack
allocation
==00:00:00:29.999 19648==    at 0x31D967: asyncQueueAddEntries
(async.c:1306)

(It's also reproduced on REL_12_BETA3, REL9_6_15.)

Messages

DateAuthorSubject
2019-08-08 04:44:43+00PG Bug reporting formBUG #15943: Valgrind-detected error in SlruPhysicalWritePage
2019-08-08 10:33:07+00Andres FreundRe: BUG #15943: Valgrind-detected error in SlruPhysicalWritePage
2019-08-08 13:33:33+00Alexander LakhinRe: BUG #15943: Valgrind-detected error in SlruPhysicalWritePage
2019-08-08 16:43:32+00Alvaro HerreraRe: BUG #15943: Valgrind-detected error in SlruPhysicalWritePage
2019-08-08 18:21:04+00Andres FreundRe: BUG #15943: Valgrind-detected error in SlruPhysicalWritePage
2019-08-08 18:41:42+00Tom LaneRe: BUG #15943: Valgrind-detected error in SlruPhysicalWritePage
2019-08-08 19:12:04+00Andres FreundRe: BUG #15943: Valgrind-detected error in SlruPhysicalWritePage
2019-08-20 07:00:01+00Alexander LakhinRe: BUG #15943: Valgrind-detected error in SlruPhysicalWritePage