[llvm-bugs] [Bug 46418] New: Sanitizers don't work with ThinLTO and new pass manager at opt level > 0

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jul 22 17:23:39 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=46418

            Bug ID: 46418
           Summary: Sanitizers don't work with ThinLTO and new pass
                    manager at opt level > 0
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: tomasz.miasko at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    yuanfang.chen at sony.com
                CC: yuanfang.chen at sony.com

When using ThinLTO and -fexperimental-new-pass-manager at optimization 
level > 0, sanitizer passes are registered using
registerOptimizerLastEPCallback
but the pre-link pipeline constructed with buildThinLTOPreLinkDefaultPipeline
doesn't include optimization pipeline and those callbacks are never invoked.
Thus the sanitizer instrumentation is not performed at all.

Example:

$ cat a.cpp
#include <string.h>
int main(int argc, char **argv) {
  char x[10];
  memset(x, 0, 10);
  int res = x[argc * 10];
  return res;
}
$ clang -fexperimental-new-pass-manager -flto=thin -fsanitize=address -O1 a.cpp
$ ./a.out
$ # No error report.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200723/97bc7bce/attachment.html>


More information about the llvm-bugs mailing list