From: Jesper Pedersen <jesper.pedersen@redhat.com>
To: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Magnus Hagander <magnus@hagander.net>
Cc: Oskari Saarenmaa <os@ohmu.fi>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Cc: Tobias Oberstein <tobias.oberstein@gmail.com>
Subject: Re: pread() and pwrite()
Date: Wed, 7 Nov 2018 09:03:27 -0500
Message-ID: <20f9e0dc-0638-98df-abfc-92002d688bbd@redhat.com> (raw)
In-Reply-To: <cb062f4d-55b8-28be-b55f-2e593a3b3755@redhat.com>
References: <20181105155918.jg36uj4rtnxwqtzt@alvherre.pgsql>
<1791.1541438632@sss.pgh.pa.us>
<CAEepm=1GmuQ---ZDmmDzU6uS0QF==PeD1N-XLY7pSfndxTpnfQ@mail.gmail.com>
<856530e2-260d-1d61-ec18-595778868a1b@redhat.com>
<CAEepm=0+GizsKRRd=7wrL0n8VMKadR0=o99VWiXD58oJyJOUCQ@mail.gmail.com>
<cb062f4d-55b8-28be-b55f-2e593a3b3755@redhat.com>
Hi,
On 11/7/18 7:26 AM, Jesper Pedersen wrote:
> On 11/6/18 4:04 PM, Thomas Munro wrote:
>> On Wed, Nov 7, 2018 at 4:42 AM Jesper Pedersen
>> Thanks! Pushed. I'll keep an eye on the build farm to see if
>> anything breaks on Cygwin or some other frankenOS.
>>
>
> There is [1] on Andres' skink setup. Looking.
>
Attached is a reproducer.
Adding the memset() command for the page makes valgrind happy.
Thoughts on how to proceed with this ? The report in [1] shows that
there are a number of call sites where the page(s) aren't fully initialized.
[1]
https://www.postgresql.org/message-id/3fe1e38a-fb70-6260-9300-ce67ede21c32%40redhat.com
Best regards,
Jesper
Attachments:main.c (text/x-csrc, 540B) download
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
int main(int argc, const char* argv[])
{
FILE* f;
int fd;
void* m;
ssize_t written;
f = fopen("test.bin", "w+");
if (f == NULL)
{
printf("Cannot open file\n");
exit(0);
}
fd = fileno(f);
m = malloc((size_t)8192);
// memset(m, 0, (size_t)8192); <-- will make valgrind succeed
written = pwrite(fd, m, (size_t)8192, (off_t)0);
printf("Written: %i\n", written);
free(m);
fclose(f);
return 0;
}
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: jesper.pedersen@redhat.com, thomas.munro@enterprisedb.com, tgl@sss.pgh.pa.us, alvherre@2ndquadrant.com, magnus@hagander.net, os@ohmu.fi, tobias.oberstein@gmail.com
Subject: Re: pread() and pwrite()
In-Reply-To: <20f9e0dc-0638-98df-abfc-92002d688bbd@redhat.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox