public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Hans.Ranke@ei.tum.de
To: gcc-gnats@gcc.gnu.org
Subject: libstdc++/10478: stdio_filebuf corrupts output for buffer sizes 1,2,3The
Date: Thu, 24 Apr 2003 10:06:00 -0000	[thread overview]
Message-ID: <20030424095901.19875.qmail@sources.redhat.com> (raw)


>Number:         10478
>Category:       libstdc++
>Synopsis:       stdio_filebuf corrupts output for buffer sizes 1,2,3The
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 24 10:06:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Hans Ranke <Hans.Ranke@ei.tum.de>
>Release:        3.2.2
>Organization:
>Environment:
Red Hat Linux 8.0
>Description:
The __gnu_cxx::stdio_filebuf has an optional argument for the
desired buffer size. However, if __size is set to 1, 2, or 3,
only every (__size+1)th character will be written out.
>How-To-Repeat:
See attached file.
The program is supposed to output a constant string, followed by the buffer size, for the buffer sizes 0 .. 5 to the file "testout".
I get the following output:

abcdefghijklmnopqrstuvwxyz 0
bdfhjlnprtvxz 1
cfilorux 2
dhlptx 3
abcdefghijklmnopqrstuvwxyz 4
abcdefghijklmnopqrstuvwxyz 5

For the sizes 0, 4 and 5, the output is as expected, for 1, 2 and 3, only every 2nd, 3rd or 4th character is written.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="test1.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test1.cc"

dXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2luY2x1ZGUgPGZjbnRsLmg+CiNpbmNsdWRlIDxleHQvc3Rk
aW9fZmlsZWJ1Zi5oPgojaW5jbHVkZSA8aW9zdHJlYW0+CgoKaW50IG1haW4oaW50IGFyZ2MsIGNo
YXIgKiphcmd2KSB7CiAgICBpbnQgZmQgPSBvcGVuKCJ0ZXN0b3V0IiwgT19XUk9OTFkgfCBPX0NS
RUFUKTsKICAgIEZJTEUgKmNmaWxlID0gZmRvcGVuKGZkLCAidyIpOwogICAgc2V0YnVmKGNmaWxl
LCAoY2hhciAqKTApOyAvLyBzZXQgdG8gdW5idWZmZXJlZAoKICAgIGZvciAoaW50IGJ1ZnNpemUg
PSAwOyBidWZzaXplIDwgNjsgYnVmc2l6ZSsrKSB7CglfX2dudV9jeHg6OnN0ZGlvX2ZpbGVidWY8
Y2hhcj4qIGZpbGVfYnVmID0gCgluZXcgX19nbnVfY3h4OjpzdGRpb19maWxlYnVmPGNoYXI+KCBj
ZmlsZSwgaW9zX2Jhc2U6OmluIHwgaW9zX2Jhc2U6Om91dCwgYnVmc2l6ZSk7CiAgICAgICAgaW9z
dHJlYW0gKnN0cj0gbmV3IGlvc3RyZWFtKGZpbGVfYnVmKTsKCSpzdHIgPDwgImFiY2RlZmdoaWpr
bG1ub3BxcnN0dXZ3eHl6IjsKCWRlbGV0ZShzdHIpOwoJZGVsZXRlKGZpbGVfYnVmKTsKCWZwcmlu
dGYoY2ZpbGUsICIgJWRcbiIsIGJ1ZnNpemUpOwogICAgfQp9Cg==


             reply	other threads:[~2003-04-24 10:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-24 10:06 Hans.Ranke [this message]
2003-04-24 11:39 paolo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030424095901.19875.qmail@sources.redhat.com \
    --to=hans.ranke@ei.tum.de \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).