[Buildroot] [PATCH] dmalloc: fix parallel builds

Alex Suykov alex.suykov at gmail.com
Sun Jan 4 19:02:04 UTC 2015


Sun, Jan 04, 2015 at 06:35:13PM +0100, Thomas Petazzoni wrote:

> On Sat, 3 Jan 2015 13:05:03 +0200, Alex Suykov wrote:
> > Signed-off-by: Alex Suykov <alex.suykov at gmail.com>
> > ---
> >  This patch should fix
> >  http://autobuild.buildroot.net/results/2cc40ae3fc8b7a287c43528b3e4ffdbcd5033c09/
> > 
> >  package/dmalloc/dmalloc-deps.patch | 14 ++++++++++++++
> >  1 file changed, 14 insertions(+)
> >  create mode 100644 package/dmalloc/dmalloc-deps.patch
> 
> While it indeed looks like a parallel build issue, I haven't been able
> to reproduce it: I've started a loop building dmalloc over and over
> again on my build server (on which the issue was reproduced by the
> autobuilders), and never managed to see it after an entire night
> looping on dmalloc builds. So I'm a bit confused on this one.

The following sequence seems to trigger it more or less reliably for me:

    ./configure --disable-static --enable-shared --enable-cxx --enable-threads
    sed -i -e "s at cat \$(srcdir)/dmalloc.h.1.*@&; sleep 1@" Makefile
    make clean
    make -j4

What happens is a race condition between "cat ...; mv ... dmalloc.h"
and "g++ -c dmallocc.cc". As long as cat-mv pair is faster, it works well.
But if there's a delay, it breaks.

This should be rare, I can only reproduce it with an artificial delay,
and only with --disable-static. But on the other hand, it did happen
on autobuild somehow.



More information about the buildroot mailing list