[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#789369: iostream uninitialized data



Package: libstdc++6
Version: 5.1.1-11

richard@deodand:~/junk$ cat t.cc
#include <iostream>

int main() {
  std::cout << std::hex;
  return 0;
}
richard@deodand:~/junk$ clang++-3.6 -fsanitize=undefined -O0
-fno-optimize-sibling-calls -fno-omit-frame-pointer -g -o t t.cc
richard@deodand:~/junk$ ./t
/usr/bin/../lib/gcc/i586-linux-gnu/5.1.1/../../../../include/c++/5.1.1/bits/ios_base.h:102:24:
runtime error: load of value 4294967221, which is not a valid value for
type 'std::_Ios_Fmtflags'
/usr/bin/../lib/gcc/i586-linux-gnu/5.1.1/../../../../include/c++/5.1.1/bits/ios_base.h:82:67:
runtime error: load of value 4294967221, which is not a valid value for
type 'std::_Ios_Fmtflags'

As far as I can see the problem here is that ios_base::_M_flags is never
initialized.

ii  clang-3.6      1:3.6.1-1    i386         C, C++ and Objective-C

ttfn/rjk


Reply to: