[cfe-commits] Threadsafety check crashes on optimized CFGs

Ted Kremenek kremenek at apple.com
Thu Aug 25 12:11:58 PDT 2011


Simple test cast:

$ cat test.c
void foo() {
  if (0)
   return;
}

$ clang -Weverything test.c
<CRASH>

I think your topological sort is not handling the case where predecessors/successors can be null in the CFG due to branches that deemed infeasible at the time the CFG is constructed.

On Aug 23, 2011, at 4:31 PM, Caitlin Sadowski wrote:

>> When I use -Weverything using a clang compiler with this change on the LLVM/Clang codebase, this code crashes a lot.
> 
> Ok, I will look into that tomorrow. Do you remember any specific files
> it was crashing on?
> 
>> This checker is also getting pretty big.  Generally speaking AnalysisBasedWarnings.cpp should only contain the "top-level" logic for driving analyses.  The analyses themselves should be in a separate file and activated via a small API.  When you get a chance, please move the bulk of the logic to libAnalysis, and have AnalysisBasedWarnings.cpp just call the entry point.
> 
> Ok, sounds good! I will do this soon.
> 
> Cheers,
> 
> Caitlin
> 
>> On Aug 18, 2011, at 9:43 PM, Caitlin Sadowski wrote:
>> 
>>> Here is an updated thread safety lockset patch which incorporates
>>> existing llvm iterators to perform the topological sort.
>>> 
>>> Cheers,
>>> 
>>> Caitlin
>>> 
>>> On Wed, Aug 17, 2011 at 4:07 PM, Caitlin Sadowski <supertri at google.com> wrote:
>>>> Dear ThreadSafety reviewers (probably Doug),
>>>> 
>>>> Please find an initial lockset implementation patch attached, to
>>>> review at your earliest convenience. This patch adds basic lock
>>>> tracking support for the thread safety analysis. It depends on a very
>>>> small llvm patch (attached and sent to llvm-commits). Code review site
>>>> here:
>>>> 
>>>> http://codereview.appspot.com/4894048/
>>>> 
>>>> This patch also depends on the topological sort patch sent out to the
>>>> llvm-commits mailing list by DeLesley Hutchins to order the CFG blocks
>>>> so as to traverse them in one pass in the right order.
>>>> 
>>>> Cheers,
>>>> 
>>>> Caitlin
>>>> 
>>> <threadsafety_initiallockset2.patch>_______________________________________________
>>> cfe-commits mailing list
>>> cfe-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>> 
>> 




More information about the cfe-commits mailing list