[LLVMbugs] [Bug 16389] New: MemorySanitizer use-of-uninitialized-value in Archive/directory.ll

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jun 20 08:38:43 PDT 2013


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

            Bug ID: 16389
           Summary: MemorySanitizer use-of-uninitialized-value in
                    Archive/directory.ll
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Support Libraries
          Assignee: unassignedbugs at nondot.org
          Reporter: eugeni.stepanov at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Something in commit range 184416 - 184424 triggered a MemorySanitizer report on
Archive/directory.ll test:


WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7fa48da88e6d in llvm::sys::fs::identify_magic(llvm::StringRef)
lib/Support/PathV2.cpp:785
    #1 0x7fa48da8cb35 in llvm::sys::fs::identify_magic(llvm::Twine const&,
llvm::sys::fs::file_magic&) lib/Support/PathV2.cpp:903
    #2 0x7fa48c90437a in llvm::Archive::addFileBefore(llvm::StringRef,
llvm::ilist_iterator<llvm::ArchiveMember>, std::string*)
tools/llvm-ar/ArchiveWriter.cpp:180
    #3 0x7fa48c899309 in doReplaceOrInsert(std::string*)
tools/llvm-ar/llvm-ar.cpp:624
    #4 0x7fa48c89bd8a in main tools/llvm-ar/llvm-ar.cpp:693
    #5 0x7fa48af2e76c (/lib/x86_64-linux-gnu/libc.so.6+0x2176c)
    #6 0x7fa48c884400 in _start (bin/llvm-ar+0x47400)
  Uninitialized value was created by an allocation of 'Magic' in the stack
frame of function 'llvm::sys::fs::identify_magic(llvm::Twine const&,
llvm::sys::fs::file_magic&)'


Code in get_magic() looks weird in several places and does not seem to be
handling empty files well.

-- 
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/20130620/217587db/attachment.html>


More information about the llvm-bugs mailing list