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
    Classification: Unclassified

Created attachment 17279

We ( 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,
==1796==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7ff7dd302c85  (/usr/lib/x86_64-linux-gnu/
    #1 0x7ff7dd3130a7  (/usr/lib/x86_64-linux-gnu/
    #2 0x7ff7e1242bbe  (/usr/lib/x86_64-linux-gnu/
    #3 0x7ff7e12524ca  (/usr/lib/x86_64-linux-gnu/
    #4 0x7ff7e0acdf39  (/usr/lib/x86_64-linux-gnu/
    #5 0x7ff7e0aab504  (/usr/lib/x86_64-linux-gnu/
    #6 0x7ff7e08a078e  (/usr/lib/x86_64-linux-gnu/
    #7 0x7ff7dd2dd314  (/usr/lib/x86_64-linux-gnu/
    #8 0x7ff7dd2dd393  (/usr/lib/x86_64-linux-gnu/
    #9 0x7ff7dd3404bc  (/usr/lib/x86_64-linux-gnu/
    #10 0x7ff7e0427183  (/lib/x86_64-linux-gnu/
    #11 0x7ff7df82c37c  (/lib/x86_64-linux-gnu/

  Uninitialized value was stored to memory at
    #0 0x421635  (/home/vagrant/go/src/
    #1 0x7ff7dca669bd  (/usr/lib/x86_64-linux-gnu/

  Uninitialized value was stored to memory at
    #0 0x421635  (/home/vagrant/go/src/
    #1 0x7ff7dca65e2f  (/usr/lib/x86_64-linux-gnu/

  Uninitialized value was created by a heap allocation
    #0 0x41fc39  (/home/vagrant/go/src/
    #1 0x7ff7dca09dac  (/usr/lib/x86_64-linux-gnu/

SUMMARY: MemorySanitizer: use-of-uninitialized-value

I am using the packages of

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.
llvm-bugs mailing list

Reply via email to