[csmith-dev] testing C++11 struct rules

John Regehr regehr at cs.utah.edu
Tue May 15 11:55:59 MDT 2012


> Personally, I doubt that compiler-introduced races in *global* structs
> are that big of a deal, either. I have no idea what the Committee's
> rationale for the change was (not that I've researched it); but has
> anyone *ever* seen a program bug caused by the previously permissible
> "load-mask-store" idiom?

I believe something like this came up on the Linux kernel mailing list 
within the last couple of months!  I don't have time to look for it 
right now but have made a note to do so soon.

But in any case, if some group of C++ implementers has made a commitment 
to nailing this kind of bug, then I'm happy to help them out.  So far 
the GCC people are onboard for this and I expect others will get dragged 
along...

> Acknowledged. :)  Do you think it'll be easier to convince people that
> C'12 struct accesses matter *more* than local volatiles, though?

Sure, we'll just have to see.  My belief is that right-thinking compiler 
developers like to fix this kind of stuff, but of course everyone has a 
day job implementing features for people who have money, as well :).

>> However, I do intend to get back to volatile testing at some point.  So far
>> we never looked at the values stored into volatiles, nor checked that the
>> values loaded are paid attention to by the compiler,
>
> Ooh. I never even thought of that as a potential issue, but you're
> totally right.

We have a solution based on binary rewriting that will supply the 
program with a fresh value every time it loads from a volatile!  I'm 
excited to find bugs like this, which I suspect exist.

John




More information about the csmith-dev mailing list