JDK-8042626 : Exception occurs when writing many texts to java console
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 6u45,7u51,8,9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_7
  • CPU: x86
  • Submitted: 2014-03-10
  • Updated: 2015-01-21
  • Resolved: 2014-08-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u40 b06Fixed 9Fixed
Description
FULL PRODUCT VERSION :
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) Client VM (build 20.45-b01, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]

A DESCRIPTION OF THE PROBLEM :
Exception occurs when writing 4,000 K texts to java console.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
 1. Open java applet
 2. Write 4,000 K texts to java console


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
No exception occurs.
ACTUAL -
IllegalArgumentException occurs.
----
Exception in thread "AWT-EventQueue-1" java.lang.IllegalArgumentException: Invalid remove
  at javax.swing.JTextArea.replaceRange(Unknown Source)
  at com.sun.deploy.util.ConsoleWindow$25.run(Unknown Source)
  at java.awt.event.InvocationEvent.dispatch(Unknown Source)
  at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
  at java.awt.EventQueue.access$400(Unknown Source)
  at java.awt.EventQueue$2.run(Unknown Source)
  at java.awt.EventQueue$2.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
  at java.awt.EventQueue.dispatchEvent(Unknown Source)
  at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
  at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
  at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  at java.awt.EventDispatchThread.run(Unknown Source)


ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "AWT-EventQueue-1" java.lang.IllegalArgumentException: Invalid remove

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
public class ConsoleTest extends JApplet {
  JButton _button = new JButton("Write Console");

  String _testOutput = null;
  
  public void init() {
    super.init();
    add(_button);
    
    StringBuffer bf = new StringBuffer();
    for (int i = 0; i < 1000; i ++) {
      bf.append("0123456789");
    }
    _testOutput = bf.toString();
    
    _button.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        for (int i = 0; i < 400; i ++) {
          System.out.println(_testOutput);
        }
      }
    });
  }
}

---------- END SOURCE ----------


Comments
yes - can reproduce on JDK9 with simple tests at http://oklahoma.us.oracle.com/www/tests/1.9.0/8042626/ both plugin and webstart will reset the console after a exception in the trace code
12-05-2014