On Tue, 28 May 2013 14:16:32 -0400, Bradley Lowekamp said:

>I am looking through more gcc debug flags and I have come across a
>couple interesting new ones with gcc 4.8:
>
>-fsanitize=address
>Enable AddressSanitizer, a fast memory error detector. Memory access
>instructions will be instrumented to detect out-of-bounds and use-after-
>free bugs. See http://code.google.com/p/address-sanitizer/ for more details. 
>-fsanitize=thread
>Enable ThreadSanitizer, a fast data race detector. Memory access
>instructions will be instrumented to detect data race bugs. See http://
>code.google.com/p/data-race-test/wiki/ThreadSanitizer for more details. 
>
>
>It looks like they are ported from clang/llvm projects. They looks quite
>useful!
>
>I'd be curios if any one has tried them out in clang or gcc, and what
>they think of them.

I have used them with clang.  They are awesome.  They are pretty bleeding edge 
though, and have some false positives.

The most mature of the -fsanitize flags is the undefined behaviour sanitizer 
(ubsan).  I tried enabling ubsan on my Rogue7 ITK dashboard some months ago, 
but they report a gazillion errors, many from GDCM and vxl.  I turned my 
attention to fixing VTK since its code is easier to work with (IMHO: 
templates=ugh).

Address sanitizer (asan) probably won't find too much since you already use 
valgrind, though asan can find overruns of stack and globals, whereas valgrind 
only checks heap memory.

Thread sanitizer (tsan) only works with linux right now, so I've only tried it 
a little bit, but it's promising.  But fixing tricky threading issues IMHO 
should come only after we are valgrind-, ubsan-, and asan-clean.

I'll create a 'torture' dashboard on Rogue7 and we can enable one ubsan flag at 
a time...

Cheers,

-- 
____________________________________________________________
Sean McBride, B. Eng                 [email protected]
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-developers

Reply via email to