Hi Andy, Andy Wingo writes: > On Wed 09 May 2018 02:32, Mark H Weaver writes: > >> However, I think it's _far_ more likely that the NULL argument on the >> stack was copied from memory shared by multiple threads without proper >> thread synchronization. > > I think this is unlikely on x86 given its total-store-ordering memory > model. I agree with you about the value of barriers, but I don't think > they are part of this bug that Ludo is seeing. I think you're forgetting about the C compiler. It's true that x86 machine code has a TSO memory model, but C does not. In the absence of barriers, the C compiler may freely reorder stores to non-volatile, non-atomic objects. In particular, it is free to reorder the initialization of an object with the write of that object's address. I admit that I haven't checked whether GCC 5.5.0 does this in practice. Do you have reason to believe that it never does so? Thanks, Mark