Control: tags -1 + patch pending

On Wed, May 04, 2016 at 05:53:20PM +0100, Colin Watson wrote:
> On Sat, Apr 16, 2016 at 05:16:54PM +0200, Tobias Frost wrote:
> > survex  FTBFS on hurd-i386 but built before.
> > Please take a look.
> > 
> > As this is preventing decrufting of wxwidgets3.0, I've filed an RM for this 
> > arch.
> > See #821191
> 
> The attached patch may help.  Please consider it.

Ah, so that's what's going on here.  Thanks for tracking this down.

> A more complete fix would be to make sure that structures are always
> zero-filled when they are allocated, but that probably requires work
> throughout the codebase.

The new settings are always initialised from the existing settings:

   pcsNew = osnew(settings);
   *pcsNew = *pcs; /* copy contents */

So the root cause is that begin_survey is never actually initialised in
the first place.  Usually that doesn't matter (as it won't be checked),
but in this error case that gets copied into the new settings, and then
used later.  So this shouldn't affect normal use.

Zero-initialising the first settings would help avoid any issues like
this.

I suspect the compiler is doing that for us on some architectures (some
fields are explicitly initialised to NULL or 0 so it probably decides a
memset() of the whole structure is more efficient), but not on hurd-i386
for some reason, and that's why valgrind doesn't pick this up on x86-64.

I'll push a fix upstream and let it flow back in the next release, but
if the hurd-i386 issue is a problem for you, feel free to NMU (the patch
as-is looks good to me for that).

Cheers,
    Olly

Reply via email to