http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59677
Bug ID: 59677
Summary: basic_istream::get leads to a mudflap violation
Product: gcc
Version: 4.8.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: das at cs dot ucla.edu
In 4.8.2, running RHEL 6, this causes a mudflap violation:
$ cat bug.cpp
#include <iostream>
int main()
{
char ch;
return std::cin.get(ch).good();
}
$ g++ -fmudflap -lmudflap bug.cpp
$ MUDFLAP_OPTIONS=-viol-abort ./a.out < /dev/null
*******
mudflap violation 1 (check/read): time=1388867469.284750 ptr=0x7f02844c4dc0
size=8
pc=0x7f02844ea088 location=`bug.cpp:6:34 (main)'
/usr/local/cs/gcc-4.8.2/lib64/libmudflap.so.0(__mf_check+0x18)
[0x7f02844ea088]
./a.out(main+0x10f) [0x400e6f]
/lib64/libc.so.6(__libc_start_main+0xfd) [0x3ff621ecdd]
number of nearby objects: 0
Abort
The violation is reported whether or not the input is empty, and whether get or
getline is used.