[llvm-bugs] [Bug 30410] New: Uninitialized bytes from clang_createIndex

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Sep 16 00:15:22 PDT 2016


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

            Bug ID: 30410
           Summary: Uninitialized bytes from clang_createIndex
           Product: clang
           Version: 3.9
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: libclang
          Assignee: unassignedclangbugs at nondot.org
          Reporter: markus.zimmermann at nethead.at
                CC: klimek at google.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 17279
  --> https://llvm.org/bugs/attachment.cgi?id=17279&action=edit
failure.c

We (https://github.com/go-clang automatic generated bindings for Clang's C API
for Go) are in the process of adding address sanitizer checks into our test
process. Before we do a public release, we want to make sure that we did
nothing wrong. However, by using the address sanitizer I found that an instance
of "uninitialized bytes".

The attached program compiled with

clang -I `llvm-config --includedir` -lclang -g -fsanitize=memory
-fsanitize-memory-track-origins -fno-omit-frame-pointer failing.c -o failing

produces the following output:

$ ./failing 
Uninitialized bytes in __interceptor_memchr at offset 6 inside [0x70800000bf58,
7)
==1796==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7ff7dd302c85  (/usr/lib/x86_64-linux-gnu/libLLVM-3.9.so.1+0x653c85)
    #1 0x7ff7dd3130a7  (/usr/lib/x86_64-linux-gnu/libLLVM-3.9.so.1+0x6640a7)
    #2 0x7ff7e1242bbe  (/usr/lib/x86_64-linux-gnu/libclang-3.9.so.1+0xc05bbe)
    #3 0x7ff7e12524ca  (/usr/lib/x86_64-linux-gnu/libclang-3.9.so.1+0xc154ca)
    #4 0x7ff7e0acdf39  (/usr/lib/x86_64-linux-gnu/libclang-3.9.so.1+0x490f39)
    #5 0x7ff7e0aab504  (/usr/lib/x86_64-linux-gnu/libclang-3.9.so.1+0x46e504)
    #6 0x7ff7e08a078e  (/usr/lib/x86_64-linux-gnu/libclang-3.9.so.1+0x26378e)
    #7 0x7ff7dd2dd314  (/usr/lib/x86_64-linux-gnu/libLLVM-3.9.so.1+0x62e314)
    #8 0x7ff7dd2dd393  (/usr/lib/x86_64-linux-gnu/libLLVM-3.9.so.1+0x62e393)
    #9 0x7ff7dd3404bc  (/usr/lib/x86_64-linux-gnu/libLLVM-3.9.so.1+0x6914bc)
    #10 0x7ff7e0427183  (/lib/x86_64-linux-gnu/libpthread.so.0+0x8183)
    #11 0x7ff7df82c37c  (/lib/x86_64-linux-gnu/libc.so.6+0xfa37c)

  Uninitialized value was stored to memory at
    #0 0x421635  (/home/vagrant/go/src/github.com/go-clang/failing+0x421635)
    #1 0x7ff7dca669bd  (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xbb9bd)

  Uninitialized value was stored to memory at
    #0 0x421635  (/home/vagrant/go/src/github.com/go-clang/failing+0x421635)
    #1 0x7ff7dca65e2f  (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xbae2f)

  Uninitialized value was created by a heap allocation
    #0 0x41fc39  (/home/vagrant/go/src/github.com/go-clang/failing+0x41fc39)
    #1 0x7ff7dca09dac  (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x5edac)

SUMMARY: MemorySanitizer: use-of-uninitialized-value
(/usr/lib/x86_64-linux-gnu/libLLVM-3.9.so.1+0x653c85) 
Exiting

I am using the packages of http://llvm.org/apt/trusty/
llvm-toolchain-trusty-3.9

Please let me know if I should try anything. It would be great if we could get
rid of this problem, so that we can enable the address sanitizer checks.

-- 
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/20160916/ee607b03/attachment.html>


More information about the llvm-bugs mailing list