public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: david-b@pacbell.net To: gcc-gnats@gcc.gnu.org Subject: java/3426: java.io.InputStreamReader, infinite loop Date: Tue, 26 Jun 2001 08:16:00 -0000 [thread overview] Message-ID: <20010626151304.10093.qmail@sourceware.cygnus.com> (raw) >Number: 3426 >Category: java >Synopsis: java.io.InputStreamReader, infinite loop >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Tue Jun 26 08:16:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: david-b@pacbell.ne >Release: gcj 3.0 >Organization: >Environment: RedHat 7.0, i686-pc-linux-gnu >Description: The for(;;) loop in the second half of java.io.InputStreamReader will loop infinitely in the following case: - two bytes left at the end of the buffered stream - using a multibyte encoding, such as iso-2022-jpase, or shift_jis - the character being read takes more than two bytes In that case the converter.read() machinery tries to report ("wcount = 0"?) an incomplete read, but there seems to be no mechanism in place to (a) shift the remaining bytes to the beginning of the BufferedInputStream (b) read more bytes, so that converter.read() can progress So the for(;;) inside read() will never terminate, since each pass only proceeds by zero bytes. >How-To-Repeat: Use the SAX/XML test suite at http://xmlconf.sourceforge.net and reconfigure the GCJ version not to make special cases for the two biggish (200K) Japanese translations of a draft of the XML spec (pr-xml-iso-2022-jp, pr-xml-shift_jis). The GDB work characterized here used the first of those, I'm assuming the second loop is the same bug. (You'll need the "java/lib" and "xml" modules from CVS there. Sorry I don't have a small test case.) >Fix: Note that inside gnu/gcj/convert/natIconv.cc there is a "FIXME: what if R == -1 ?" comment which seems like it is what's being hit here. Suggested fix there is to return -1 in that case, and throw an exception in the #else /* !HAVE_ICONV */ branch using "-1" as some sort of error, passing the iconv convention up a layer. Then InputStreamReader.read() does need logic for (a), (b). >Release-Note: >Audit-Trail: >Unformatted:
next reply other threads:[~2001-06-26 8:16 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2001-06-26 8:16 david-b [this message] 2001-06-29 15:46 Tom Tromey 2001-06-29 16:26 Tom Tromey 2001-06-29 17:06 Tom Tromey 2001-07-04 23:46 David Brownell 2001-07-04 23:56 David Brownell 2001-07-12 21:36 Tom Tromey 2001-07-12 22:36 Tom Tromey 2001-07-12 22:36 Tom Tromey 2001-07-12 22:56 David Brownell
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=20010626151304.10093.qmail@sourceware.cygnus.com \ --to=david-b@pacbell.net \ --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: 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).