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

Method sun.print.IPPPrintService.readIPPResponse crazy

XMLWordPrintable

    • 2d

      FULL PRODUCT VERSION :
      java version " 1.6.0_12 "
      Java(TM) SE Runtime Environment (build 1.6.0_12-b04)
      Java HotSpot(TM) Server VM (build 11.2-b01, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Linux cluemag01.crfdrive.loc 2.6.32-300.10.1.el5uek #1 SMP Wed Feb 22 17:22:40 EST 2012 i686 i686 i386 GNU/Linux

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      rpm -q cups
      cups-1.3.7-30.el5
      We have CUPS configured to client mode.
      The CUPS server is same verson of the client.

      A DESCRIPTION OF THE PROBLEM :
      When a network is busy but not full, the method sun.print.IPPPrintService.readIPPResponse generate an exception java.io.EOFException.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Configure a CUPS in client mode.
      In the CUPS server, us have one printer configured.
      Use the netwok with lot of transfer file.
      Activate sun.print.ippdebug debugger.
      Execute the executable test case.
      We have reproducing in version jdk1.6.0_37 and jdk1.7.0_13.

      The problem come of call method ois.read(response, 0, len) who read not systematic len bytes.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The log indicate sun.print.IPPPrintService>> readIPPResponse : java.io.EOFException.
      ACTUAL -
      No exception

      REPRODUCIBILITY :
      This bug can be reproduced often.

      ---------- BEGIN SOURCE ----------
      public static void main(String[] args) throws IOException {
      // TODO Auto-generated method stub


      String chemin = " http://cups:631/printers/myPrinter " ;

      for (int i=0; i<500; i++) {

      URL url = null;
      try {
      url = new URL(chemin);
      } catch (MalformedURLException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      }

      HttpURLConnection connection = null;
      try {
      connection = (HttpURLConnection)url.openConnection();
      } catch (java.io.IOException ioe) {
      ioe.printStackTrace();
      }
      if (!(connection instanceof HttpURLConnection)) {
      }
      connection.setUseCaches(false);
      connection.setDefaultUseCaches(false);
      connection.setDoInput(true);
      connection.setDoOutput(true);

      try {
      connection.setRequestMethod( " POST " );
      } catch (ProtocolException e1) {
      // TODO Auto-generated catch block
      e1.printStackTrace();
      }

      connection.setRequestProperty( " Content-type " , " application/ipp " );

          
      ipp tot= new ipp();
      tot.myURL=url;
      try {
      tot.myURI=new URI(chemin.replaceFirst( " http " , " ipp " ));
      } catch (URISyntaxException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      }
      tot.urlConnection=connection;
      tot.opGetAttributes();
      connection.disconnect();
      }
      }
      ---------- END SOURCE ----------

      SUPPORT :
      YES

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: