public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org Subject: Re: java/3426: java.io.InputStreamReader, infinite loop Date: Fri, 29 Jun 2001 16:26:00 -0000 [thread overview] Message-ID: <20010629232601.21361.qmail@sourceware.cygnus.com> (raw) The following reply was made to PR libgcj/3426; it has been noted by GNATS. From: Tom Tromey <tromey@redhat.com> To: david-b@pacbell.net Cc: gcc-gnats@gcc.gnu.org Subject: Re: java/3426: java.io.InputStreamReader, infinite loop Date: 29 Jun 2001 16:57:54 -0600 >>>>> "David" == david-b <david-b@pacbell.net> writes: David> The for(;;) loop in the second half of David> java.io.InputStreamReader will loop infinitely in the following David> case: I looked at this and I agree. The problem is that the InputStreamReader has no way to force the BufferedInputStream to refill its buffer. So in your scenario, instead of making progress we simply keep trying the same thing over and over. One fix might be to make BufferedInputStream.refill package-private and then call it from InputStreamReader.read while the mark is set. This is pretty ugly. It is hard to see what else we could do without rewriting InputStreamReader. I'd prefer not to do that, I think. David> "FIXME: what if R == -1 ?" comment which seems like it David> is what's being hit here. We definitely have to do something smarter if we hit an encoding error. Maybe throwing CharConversionException is appropriate? We currently don't throw that anywhere, which seems odd. I think we ought to throw it if we detect garbage in the input stream. What do you think? Tom
next reply other threads:[~2001-06-29 16:26 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2001-06-29 16:26 Tom Tromey [this message] -- strict thread matches above, loose matches on Subject: below -- 2001-07-12 22:56 David Brownell 2001-07-12 22:36 Tom Tromey 2001-07-12 22:36 Tom Tromey 2001-07-12 21:36 Tom Tromey 2001-07-04 23:56 David Brownell 2001-07-04 23:46 David Brownell 2001-06-29 17:06 Tom Tromey 2001-06-29 15:46 Tom Tromey 2001-06-26 8:16 david-b
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=20010629232601.21361.qmail@sourceware.cygnus.com \ --to=tromey@redhat.com \ --cc=gcc-prs@gcc.gnu.org \ --cc=nobody@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: linkBe 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).