[compiler-rt] r293536 - Recommit: Stop intercepting some malloc-related functions on FreeBSD and

Dimitry Andric via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 1 12:30:33 PST 2017


This commit has now baked a few days, and I didn't see any further problems.  Kostya, Reid, is this OK to merge into release_40?

-Dimitry

On 30 Jan 2017, at 20:06, Dimitry Andric via llvm-commits <llvm-commits at lists.llvm.org> wrote:
> 
> Author: dim
> Date: Mon Jan 30 13:06:13 2017
> New Revision: 293536
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=293536&view=rev
> Log:
> Recommit: Stop intercepting some malloc-related functions on FreeBSD and
> macOS
> 
> Summary:
> In https://bugs.freebsd.org/215125 I was notified that some configure
> scripts attempt to test for the Linux-specific `mallinfo` and `mallopt`
> functions by compiling and linking small programs which references the
> functions, and observing whether that results in errors.
> 
> FreeBSD and macOS do not have the `mallinfo` and `mallopt` functions, so
> normally these tests would fail, but when sanitizers are enabled, they
> incorrectly succeed, because the sanitizers define interceptors for
> these functions.  This also applies to some other malloc-related
> functions, such as `memalign`, `pvalloc` and `cfree`.
> 
> Fix this by not intercepting `mallinfo`, `mallopt`, `memalign`,
> `pvalloc` and `cfree` for FreeBSD and macOS, in all sanitizers.
> 
> Also delete the non-functional `cfree` wrapper for Windows, to fix the
> test cases on that platform.
> 
> Reviewers: emaste, kcc, rnk
> 
> Subscribers: timurrrr, eugenis, hans, joerg, llvm-commits, kubamracek
> 
> Differential Revision: https://reviews.llvm.org/D27654
> 
> Added:
>    compiler-rt/trunk/test/asan/TestCases/malloc-no-intercept.c
> Modified:
>    compiler-rt/trunk/lib/asan/asan_malloc_linux.cc
>    compiler-rt/trunk/lib/asan/asan_malloc_win.cc
>    compiler-rt/trunk/lib/lsan/lsan_interceptors.cc
>    compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h
>    compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_allocator_testlib.cc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170201/a297c465/attachment.sig>


More information about the llvm-commits mailing list