Bug 59677 - basic_istream::get leads to a mudflap violation
Summary: basic_istream::get leads to a mudflap violation
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 4.8.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-04 20:36 UTC by David Smallberg
Modified: 2014-02-11 18:25 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Smallberg 2014-01-04 20:36:19 UTC
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.
Comment 1 Andrew Pinski 2014-01-04 21:14:42 UTC
I think this was a bug in mudflap which has now been removed.
Comment 2 Frank Ch. Eigler 2014-02-11 18:25:30 UTC
This was a sign of incompleteness of libstdc++ support for libmudflap.  Please try the address-sanitizer options for the currently maintained variant of this functionality.