[LLVMbugs] [Bug 18156] New: UBSan doesn't like std::cout << std::hex

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Dec 5 19:57:38 PST 2013


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

            Bug ID: 18156
           Summary: UBSan doesn't like std::cout << std::hex
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: sami.liedes at iki.fi
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

UBSan reports this as UB:

-----
#include <iostream>

int main() {
    std::cout << std::hex;
}
-----

When run:

$ clang++ -fsanitize=undefined ubsan_test.cpp -o ubsan_test
$ ./ubsan_test 
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/ios_base.h:96:24:
runtime error: load of value 4294967221, which is not a valid value for type
'std::_Ios_Fmtflags'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/ios_base.h:76:67:
runtime error: load of value 4294967221, which is not a valid value for type
'std::_Ios_Fmtflags'

-- 
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/20131206/fc8ba123/attachment.html>


More information about the llvm-bugs mailing list