[llvm-bugs] [Bug 34606] New: AddressSanitizer: Failed CHECKs on FreeBSD

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Sep 14 10:11:03 PDT 2017


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

            Bug ID: 34606
           Summary: AddressSanitizer: Failed CHECKs on FreeBSD
           Product: compiler-rt
           Version: unspecified
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: compiler-rt
          Assignee: unassignedbugs at nondot.org
          Reporter: m at mikaelsimonsson.com
                CC: llvm-bugs at lists.llvm.org

Hi,

I'm trying to switch from LLVM 4.0 to 5.0 for a C++ project on FreeBSD, but I
can't get the sanitizers to work correctly. I'm getting failed CHECKs on both
the release_50 and the master-branch. Am I missing something?

A simple buffer overflow test:

=================================================================
==8195==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60200000001c
at pc 0x00000049578a bp 0x7fffffffe9c0 sp 0x7fffffffe9b8
WRITE of size 1 at 0x60200000001c thread T16777215
    #0 0x495789  (/usr/home/mikael/project/overflow+0x495789)
    #1 0x40dede  (/usr/home/mikael/project/overflow+0x40dede)
    #2 0x8006d8fff  (<unknown module>)

0x60200000001c is located 2 bytes to the right of 10-byte region
[0x602000000010,0x60200000001a)
==8195==AddressSanitizer CHECK failed:
/home/mikael/resource/llvm/projects/compiler-rt/lib/asan/asan_descriptions.cc:176
"((id)) != (0)" (0x0, 0x0)
    #0 0x47494f  (/usr/home/mikael/project/overflow+0x47494f)
    #1 0x487fbf  (/usr/home/mikael/project/overflow+0x487fbf)
    #2 0x415385  (/usr/home/mikael/project/overflow+0x415385)
    #3 0x4182d1  (/usr/home/mikael/project/overflow+0x4182d1)
    #4 0x471321  (/usr/home/mikael/project/overflow+0x471321)
    #5 0x4723f7  (/usr/home/mikael/project/overflow+0x4723f7)
    #6 0x472ddd  (/usr/home/mikael/project/overflow+0x472ddd)
    #7 0x495789  (/usr/home/mikael/project/overflow+0x495789)
    #8 0x40dede  (/usr/home/mikael/project/overflow+0x40dede)
    #9 0x8006d8fff  (<unknown module>)


Testing a parser with libFuzzer:

==8289==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top:
0x7ffffffff000; bottom 0x7fffdffff000; size: 0x000020000000 (536870912)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
=================================================================
==8289==AddressSanitizer CHECK failed:
/home/mikael/resource/llvm/projects/compiler-rt/lib/asan/asan_thread.cc:342
"((ptr[0] == kCurrentStackFrameMagic)) != (0)" (0x0, 0x0)
    #0 0x47825f  (/usr/home/mikael/project/parse.fuzz+0x47825f)
    #1 0x48b8cf  (/usr/home/mikael/project/parse.fuzz+0x48b8cf)
    #2 0x47a838  (/usr/home/mikael/project/parse.fuzz+0x47a838)
    #3 0x4196c7  (/usr/home/mikael/project/parse.fuzz+0x4196c7)
    #4 0x41b2f5  (/usr/home/mikael/project/parse.fuzz+0x41b2f5)
    #5 0x475ca1  (/usr/home/mikael/project/parse.fuzz+0x475ca1)
    #6 0x42a684  (/usr/home/mikael/project/parse.fuzz+0x42a684)
    #7 0x801461cf6  (/lib/libgcc_s.so.1+0x2cf6)
    #8 0x800bfb864  (/lib/libcxxrt.so.1+0x12864)
    #9 0x49f721  (/usr/home/mikael/project/parse.fuzz+0x49f721)
    #10 0x499611  (/usr/home/mikael/project/parse.fuzz+0x499611)
    #11 0x49915c  (/usr/home/mikael/project/parse.fuzz+0x49915c)
    #12 0x4b5662  (/usr/home/mikael/project/parse.fuzz+0x4b5662)
    #13 0x4b607a  (/usr/home/mikael/project/parse.fuzz+0x4b607a)
    #14 0x4b6870  (/usr/home/mikael/project/parse.fuzz+0x4b6870)
    #15 0x4b6b05  (/usr/home/mikael/project/parse.fuzz+0x4b6b05)
    #16 0x4ae69f  (/usr/home/mikael/project/parse.fuzz+0x4ae69f)
    #17 0x4a9f80  (/usr/home/mikael/project/parse.fuzz+0x4a9f80)
    #18 0x4117ee  (/usr/home/mikael/project/parse.fuzz+0x4117ee)
    #19 0x800723fff  (<unknown module>)


Both of these work perfectly with LLVM 4.0 (installed from ports).

% /usr/local/llvm_custom/bin/clang++ --version
clang version 6.0.0 (https://github.com/llvm-mirror/clang.git
1a3d0f5bb357c488df256447b0cb90614be45429)
(https://github.com/llvm-mirror/llvm.git
d2c2deaeccd0ec7043589a54de4a5e7da7b80e68)
Target: x86_64-unknown-freebsd11.1
Thread model: posix
InstalledDir: /usr/local/llvm_custom/bin

-- 
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/20170914/447e85e9/attachment.html>


More information about the llvm-bugs mailing list