From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54343) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf4Xw-0007iP-BT for qemu-devel@nongnu.org; Wed, 22 May 2013 04:37:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uf4Xq-0000tn-7B for qemu-devel@nongnu.org; Wed, 22 May 2013 04:37:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59651) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf4Xp-0000th-V1 for qemu-devel@nongnu.org; Wed, 22 May 2013 04:37:14 -0400 Date: Wed, 22 May 2013 11:37:32 +0300 From: "Michael S. Tsirkin" Message-ID: <20130522083732.GD7993@redhat.com> References: <20130521214645.GA8863@redhat.com> <20130521220917.GA803@redhat.com> <87obc34fy3.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87obc34fy3.fsf@blackfin.pond.sub.org> Subject: Re: [Qemu-devel] [PATCH] makefile: detect corrupted elf files List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Peter Maydell , Anthony Liguori , qemu-devel@nongnu.org, Luiz Capitulino , Blue Swirl , Paolo Bonzini On Wed, May 22, 2013 at 09:44:04AM +0200, Markus Armbruster wrote: > "Michael S. Tsirkin" writes: > > > On Tue, May 21, 2013 at 11:01:05PM +0100, Peter Maydell wrote: > >> On 21 May 2013 22:46, Michael S. Tsirkin wrote: > >> > Once in a while make gets killed and doesn't > >> > clean up partial object files after it. > >> > Result is nasty errors from link. > >> > This hack checks object is well formed before linking, > >> > and rebuilds it if not. > >> > > >> > Signed-off-by: Michael S. Tsirkin > >> > --- > >> > > >> > Is below useful for others? > >> > >> Seems to me like this is just working around a make bug: > >> it is supposed to delete the partial object if it gets > >> killed. > > > > It can't if it gets killed by kill -9 or e.g. OOM killer > > (or OS reboot). > > Any generated file could be truncated then, not just objects. > > If you abort a build with kill -9 or equivalent, you blow away the build > tree and start over. A sufficiently unlucky truncation could still > build, but not work. > > [...] At the moment, true. It's my fault for running -rc kernels all the time I guess, I get crashes kind of often, and losing more time on make clean on top of reboot annoys me. But we actually could make it robust, even against OS crash. Output to a temporary file then rename. This hack won't be needed then. Are people interested? If yes I can implement this. -- MST