United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6175601 : javawebstart crash if autoproxy script uses IsInNet function

Details
Type:
Bug
Submit Date:
2004-10-07
Status:
Closed
Updated Date:
2012-10-09
Project Name:
JDK
Resolved Date:
2004-11-10
Component:
deploy
OS:
windows_xp,windows,windows_2000
Sub-Component:
webstart
CPU:
x86
Priority:
P2
Resolution:
Fixed
Affected Versions:
5.0,5.0u1
Fixed Versions:

Related Reports
Backport:
Duplicate:
Duplicate:

Sub Tasks

Description
setup the following proxy.pac script:

function FindProxyForURL(url,host) {
   isInNet(host, "255.255.0.0", "255.255.0.0");
   return "PROXY scaweb1.sfbay.sun.com:8080";
}

set it in IE as the auto proxy script, make sure IE is default browser, have java web start use browser proxy settings.  java web start will try to parse the auto proxy script, and crash the vm:


#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d3e791e, pid=2748, tid=3704
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0-b64 mixed mode, sharing)
# Problematic frame:
# C  [jpicom32.dll+0x791e]
#

---------------  T H R E A D  ---------------

Current thread (0x00843570):  JavaThread "Thread-4" [_thread_in_native, id=3704]

siginfo: ExceptionCode=0xc0000005, reading address 0x00000000

Registers:
EAX=0x00000000, EBX=0x0000000d, ECX=0x00869164, EDX=0x7c97e4c0
ESP=0x1395d174, EBP=0x1395d194, ESI=0x00000000, EDI=0x1395d2d0
EIP=0x6d3e791e, EFLAGS=0x00010246

  Top of Stack: (sp=0x1395d174)
0x1395d174:   00000000 6d3e796b 7ffab000 0000001f
0x1395d184:   6d3e7956 1395d1d0 6d3e9bc4 ffffffff
0x1395d194:   1395d1e0 6d3e331a 0000001d 0000001f
0x1395d1a4:   6d4056ca 00869164 00000000 0000001d
0x1395d1b4:   00000000 6d405811 1395d2d0 7c801d77
0x1395d1c4:   0000000d 7c919aeb 1395cd98 1395e1e0
0x1395d1d4:   6d40a0c6 6d40ba40 00000000 1395d3e0
0x1395d1e4:   6d591abf 6d597990 1395dd98 1395d474

Instructions: (pc=0x6d3e791e)
0x6d3e790e:   5e c2 04 00 a1 18 05 3f 6d c3 a1 18 05 3f 6d 50
0x6d3e791e:   8b 08 ff 51 14 c3 8b 44 24 04 a3 18 05 3f 6d c3


