JDK-6185414 : 1.3.1-only: JVM crashes during WTextComponentPeer.getText() using Citrix
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.3.1_12
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2004-10-27
  • Updated: 2010-04-03
  • Resolved: 2005-04-04
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.
Other
1.3.1_16 b01Fixed
Description
VCG is a software company that creates products for the staffing industry.  One of our products, WebPAS, is Java based using SilverStream 3.7 as the application server with an AWT client.  We use 1.3.1_06 for both the server and client.  We have a problem with the java.awt.TextArea when using Citrix to run the client.  If the user types text into the text area rapidly, then the JVM will crash.

We have tested on several versions of Citrix Metaframe and NFuse, including the newest Citrix product "Presentation Server", and have run each version of Citrix on both Windows 2000 Server and 2003 server.  No combination has prevented the problem from occurring.

NOTE: Citrix is a third party application that allows for VNC-like functionality
      to connect to remote desktops.

============ Example 1 ===================================== 

An unexpected exception has been detected in native code outside the VM. 
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x77f486f7 
Function name=RtlImageDirectoryEntryToData 
Library=C:\WINDOWS\system32\ntdll.dll 

Current Java thread: 
        at sun.awt.windows.WTextComponentPeer.getText(Native Method) 
        at java.awt.TextComponent.getText(TextComponent.java:195) 
        at com.sssw.rt.form.AgcTextArea.processTextEvent(AgcTextArea.java:127) 
        at java.awt.TextComponent.processEvent(TextComponent.java:557) 
        at com.sssw.rt.atlas.AtTextArea.processEvent(AtTextArea.java:48) 
        at java.awt.Component.dispatchEventImpl(Component.java:2588) 
        at java.awt.Component.dispatchEvent(Component.java:2492) 
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:334) 
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:126) 
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:93) 
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88) 
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:80) 

<snip>
Local Time = Fri Jul 16 11:14:35 2004 
Elapsed Time = 69 
# 
# The exception above was detected in native code outside the VM 
# 
# Java VM: Java HotSpot(TM) Client VM (1.3.1_06-b01 mixed mode) 
# 
======================== Example 2 =========================== 

An unexpected exception has been detected in native code outside the VM. 
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x77f4696b 
Function name=RtlFreeHeap 
Library=C:\WINDOWS\system32\ntdll.dll 

Current Java thread: 
        at sun.awt.windows.WTextComponentPeer.getText(Native Method) 
        at java.awt.TextComponent.getText(TextComponent.java:195) 
        at com.sssw.rt.form.AgcTextArea.processTextEvent(AgcTextArea.java:127) 
        at java.awt.TextComponent.processEvent(TextComponent.java:557) 
        at com.sssw.rt.atlas.AtTextArea.processEvent(AtTextArea.java:48) 
        at java.awt.Component.dispatchEventImpl(Component.java:2588) 
        at java.awt.Component.dispatchEvent(Component.java:2492) 
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:334) 
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:126) 
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:93) 
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88) 
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:80) 
<snip>

Local Time = Fri Jul 16 11:19:32 2004 
Elapsed Time = 131 
# 
# The exception above was detected in native code outside the VM 
# 
# Java VM: Java HotSpot(TM) Client VM (1.3.1_06-b01 mixed mode) 
#
###@###.### 10/27/04 19:56 GMT

Comments
EVALUATION Since there is a bug in 1.3.x_x so, is this a CTE bug? ###@###.### 10/28/04 07:47 GMT Unable to reproduce the crash. As per the filer, the crash happens only when Citrix is used as client to connect to a remote server. The crash dump points to an invalid peer component at: Java_sun_awt_windows_WTextComponentPeer_getText( JNIEnv *env, jobject self) { ... .. if (isNT) { WCHAR* buf = new WCHAR[len + 1]; /* crash happens here while accessing "c->" **/ c->GetText(buf, len + 1); AwtTextComponent::RemoveCR(buf); js = env->NewString(buf, wcslen(buf)); delete [] buf; } else { ... ... } Will investigate when we have access to inhouse citrix environment with to reproduce the problem. ###@###.### 2005-2-08 23:58:25 GMT Root Cause of the crash: The problem is about the race for accessing the windows handle, and from there, to get the text in the text area. When we call ..peer.getText() which gets invoked indirectly by text listener, windows sends a message 'get_text' and by the time it get processed by windows manager, the test case keys-in more text into the text area. The problem is a bit similar to 5065001. Since we could not reproduce the problem on 1.4.2xx & 5.0uX, this bug will be treated as applicable to only 1.3.1xx alone, for now. ###@###.### 2005-03-29 18:49:01 GMT
2004-10-27

WORK AROUND Use the application without Citrix. ###@###.### 10/27/04 19:56 GMT
2004-10-27