[cfe-dev] Summer of Code idea -- detecting undefined behavior (fwd)

John Regehr regehr at cs.utah.edu
Tue Mar 23 22:12:30 PDT 2010


Leo, my guess would be that the easy undefined behaviors can be tackled 
with only a basic knowledge of compilers.  Some of these will have large 
payoff.

The hard undefined behaviors will require a great deal of intimacy with 
the C standard and with Clang/LLVM.  My favorite example is that a program 
is undefined if "Between two sequence points, an object is modified more 
than once, or is modified and the prior value is read other than to 
determine the value to be stored."  Yuck.

John


On Tue, 23 Mar 2010, Leopold Walkling wrote:

> Hi,
> like Conrado I also wonder about the requirements one would have to meet to
> make this project a success.
> Is a basic understanding of compilers sufficient?
> I imagine such detection mechanisms would be difficult to isolate from other
> code generation behavior, so I think it would be quite a challenge to avoid
> degrading the design of the current code generation module, or even breaking
> working behavior, wouldn't it?
>
> Leopold Walkling
>
> On Tuesday 23 March 2010 01:47:13 John Regehr wrote:
>> Oops-- just sent the message below to the main LLVM list, it probably
>> would have been better sent to this list in the first place.
>>
>> --------------------
>>
>> Is anyone interested in a SoC project to further develop Clang's support
>> for detecting undefined behaviors in C/C++?
>>
>> This is actually a collection of many smaller projects ranging from very
>> easy (detecting divide by zero) to rather nasty (detecting references to
>> out-of-scope automatic variables).
>>
>> If someone does this, I'm happy to help mentor, provide test cases, etc.
>>
>> If done well, this would be a relatively high-impact project.  It would
>> catch more errors than valgrind, be faster, and provide much better error
>> messages.
>>
>> John Regehr
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>



More information about the cfe-dev mailing list