Stack: [0x13920000,0x13960000),  sp=0x1395d174,  free space=244k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [jpicom32.dll+0x791e]
C  [jpicom32.dll+0x331a]
C  [npjpi150.dll+0x1abf]
C  [ole32.dll+0x47de2]
C  [ole32.dll+0x4fdb4]
C  [ole32.dll+0x4face]
C  [ole32.dll+0x5f7bb]
C  [ole32.dll+0x5f6a2]
C  [ole32.dll+0x5f88d]
C  [ole32.dll+0x5f839]
C  [ole32.dll+0x5052b]
C  [ole32.dll+0x504e2]
C  [ole32.dll+0x5f8e0]
C  [ole32.dll+0x5f6a2]
C  [ole32.dll+0x5f6bc]
C  [ole32.dll+0x5f6a2]
C  [ole32.dll+0x5f536]
C  [ole32.dll+0x5f3ef]
C  [ole32.dll+0x5f371]
C  [jscript.dll+0x318de]
C  [jscript.dll+0x4a4c7]
C  [jscript.dll+0x4d0b8]
C  [jscript.dll+0x10d5f]
C  [jscript.dll+0x77f6]
C  [jscript.dll+0x10db3]
C  [jscript.dll+0x4d34]
C  [jscript.dll+0x11512]
C  [jscript.dll+0x77f6]
C  [jscript.dll+0x6e58]
C  [jscript.dll+0x4d34]
C  [jscript.dll+0x11512]
C  [jscript.dll+0x77f6]
C  [jscript.dll+0x6e58]
C  [jscript.dll+0x4d34]
C  [jscript.dll+0x11512]
C  [jscript.dll+0x77f6]
C  [jscript.dll+0x6e58]
C  [jscript.dll+0x4d34]
C  [jscript.dll+0x655f]
C  [jscript.dll+0xcf2c]
C  [jscript.dll+0xeeb4]
C  [jscript.dll+0xed06]
C  [deploy.dll+0x4061]
C  [deploy.dll+0x4ac3]
j  com.sun.deploy.net.proxy.WIExplorerAutoProxyHandler.evalScript(Ljava/lang/String;)Ljava/lang/String;+0
j  com.sun.deploy.net.proxy.WIExplorerAutoProxyHandler.getProxyInfo(Ljava/net/URL;)[Lcom/sun/deploy/net/proxy/ProxyInfo;+60
j  com.sun.deploy.net.proxy.DynamicProxyManager.getProxyInfo(Ljava/net/URL;)Lcom/sun/deploy/net/proxy/ProxyInfo;+96
j  com.sun.deploy.net.proxy.DeployProxySelector.select(Ljava/net/URI;)Ljava/util/List;+114
j  sun.net.www.protocol.http.HttpURLConnection.plainConnect()V+187
j  sun.net.www.protocol.http.HttpURLConnection.connect()V+1
j  com.sun.javaws.net.BasicNetworkLayer.doRequest(Ljava/net/URL;Z[Ljava/lang/String;[Ljava/lang/String;Z)Lcom/sun/javaws/net/HttpResponse;+156
j  com.sun.javaws.net.BasicNetworkLayer.doHeadRequest(Ljava/net/URL;)Lcom/sun/javaws/net/HttpResponse;+6
j  com.sun.javaws.cache.DownloadProtocol.doDownload(Lcom/sun/javaws/cache/DownloadProtocol$DownloadInfo;Lcom/sun/javaws/cache/DownloadProtocol$DownloadAction;)V+186
j  com.sun.javaws.cache.DownloadProtocol.isUpdateAvailable(Ljava/net/URL;Ljava/lang/String;I)Z+33
j  com.sun.javaws.cache.CacheImageLoader$DelayedImageLoader.run()V+23
v  ~StubRoutines::call_stub
V  [jvm.dll+0x8168d]
V  [jvm.dll+0xd4179]
V  [jvm.dll+0x8155e]
V  [jvm.dll+0x812bb]
V  [jvm.dll+0x9bbe9]
V  [jvm.dll+0xfe77f]
V  [jvm.dll+0xfe74d]
C  [MSVCRT.dll+0x2a3b0]
C  [kernel32.dll+0xb50b]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  com.sun.deploy.net.proxy.WIExplorerAutoProxyHandler.evalScript(Ljava/lang/String;)Ljava/lang/String;+0
j  com.sun.deploy.net.proxy.WIExplorerAutoProxyHandler.getProxyInfo(Ljava/net/URL;)[Lcom/sun/deploy/net/proxy/ProxyInfo;+60
j  com.sun.deploy.net.proxy.DynamicProxyManager.getProxyInfo(Ljava/net/URL;)Lcom/sun/deploy/net/proxy/ProxyInfo;+96
j  com.sun.deploy.net.proxy.DeployProxySelector.select(Ljava/net/URI;)Ljava/util/List;+114
j  sun.net.www.protocol.http.HttpURLConnection.plainConnect()V+187
j  sun.net.www.protocol.http.HttpURLConnection.connect()V+1
j  com.sun.javaws.net.BasicNetworkLayer.doRequest(Ljava/net/URL;Z[Ljava/lang/String;[Ljava/lang/String;Z)Lcom/sun/javaws/net/HttpResponse;+156
j  com.sun.javaws.net.BasicNetworkLayer.doHeadRequest(Ljava/net/URL;)Lcom/sun/javaws/net/HttpResponse;+6
j  com.sun.javaws.cache.DownloadProtocol.doDownload(Lcom/sun/javaws/cache/DownloadProtocol$DownloadInfo;Lcom/sun/javaws/cache/DownloadProtocol$DownloadAction;)V+186
j  com.sun.javaws.cache.DownloadProtocol.isUpdateAvailable(Ljava/net/URL;Ljava/lang/String;I)Z+33
j  com.sun.javaws.cache.CacheImageLoader$DelayedImageLoader.run()V+23
v  ~StubRoutines::call_stub

---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x00863a90 JavaThread "TimerQueue" daemon [_thread_blocked, id=2700]
  0x0085c020 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=2984]
  0x0084a1e0 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=916]
=>0x00843570 JavaThread "Thread-4" [_thread_in_native, id=3704]
  0x00841030 JavaThread "DestroyJavaVM" [_thread_blocked, id=2752]
  0x008417e0 JavaThread "javawsApplicationMain" [_thread_blocked, id=2828]
  0x0083ee80 JavaThread "traceMsgQueueThread" [_thread_blocked, id=476]
  0x00838740 JavaThread "AWT-Windows" daemon [_thread_in_native, id=480]
  0x00838cc0 JavaThread "AWT-Shutdown" [_thread_blocked, id=2792]
  0x00831b90 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=1364]
  0x00824a70 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2784]
  0x0082fde0 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2756]
  0x0082ee80 JavaThread "Finalizer" daemon [_thread_blocked, id=2764]
  0x0082dca0 JavaThread "Reference Handler" daemon [_thread_blocked, id=660]

Other Threads:
  0x0082cf00 VMThread [id=228]
  0x00832740 WatcherThread [id=2788]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
 def new generation   total 576K, used 447K [0x22b80000, 0x22c20000, 0x23060000)
  eden space 512K,  74% used [0x22b80000, 0x22bdffe8, 0x22c00000)
  from space 64K, 100% used [0x22c00000, 0x22c10000, 0x22c10000)
  to   space 64K,   0% used [0x22c10000, 0x22c10000, 0x22c20000)
 tenured generation   total 1408K, used 1041K [0x23060000, 0x231c0000, 0x26b80000)
   the space 1408K,  73% used [0x23060000, 0x23164420, 0x23164600, 0x231c0000)
 compacting perm gen  total 8192K, used 1281K [0x26b80000, 0x27380000, 0x2ab80000)
   the space 8192K,  15% used [0x26b80000, 0x26cc07f8, 0x26cc0800, 0x27380000)
    ro space 8192K,  62% used [0x2ab80000, 0x2b087160, 0x2b087200, 0x2b380000)
    rw space 12288K,  46% used [0x2b380000, 0x2b90c1c0, 0x2b90c200, 0x2bf80000)

Dynamic libraries:
0x00400000 - 0x0040c000     C:\Program Files\Java\jre1.5.0\bin\javaw.exe
0x7c900000 - 0x7c9b0000     C:\WINDOWS\system32\ntdll.dll
0x7c800000 - 0x7c8f4000     C:\WINDOWS\system32\kernel32.dll
0x77dd0000 - 0x77e6b000     C:\WINDOWS\system32\ADVAPI32.dll
0x77e70000 - 0x77f01000     C:\WINDOWS\system32\RPCRT4.dll
0x77d40000 - 0x77dd0000     C:\WINDOWS\system32\USER32.dll
0x77f10000 - 0x77f56000     C:\WINDOWS\system32\GDI32.dll
0x77c10000 - 0x77c68000     C:\WINDOWS\system32\MSVCRT.dll
0x629c0000 - 0x629c9000     C:\WINDOWS\system32\LPK.DLL
0x74d90000 - 0x74dfb000     C:\WINDOWS\system32\USP10.dll
0x6d640000 - 0x6d7c5000     C:\Program Files\Java\jre1.5.0\bin\client\jvm.dll
0x76b40000 - 0x76b6d000     C:\WINDOWS\system32\WINMM.dll
0x6d280000 - 0x6d288000     C:\Program Files\Java\jre1.5.0\bin\hpi.dll
0x76bf0000 - 0x76bfb000     C:\WINDOWS\system32\PSAPI.DLL
0x6d610000 - 0x6d61c000     C:\Program Files\Java\jre1.5.0\bin\verify.dll
0x6d300000 - 0x6d31d000     C:\Program Files\Java\jre1.5.0\bin\java.dll
0x6d630000 - 0x6d63f000     C:\Program Files\Java\jre1.5.0\bin\zip.dll
0x6d000000 - 0x6d166000     C:\Program Files\Java\jre1.5.0\bin\awt.dll
0x73000000 - 0x73026000     C:\WINDOWS\system32\WINSPOOL.DRV
0x76390000 - 0x763ad000     C:\WINDOWS\system32\IMM32.dll
0x774e0000 - 0x7761c000     C:\WINDOWS\system32\ole32.dll
0x73760000 - 0x737a9000     C:\WINDOWS\system32\ddraw.dll
0x73bc0000 - 0x73bc6000     C:\WINDOWS\system32\DCIMAN32.dll
0x73940000 - 0x73a10000     C:\WINDOWS\system32\D3DIM700.DLL
0x12df0000 - 0x12dfd000     C:\WINDOWS\system32\SKHOOKS.dll
0x63000000 - 0x63014000     C:\WINDOWS\system32\SynTPFcs.dll
0x77c00000 - 0x77c08000     C:\WINDOWS\system32\VERSION.dll
0x74720000 - 0x7476b000     C:\WINDOWS\system32\MSCTF.dll
0x6d1f0000 - 0x6d203000     C:\Program Files\Java\jre1.5.0\bin\deploy.dll
0x771b0000 - 0x77256000     C:\WINDOWS\system32\WININET.dll
0x77f60000 - 0x77fd6000     C:\WINDOWS\system32\SHLWAPI.dll
0x77a80000 - 0x77b14000     C:\WINDOWS\system32\CRYPT32.dll
0x77b20000 - 0x77b32000     C:\WINDOWS\system32\MSASN1.dll
0x77120000 - 0x771ac000     C:\WINDOWS\system32\OLEAUT32.dll
0x77260000 - 0x772fc000     C:\WINDOWS\system32\urlmon.dll
0x7c9c0000 - 0x7d1d4000     C:\WINDOWS\system32\SHELL32.dll
0x773d0000 - 0x774d2000     C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll
0x5d090000 - 0x5d127000     C:\WINDOWS\system32\comctl32.dll
0x6d5d0000 - 0x6d5ed000     C:\Program Files\Java\jre1.5.0\bin\RegUtils.dll
0x7d1e0000 - 0x7d492000     C:\WINDOWS\system32\msi.dll
0x769c0000 - 0x76a73000     C:\WINDOWS\system32\USERENV.dll
0x77fe0000 - 0x77ff1000     C:\WINDOWS\system32\Secur32.dll
0x76ee0000 - 0x76f1c000     C:\WINDOWS\system32\RASAPI32.DLL
0x76e90000 - 0x76ea2000     C:\WINDOWS\system32\rasman.dll
0x71ab0000 - 0x71ac7000     C:\WINDOWS\system32\WS2_32.dll
0x71aa0000 - 0x71aa8000     C:\WINDOWS\system32\WS2HELP.dll
0x5b860000 - 0x5b8b4000     C:\WINDOWS\system32\NETAPI32.dll
0x76eb0000 - 0x76edf000     C:\WINDOWS\system32\TAPI32.dll
0x76e80000 - 0x76e8e000     C:\WINDOWS\system32\rtutils.dll
0x722b0000 - 0x722b5000     C:\WINDOWS\system32\sensapi.dll
0x6d4c0000 - 0x6d4d3000     C:\Program Files\Java\jre1.5.0\bin\net.dll
0x71a50000 - 0x71a8f000     C:\WINDOWS\System32\mswsock.dll
0x76f20000 - 0x76f47000     C:\WINDOWS\system32\DNSAPI.dll
0x76fb0000 - 0x76fb8000     C:\WINDOWS\System32\winrnr.dll
0x76f60000 - 0x76f8c000     C:\WINDOWS\system32\WLDAP32.dll
0x76fc0000 - 0x76fc6000     C:\WINDOWS\system32\rasadhlp.dll
0x662b0000 - 0x66308000     C:\WINDOWS\system32\hnetcfg.dll
0x71a90000 - 0x71a98000     C:\WINDOWS\System32\wshtcpip.dll
0x76fd0000 - 0x7704f000     C:\WINDOWS\system32\CLBCATQ.DLL
0x77050000 - 0x77115000     C:\WINDOWS\system32\COMRes.dll
0x75c50000 - 0x75cbe000     c:\windows\system32\jscript.dll
0x6d240000 - 0x6d27d000     C:\Program Files\Java\jre1.5.0\bin\fontmanager.dll
0x20000000 - 0x202c5000     C:\WINDOWS\system32\xpsp2res.dll
0x6d590000 - 0x6d5a1000     C:\Program Files\Java\jre1.5.0\bin\npjpi150.dll
0x5edd0000 - 0x5ede7000     C:\WINDOWS\system32\OLEPRO32.DLL
0x6d4e0000 - 0x6d4e9000     C:\Program Files\Java\jre1.5.0\bin\nio.dll
0x6d400000 - 0x6d417000     C:\Program Files\Java\jre1.5.0\bin\jpiexp32.dll
0x71ad0000 - 0x71ad9000     C:\WINDOWS\system32\wsock32.dll
0x6d450000 - 0x6d468000     C:\Program Files\Java\jre1.5.0\bin\jpishare.dll
0x6d1c0000 - 0x6d1e3000     C:\Program Files\Java\jre1.5.0\bin\dcpr.dll
0x6d3e0000 - 0x6d3f4000     C:\Program Files\Java\jre1.5.0\bin\jpicom32.dll

VM Arguments:
jvm_args: -Xbootclasspath/a:C:\Program Files\Java\jre1.5.0\lib\javaws.jar;C:\Program Files\Java\jre1.5.0\lib\deploy.jar -Djnlpx.home=C:\Program Files\Java\jre1.5.0\bin -Djnlpx.splashport=1091 -Djnlpx.jvm="C:\Program Files\Java\jre1.5.0\bin\javaw.exe" -Djnlpx.remove=true -Djava.security.policy=file:C:\Program Files\Java\jre1.5.0\lib\security\javaws.policy -DtrustProxy=true -Xverify:remote -Djnlpx.heapsize=NULL,NULL
java_command: com.sun.javaws.Main C:\DOCUME~1\TERESA~1\LOCALS~1\Temp\javaws7

Environment Variables:
PATH=C:\PROGRA~1\Java\JRE15~1.0\bin;C:\Program Files\Java\jre1.5.0\bin;C:\Program Files\Internet Explorer;;C:\PROGRAM FILES\THINKPAD\UTILITIES;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ATI Technologies\ATI Control Panel;C:\Program Files\PC-Doctor for Windows\services;"C:\Program Files\Java\jre1.5.0\bin";.
USERNAME=TERESA M NANEZ
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 6 Model 9 Stepping 5, GenuineIntel


---------------  S Y S T E M  ---------------

OS: Windows XP Build 2600 Service Pack 2

CPU:total 1 family 6, cmov, cx8, fxsr, mmx, sse, sse2

Memory: 4k page, physical 1047472k(676508k free), swap 2522708k(2245056k free)

vm_info: Java HotSpot(TM) Client VM (1.5.0-b64) for windows-x86, built on Sep 15 2004 03:00:31 by "java_re" with MS VC++ 6.0
###@###.### 10/7/04 17:45 GMT

                                    

Comments
EVALUATION

The crash is caused by a bug in com/sun/deploy/net/proxy/AutoProxyScript.java, where we provide our own implementation of the javascript function for auto proxy script support (e.g IsInNet, dnsResolve, ... etc).

In our implementation of  DnsResolve (IE version), we call into:

 "var jpi = new ActiveXObject('JavaPlugin');" +
         "return jpi.dnsResolve(host);" +

In the customer proxy pac script, it uses the IsInNet function, which will in turns calls into the DnsResolve, which causes the vm crash when running this with java web start.
###@###.### 10/7/04 18:03 GMT
                                     
2004-10-07
SUGGESTED FIX

one way to fix this problem is to provide a ActiveX control that contains the dnsResolve native implementation, similar to the Plugin ActiveX control.

Java Web Start already has a ActiveX control "JavaWebStart.isInstalled" to detect whether java web start is installed on the client system.  We might be able to put the dnsResolve implementation here too, and load that if we encounter that during auto proxy detection, instead of loading the Plugin ActiveX control.

So basically we need to copy a few functions in src/plugin/win32/com/IExplorer/AxControll.cpp to
src/javaws/win32/activeX/isInstalled.cpp
###@###.### 10/11/04 20:05 GMT

http://web-east.east/deployment/www/webrevs/ngthomas/6175601/webrev/
###@###.### 10/18/04 23:58 GMT
                                     
2004-10-11



Hardware and Software, Engineered to Work Together