[llvm-dev] Re:[compiler-rt] Why interceptor_via_fun doesn't work for *alloc functions?

chuanqi.xcq via llvm-dev llvm-dev at lists.llvm.org
Wed Jul 22 18:40:10 PDT 2020


    Hi, all

    Yesterday I find that interceptor_via_fun doesn't work for aligned_alloc when I try to suppress a error from the check for aligned_malloc. And after I try to look into the implementation of AddressSanitizer, I find that it doesn't implement the suppression mechanism for *alloc functions. From the codes I see, only the str* functions could be suppressed by the interceptor_via_fun way. I want to ask why compiler-rt design in this way. If this is a porgram, I want to try to fix this.

    Thanks,
    Chuanqi


------------------------------------------------------------------
发件人:llvm-dev at lists.llvm.org <llvm-dev at lists.llvm.org>
发送时间:2020年7月22日(星期三) 15:59
收件人:llvm-dev at lists.llvm.org <llvm-dev at lists.llvm.org>
主 题:[llvm-dev] How to suppress error reports from the external libraries in compiler-rt?

Hi, every one.

When I change the compiler of a project from gcc to clang, I met a problem about `aligned_alloc`. `aligned_alloc` accepts two arguments, one for alignment and another for size. 
The standard document says that the `size` must be integral multiple of `alignment`. But the gcc allows more relaxing restriction.

Now I met a external library which depend on this behavior, which would fail when the ASanityChecker checks it. And I can not modify the codes in that library to generate a new library.
So I want to suppres the asanity check for `aligned_alloc`. I know here is a document (https://clang.llvm.org/docs/AddressSanitizer.html#suppressing-reports-in-external-libraries).
However, it doesn't work when I try to write:
```
interceptor_via_fun:aligned_alloc
```
I also tried to write the function name who call `aligned_alooc`.  But it doesn't work, too.

I know I need to ask to something like compiler-rt dev mailing list. But I didn't find it. So I ask it here.

Thanks,
Chuanqi 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200723/cbca769c/attachment.html>


More information about the llvm-dev mailing list