Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4934415

'Broken pipe' error is corrupted under the Japanese locale

    XMLWordPrintable

Details

    • 13
    • sparc
    • solaris_8
    • Verified

    Description

      Name: dk106046 Date: 10/08/2003

      Some IO errors such as 'Broken pipe' are not displayed correctly when running JDK 1.3.1 under the Japanese locale. It appears to be a character conversion issue.

      The corruption does not occur on JDK 1.4.x.

      Compile and run the following testcase on a Japanese machine to reproduce the problem:

      import java.io.*;
      import java.net.*;
      public class BrokenWrite {
          static final int PORT = 2019;
          public static void main(String[] args) throws Exception {
              ServerSocket ss = new ServerSocket(PORT);
              Socket client = new Socket(InetAddress.getLocalHost(),
                                         ss.getLocalPort());
              Socket server = ss.accept();
              ss.close();
              new Thread(new Closer(server)).start();
              client.getOutputStream().write(new byte[1000000]);
          }
          private static class Closer implements Runnable {
              private final Socket s;
              Closer(Socket s) { this.s = s; }
              public void run() {
                  try {
                      Thread.sleep(5000);
                      s.close();
                  } catch (Exception e) {
                      e.printStackTrace();
                  }
              }
          }
      }

      This bug looks similar in nature to 4818483 and 4818488, and should probably be corrected in a similar way.

      ======================================================================

      Attachments

        Activity

          People

            pcashman Pat Cashman
            dkorbel David Korbel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: