[llvm-commits] Thread Sanitizer seems to have the dual issue

Chandler Carruth chandlerc at google.com
Wed Nov 28 01:41:46 PST 2012


On Tue, Nov 27, 2012 at 8:50 PM, Kostya Serebryany <kcc at google.com> wrote:
> Hi Pedro,
>
> I managed to understand the problem with doFinalization, but I still don't
> see the problem with doInitialization.
> Could you please describe what's wrong in more detail?

I don't either. I've read both pass's doInitialization routines (both
ASan and TSan) and I'm quite convinced they work with the intended
end-goal of:

For each module compiled:
1) all passes doInitialization routines are called exactly once with
that module passed into it.
2) the pass manager's runOn* sequence occurs, running passes (perhaps
multiple times based on the pass manager) across the module.
3) all passes doFinalization routines are called exactly once with
that module passed into it.

ThreadSanitizer and AddressSanitizer both use doInitialization to set
up boring per-module state necessary for the passes to operate:
1) They register a function in the set of global ctors
2) They add declarations for runtime library functions
3) The create some global variables

These things seem completely fine and reasonable to do in
doInitialization, so I think we'll need some more details to
understand what is actually going wrong here.

Can you post a patch? Can you post the error messages you're seeing?



More information about the llvm-commits mailing list