JDK-4881229 : Imagefetcher thread hangs the browser/applet with re-directed URLs
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.4.2,5.0,6u21,6u23,7
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic,windows_xp
  • CPU: generic,x86
  • Submitted: 2003-06-19
  • Updated: 2014-03-14
  • Resolved: 2014-03-14
Related Reports
Duplicate :  
Description
If the URL used with URLImageSource is re-directed by the webserver to a different host, the browser and the appletviewer hangs after security exception is thrown.

Steps to reproduce
1)Install JRE1.4.2
2)Run the applet located at http://neurosis.hungry.com/~ben/msie_bug
3)Click the Go button in the applet


Comments
Please re-open if - if fix is in progress or on the plan to fix soon - if this is a P3 (file as P3, not P4)
14-03-2014

EVALUATION The security exception is H:\tests\4881229>j:/jdk1.5/windows-i586/bin/appletviewer -J-DtrustProxy=true -J- Dhttp.proxyHost=scaweb1.sfbay.sun.com -J-Dhttp.proxyPort=8080 http://neurosis.hu ngry.com/~ben/msie_bug/index.html Warning: Temporarily overwriting system property at user's request: key: http.pr oxyPort old value: 80 new value: 8080 Warning: Temporarily overwriting system property at user's request: key: http.pr oxyHost old value: -1 new value: scaweb1.sfbay.sun.com Uncaught error fetching image: java.lang.SecurityException at java.lang.SecurityManager.checkPermission(SecurityManager.java:562) at java.lang.SecurityManager.checkConnect(SecurityManager.java:1078) at sun.awt.image.URLImageSource.checkSecurity(URLImageSource.java:81) at sun.awt.image.ImageRepresentation.imageComplete(ImageRepresentation.j ava:597) at sun.awt.image.InputStreamImageSource.errorConsumer(InputStreamImageSo urce.java:131) at sun.awt.image.InputStreamImageSource.setDecoder(InputStreamImageSourc e.java:331) at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.j ava:252) at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:172) at sun.awt.image.ImageFetcher.run(ImageFetcher.java:136) after which the applet wasn't totally responsive (I couldn't press the button again but it did repaint correctly). I assume that is just the uncaught exception. Anyway, I think 2D owns ImageFetcher and sun.awt.image, so I'll pass this to them for the next cut at evaluation. ###@###.### 2003-06-19 The app hangs because EDT is blocked: "AWT-EventQueue-1" prio=4 tid=0x0067f3a8 nid=0x15 in Object.wait() [0xd37ff000..0xd37ffb90] at java.lang.Object.wait(Native Method) - waiting on <0xee381c78> (a java.awt.MediaTracker) at java.awt.MediaTracker.waitForID(MediaTracker.java:631) - locked <0xee381c78> (a java.awt.MediaTracker) at java.awt.MediaTracker.waitForID(MediaTracker.java:586) at example0.action(example0.java:58) at java.awt.Component.handleEvent(Component.java:5672) at java.awt.Component.postEvent(Component.java:4206) at java.awt.Component.postEvent(Component.java:4216) at java.awt.Component.dispatchEventImpl(Component.java:3938) at java.awt.Component.dispatchEvent(Component.java:3770) at java.awt.EventQueue.dispatchEvent(EventQueue.java:463) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:214) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149) at java.awt.EventDispatchThread.run(EventDispatchThread.java:110) MediaTracker didn't get notified when ImageFetcher thread quit because of the exception. We should probably signal image loading error to the user besides the exception, so the app can proceed. this may require extensive changes, because we follow the same pattern everywhere in the code. This problem has been there forever (since 1.2). One workaround would be to load images on a separate thread, so if it gets blocked, the EDT can still work. ###@###.### 2003-10-17
17-10-2003