[Insight-developers] Undefined Behavior and clang

Bradley Lowekamp blowekamp at mail.nih.gov
Tue Aug 2 10:25:56 EDT 2011


Sean,

I found the articles you linked to on the VXL dev list regarding  undefined behavior very interesting:


On Jul 29, 2011, at 4:34 PM, Sean McBride wrote:

> Hi all,
> 
> I recently read this 3 part blog article by the architect of llvm/clang, which I highly recommend:
> 
> <http://blog.llvm.org/2011/05/what-every-c-programmer-should-know.html>
> <http://blog.llvm.org/2011/05/what-every-c-programmer-should-know_14.html>
> <http://blog.llvm.org/2011/05/what-every-c-programmer-should-know_21.html>


It appears that we have the clang compiler on you system now building ITK with out error! But there are a lot of failing tests. The cause of the error is related to our multi-threading approach. When I comment out the following line in itkImageSource, the test no longer seg-faults:

  if ( threadId < total )
    {
    //str->Filter->ThreadedGenerateData(splitRegion, threadId);
    }

I was wondering if you have looked at these failures and if you had any insight into the clang compiler and why it would be causing these failures. 

Thanks,
Brad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20110802/1c999580/attachment.htm>


More information about the Insight-developers mailing list