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

John Regehr regehr at cs.utah.edu
Tue May 15 08:27:54 MDT 2012


Hi Arthur,

I think I was being silly and you're totally right that this is the way 
to do it.  The only real threat to validity would be some kind of 
congruent bug across compilers but that seems very unlikely.

> The second problem would be, can you get this to work for struct
> variables that aren't extern globals? That sounds hard to me, but then
> I don't know if maybe you already solved that in 2008. Were you only
> testing global variables then, too? Local volatiles are kind of silly,
> but you'd definitely want this struct-field-access-thing to be able to
> work with structs that are on the stack.

You know, I'm not sure that compiler-introduced races in local structs 
are that big of a deal.  I'm also not sure that compiler developers 
would even fix those!  Realistically, shared variables that matter for 
races are going to be globals.

Volatile locals are not always silly, there are some signal-handling use 
cases, but we never even attempted to look for bugs in those.  I believe 
we could do it using debug info.  My student Yang (I think he's on this 
list) has some experience parsing that stuff.  What do you think, Yang?

But I doubt we'll ever work on volatile locals since the major issue 
with volatile bugs is convincing people to fix them, not finding them.

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, nor have 
we looked for illegal reordering of volatile accesses.  None of this is 
particularly tricky, it will just take a bit of time to get it all going.

John




More information about the csmith-dev mailing list