[cfe-dev] Thread Sanitizer reporting "failed to intercept clock_gettime"

Kevyn-Alexandre Paré kapare at rogue-research.com
Thu Apr 25 13:13:03 PDT 2013


Hi Alexey,

I just update bug 15823 with some of my test
http://llvm.org/bugs/show_bug.cgi?id=15823

Hope this could help.

Thanks,

_KA_

On 2013-04-24, at 4:03 PM, Alexey Samsonov wrote:

> Hi Sean!
> 
> A couple of random guesses:
> 1) do you link with "-lrt"? clock_gettime is the function in librt, and you should link against it explicitly.
> 2) if yes, do you use -Wl,--as-needed? We think it may be sanitizer-hostile, see http://llvm.org/bugs/show_bug.cgi?id=15823
> 
> Background:
> Normally if you call "clock_gettime" this symbol is undefined in your library and is taken from librt.so
> But if you build your code with -fsanitize=thread, "clock_gettime" is resolved to a replacement provided by sanitizer
> runtime, while the "real" clock_gettime is obtained by the call to dlsym("clock_gettime")
> 
> 
> 
> On Wed, Apr 24, 2013 at 9:45 PM, Sean McBride <sean at rogue-research.com> wrote:
> Hi all,
> 
> We have been trying out Thread Sanitizer lately (on ubuntu 12.10, with clang trunk) and just ran into a problem where it outputs:
> 
> FATAL: ThreadSanitizer: failed to intercept clock_gettime
> 
> We do indeed use the clock_gettime() API (via a 3rd party library, but whatever).
> 
> What does this error message mean?  Is this a tsan bug?  Or something that's our fault?
> 
> Thanks,
> 
> --
> ____________________________________________________________
> Sean McBride, B. Eng                 sean at rogue-research.com
> Rogue Research                        www.rogue-research.com
> Mac Software Developer              Montréal, Québec, Canada
> 
> 
> 
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
> 
> 
> 
> -- 
> Alexey Samsonov, MSK





More information about the cfe-dev mailing list