Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gKOQj-00031F-Km for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Nov 2018 14:03:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gKOQh-0005JJ-LV for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Nov 2018 14:03:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gKOQh-0005JC-ER for pgsql-hackers@lists.postgresql.org; Wed, 07 Nov 2018 14:03:35 +0000 Received: from mail-qk1-f196.google.com ([209.85.222.196]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gKOQe-0007Lb-DQ for pgsql-hackers@postgresql.org; Wed, 07 Nov 2018 14:03:35 +0000 Received: by mail-qk1-f196.google.com with SMTP id a132so21005834qkg.1 for ; Wed, 07 Nov 2018 06:03:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:from:to:cc:references :organization:message-id:date:user-agent:mime-version:in-reply-to :content-language; bh=VkFgiHYUo04q7ZBU+7/QJF6bn4Zyyyy06oiYSUteoIU=; b=U84mpWnKLlarhw6Wm4zzsF67PjI6AeVoLnQvEbedpYMSC/xnPCKowxp6ZZu9wwd3kv hVmswHRUCl927cWNcld6NtHp2UqyzYTgcO7mF040LSQXzNxU+I9hfFVGF5lM3ikdnCiM lhgx2J3Cb080XGySnetFVKVdGTpV/Hpx5PxtmfnaSHGqIlJQMFzgWxTzkg+InlCt56CJ TdQVkjVYwCO4khbAjQQA8DkTrXk+GDAwmAJFW19ATM6yYw+2Zmj7NvtIVUtoFJhvT2QW Ug6kMP0cutfEl1kLA+QhtGfH6QSKgNUJj7fisML6bDTnoS5ANYfiAjb7+dPGUhdT0Vbj yWXw== X-Gm-Message-State: AGRZ1gJKkpDhjUBEs7VjVG8zHPRWtf2JZ4Th7tW7bAHb4wlIi7NzZEfL uKxIi7dROhJ/7qfFbKHs7TOqfA== X-Google-Smtp-Source: AJdET5cgisDyyYfGSBaDViu7ZNNramh90bARBR3vzpE/5IG9owp34F3OjdfQpqqx+65OFEVYopeMbQ== X-Received: by 2002:a0c:b5e3:: with SMTP id o35mr346441qvf.164.1541599409728; Wed, 07 Nov 2018 06:03:29 -0800 (PST) Received: from localhost.localdomain (c-24-61-8-151.hsd1.ma.comcast.net. [24.61.8.151]) by smtp.gmail.com with ESMTPSA id p75sm414638qki.90.2018.11.07.06.03.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Nov 2018 06:03:28 -0800 (PST) Reply-To: jesper.pedersen@redhat.com Subject: Re: pread() and pwrite() From: Jesper Pedersen To: Thomas Munro Cc: Tom Lane , Alvaro Herrera , Magnus Hagander , Oskari Saarenmaa , Pg Hackers , Tobias Oberstein References: <20181105155918.jg36uj4rtnxwqtzt@alvherre.pgsql> <1791.1541438632@sss.pgh.pa.us> <856530e2-260d-1d61-ec18-595778868a1b@redhat.com> Organization: Red Hat Message-ID: <20f9e0dc-0638-98df-abfc-92002d688bbd@redhat.com> Date: Wed, 7 Nov 2018 09:03:27 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------92B26BE5374D95FB96BBCBA8" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------92B26BE5374D95FB96BBCBA8 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 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 --------------92B26BE5374D95FB96BBCBA8 Content-Type: text/x-csrc; name="main.c" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="main.c" #include #include #include #include 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; } --------------92B26BE5374D95FB96BBCBA8--