[LLVMbugs] [Bug 17068] New: [MSan] Failed to catch conditional move?

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Sep 2 17:35:43 PDT 2013


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

            Bug ID: 17068
           Summary: [MSan] Failed to catch conditional move?
           Product: compiler-rt
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: compiler-rt
          Assignee: unassignedbugs at nondot.org
          Reporter: chandlerc at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Not sure if this is an msan bug or not, but I feel like it should have caught
this:

% cat msan/bug.cpp 
int main() {
  int x;
  int *volatile p = &x;
  return *p ? 0 : 1;
}

% ~/bin/clang++ -o msan_bug -std=c++11 -g -fsanitize=memory msan/bug.cpp
% ./msan_bug

The program exits with status 1.


However, this equivalent program produces a lovely msan report:
% cat msan/bug.cpp 
int main() {
  int x;
  int *volatile p = &x;
  if (*p)
    return 0;
  return 1;
}
% ~/bin/clang++ -o msan_bug -std=c++11 -g -fsanitize=memory msan/bug.cpp
% ./msan_bug                                                                    
==20078== WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7f42598d1518
(/home/chandlerc/src/llvm.git/build/gn_2013/msan_bug+0x2f518)
    #1 0x7f42589e160c (/lib64/libc.so.6+0x2460c)
    #2 0x7f42598d12b0
(/home/chandlerc/src/llvm.git/build/gn_2013/msan_bug+0x2f2b0)
Exiting

-- 
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/20130903/5604a0a6/attachment.html>


More information about the llvm-bugs mailing list