From: "Michael S. Tsirkin" <mst@redhat.com>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
Anthony Liguori <aliguori@us.ibm.com>,
Markus Armbruster <armbru@redhat.com>,
qemu-devel@nongnu.org, Luiz Capitulino <lcapitulino@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] makefile: detect corrupted elf files
Date: Sun, 26 May 2013 10:35:40 +0300 [thread overview]
Message-ID: <20130526073540.GA32691@redhat.com> (raw)
In-Reply-To: <CAAu8pHsLfE5dhEErsdYwfn9kj+z4nH6V8KPQgV94-QSUbRHv_A@mail.gmail.com>
On Sat, May 25, 2013 at 05:32:24PM +0000, Blue Swirl wrote:
> On Wed, May 22, 2013 at 11:35 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
> > On Wed, May 22, 2013 at 01:12:15PM +0200, Paolo Bonzini wrote:
> >> Il 22/05/2013 13:09, Michael S. Tsirkin ha scritto:
> >> > > Usually I do the same---I just do slightly more thorough testing for
> >> > > configure patches.
> >> >
> >> > I've no idea what happens with ccache on a crash by the way.
> >> > It's possible that it's careful to do renames in order to not leave
> >> > corrupted output files behind.
> >>
> >> It doesn't, it leave 0-sized files. (Or at least it didn't last time
> >> power failed during a compilation. :))
> >>
> >> Paolo
> >
> > Well looking at the source, there's quite a bit of
> > handling of renames, so maybe ccache hackers will be
> > interested in fixing this.
> >
> > Manpage says:
> > It should be noted that ccache is susceptible to general storage
> > problems. If a bad object file sneaks into the cache for some reason, it
> > will of course stay bad. Some possible reasons for erroneous object
> > files are bad hardware (disk drive, disk controller, memory, etc), buggy
> > drivers or file systems, a bad CCACHE_PREFIX command or compiler
> > wrapper.
> >
> > ...
> >
> >
> > There are no reported issues about ccache producing broken object
> > files reproducibly. That doesn’t mean it can’t happen, so if you find
> > a repeatable case, please report it.
> >
> > power failure is not listed ...
>
> Neither is kill -9 issued by evil BOFH.
So presumably ccache will not fill with junk if you do this.
> IIRC I've also had bad builds
> and weird errors because the disk was almost completely full (not
> necessarily due to ccache). Once I overclocked a machine but I had to
> reduce the speed because of random compile errors.
This could be a parallel build, and possibly we have some
missing dependencies in the makefile.
>
> But I think your patch is way too simple to cover possible failure
> cases when you can't trust the compile environment.
That's not the intent. Merely to address the common failure
which I personally observe all the time.
> Maybe you should
> build in two separate directories and compare the resulting objects or
> just the final executables. For added paranoia, build using two
> machines which have different set of components from different
> manufacturers, but identical userland.
>
> Another way to handle this would be to enhance GCC and linker to use
> atomic operations when producing or combining object files. The tools
> could also print a SHA of the object which the next user should
> verify. Even better, the object files should include a robust checksum
> to ensure integrity.
I think we can make the makefile more robust. It can create a temporary
file in same directory and rename when ready. This will prevent
corrupted files from appearing in the first place.
> >
> > --
> > MST
next prev parent reply other threads:[~2013-05-26 7:35 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-21 21:46 [Qemu-devel] [PATCH] makefile: detect corrupted elf files Michael S. Tsirkin
2013-05-21 22:01 ` Peter Maydell
2013-05-21 22:09 ` Michael S. Tsirkin
2013-05-22 7:44 ` Markus Armbruster
2013-05-22 8:37 ` Michael S. Tsirkin
2013-05-22 8:38 ` Peter Maydell
2013-05-22 8:43 ` Paolo Bonzini
2013-05-22 8:52 ` Michael S. Tsirkin
2013-05-22 9:22 ` Paolo Bonzini
2013-05-22 9:42 ` Michael S. Tsirkin
2013-05-22 10:40 ` Paolo Bonzini
2013-05-22 10:50 ` Michael S. Tsirkin
2013-05-22 10:51 ` Paolo Bonzini
2013-05-22 11:09 ` Michael S. Tsirkin
2013-05-22 11:12 ` Paolo Bonzini
2013-05-22 11:35 ` Michael S. Tsirkin
2013-05-25 17:32 ` Blue Swirl
2013-05-26 7:35 ` Michael S. Tsirkin [this message]
2013-05-26 9:12 ` Peter Maydell
2013-05-26 12:31 ` Michael S. Tsirkin
2013-05-26 12:48 ` Stefan Weil
2013-05-26 13:11 ` Michael S. Tsirkin
2013-05-26 13:36 ` Peter Maydell
2013-05-26 13:40 ` Michael S. Tsirkin
2013-05-26 18:20 ` Blue Swirl
2013-05-26 18:24 ` Michael S. Tsirkin
2013-05-26 19:28 ` Blue Swirl
2013-05-26 20:15 ` Michael S. Tsirkin
2013-05-26 20:29 ` Blue Swirl
2013-05-26 20:55 ` Michael S. Tsirkin
2013-05-28 10:33 ` Michael S. Tsirkin
2013-05-26 21:03 ` Anthony Liguori
2013-05-22 8:46 ` Michael S. Tsirkin
2013-05-22 9:48 ` Stefan Hajnoczi
2013-05-22 10:00 ` Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130526073540.GA32691@redhat.com \
--to=mst@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=armbru@redhat.com \
--cc=blauwirbel@gmail.com \
--cc=lcapitulino@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.