This is the mail archive of the libstdc++-prs@sources.redhat.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

libstdc++/98: Outputting streambufs to a stream is broken



>Number:         98
>Category:       libstdc++
>Synopsis:       Outputting streambufs to a stream is broken
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 18 13:37:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     bgarcia@laurelnetworks.com
>Release:        unknown-1.0
>Organization:
>Environment:
libstdc++ v. 2.8.1
redhat linux x86 6.2, gcc 2.95.2
>Description:
Outputting a streambuf to a stream is broken.
This appears to be similar to PR 92, but does not appear
to be fixed by the same fix.
>How-To-Repeat:
First, create a file called "conf" with at least 1500
lines of "1234567890".

Next compile the following program:

#include <fstream>
#include <iostream>

int main(int argc, char** argv)
{

    std::ifstream file;
    file.open("conf");
    if (!file.is_open())
    {
        return -1;
    }

    std::cout << file.rdbuf();

    return 0;
}

Next, run this program as "./junk > conf2
and compare conf to conf2.

host> wc conf*
   1500    1500   16500 conf
   2234    2235   24576 conf2

host> diff conf conf2 | head
1500a1501,2235
> 4567890
> 1234567890
> 1234567890
> 1234567890
> 1234567890
> 1234567890
> 1234567890
> 1234567890
> 1234567890
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]