Pádraig Brady wrote:
> >> It's lightweight, so I've added it in my default dev environment,
> >> but it might be worth enabling on CI systems too?
> > 
> > -ftrivial-auto-var-init=pattern appears to initialize e.g.
> > an integer variable with 0xfefefefe always. This is deterministic.
> > Therefore, it will _reduce_, not increase, the probability that
> > I notice a given bug by looking at CI results.
> > 
> > A non-deterministic initialization is better for this purpose.
> 
> I think the pattern is chosen depending on base type and platform
> to be as non usual/valid as possible.
> Also as we've seen zero'd stacks are very common,
> as we only noticed the coreutils bug¹ trigger on one of many systems.
> I suppose the fixed pattern is chosen as a compromise
> to be more likely to trigger bugs, but also avoid "heisenbug"s.

Still, for any given platform, when I see 50 non-deterministic CI runs
in a year, I am more likely to spot a bug than if the initialization is
deterministic.

The defense against zeroed stack contents should be
  -ftrivial-auto-var-init=uninitialized
not
  -ftrivial-auto-var-init=pattern

In the CI, I prefer Heisenbugs to deterministic PASS. It's only while
investigating a failure that I want to get rid of a Heisenbug.

So, if there is an option that we should add in the CI, it is
  -ftrivial-auto-var-init=uninitialized

Bruno




Reply via email to