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

Yang Chen chenyang at cs.utah.edu
Tue May 15 13:52:15 MDT 2012


John Regehr wrote:
> 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?
>

I think it's doable. Basically with debug info, we could retrieve a 
local volatile offset towards stack pointer or frame pointer. In this 
way we will get the address of this local volatile variable, and hence 
examine the accesses to it.

- Yang




More information about the csmith-dev mailing list