From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751050AbdAQDoV (ORCPT ); Mon, 16 Jan 2017 22:44:21 -0500 Received: from shards.monkeyblade.net ([184.105.139.130]:55054 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750884AbdAQDoT (ORCPT ); Mon, 16 Jan 2017 22:44:19 -0500 Date: Mon, 16 Jan 2017 22:42:43 -0500 (EST) Message-Id: <20170116.224243.706466650029722351.davem@davemloft.net> To: dave.kleikamp@oracle.com Cc: viro@zeniv.linux.org.uk, sparclinux@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RESEND] coredump: Ensure proper size of sparse core files From: David Miller In-Reply-To: <32910821-8b16-1107-20de-b34d029b3e9a@oracle.com> References: <20161208181151.28127-1-dave.kleikamp@oracle.com> <32910821-8b16-1107-20de-b34d029b3e9a@oracle.com> X-Mailer: Mew version 6.7 on Emacs 25.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Mon, 16 Jan 2017 18:43:38 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dave Kleikamp Date: Wed, 11 Jan 2017 13:25:00 -0600 > If the last section of a core file ends with an unmapped or zero page, > the size of the file does not correspond with the last dump_skip() call. > gdb complains that the file is truncated and can be confusing to users. > > After all of the vma sections are written, make sure that the file size > is no smaller than the current file position. > > This problem can be demonstrated with gdb's bigcore testcase on the > sparc architecture. > > Signed-off-by: Dave Kleikamp The lseek() done by dump_skip() should extend the file properly. Otherwise, everyone would be seeing this problem. That test case passed all the time when I was last running the GDB testsuite all the time on sparc64, say 5 years ago.