[LLVMbugs] [Bug 21737] New: imprecise debug info for class initializer list (hurting asan reports)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Dec 3 16:35:21 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=21737

            Bug ID: 21737
           Summary: imprecise debug info for class initializer list
                    (hurting asan reports)
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: kcc at google.com
                CC: dblaikie at gmail.com, dgregor at apple.com,
                    llvmbugs at cs.uiuc.edu, vonosmas at gmail.com
    Classification: Unclassified

When we have a long initializer list the debug info seems to point to the
opening "{" instead of the actual code in the initializer list.

I frequently hit this when analyzing asan/msan/tsan reports. 
E.g. this: 

% cat init-list.cc 
struct Foo {
  Foo(int *p)
      : a(p[0])
      , b(p[1])
      , c(p[2])
      , d(p[3])
      , e(p[4])
      , f(p[5])
      , g(p[6])
      , h(p[7])
  {}

  int a, b, c, d, e, f, g, h;
};

int x[SIZE];

int main()  {
  Foo foo(x);
}

% clang -g -DSIZE=3 -fsanitize=address  init-list.cc && ./a.out 
=================================================================
==20464==ERROR: AddressSanitizer: global-buffer-overflow on address ...
    #0 0x499c91 in Foo::Foo(int*) init-list.cc:11:3


No matter what SIZE is, i.e. where the bug happens, asan will point to "{}"

-- 
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/20141204/db30e3ee/attachment.html>


More information about the llvm-bugs mailing list