Re: BUG #15943: Valgrind-detected error in SlruPhysicalWritePage

From: Alexander Lakhin <exclusion(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15943: Valgrind-detected error in SlruPhysicalWritePage
Date: 2019-08-20 07:00:01
Message-ID: 7b8cbcf5-58a4-c119-b25a-e82358b44f9e@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hello hackers,
> 08.08.2019 13:33, Andres Freund wrote:
>> On August 8, 2019 12:44:43 AM EDT, PG Bug reporting form <noreply(at)postgresql(dot)org> wrote:
>>> The following bug has been logged on the website:
>>>
>>> Bug reference: 15943
>>> Logged by: Alexander Lakhin
>>> Email address: exclusion(at)gmail(dot)com
>>> 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
>>>
>> That seems likely to be padding. Probably easier to see if you enable read-var-info and track-origins.
> Indeed, "memset(&qe, 0, sizeof(qe));" added in the beginning of
> asyncQueueAddEntries fixes the issue.
> More interestingly, "memset(qe.data, 0, sizeof(qe.data));" in the same
> place fixes it too (the patch is attached).
> So it seems, the padding in AsyncQueueEntry has an alibi.
Andres, you're right. The padding is found guilty (inside the qe.data
itself).
Please look at the patch addressing the cause of the problem (inspired
by btree_bit.c).
But if a valgrind suppression is preferred, look at the alternate patch.

Best regards,
Alexander

Attachment Content-Type Size
fix-aqe-padding.patch text/x-patch 1.1 KB
valgrind_slru_write.patch text/x-patch 358 bytes

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2019-08-20 07:18:41 Re: BUG #15964: vacuumdb.c:187:10: error: use of undeclared identifier 'FD_SETSIZE'
Previous Message PG Bug reporting form 2019-08-20 06:52:12 BUG #15967: Sequence generation using NEXTVAL() fails on 64bit systems