JDK-4037797 : FilteredImageSource synchronization problems
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.1
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.5.1
  • CPU: generic
  • Submitted: 1997-03-10
  • Updated: 2025-10-12
  • Resolved: 2025-10-12
Related Reports
Duplicate :  
Relates :  
Description
The "Hashtable proxies" instance variable in class java.awt.FilteredImageSource can be inadvertantly corrupted due to certain methods begin unsynchronized.  For example, if removeConsumer() is called while startProduction() is executing, the proxies instance var can be set to null.  The workaround, briefly, is:

subclass FilteredImageSource and implement the startProduction method to be synchronized.  

See the workaround section for a detailed description of the workaround.  

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)
18-03-2014

SUGGESTED FIX Go thru the FilteredImageSource class and make sure all the methods that need to be synchronized are synchronized.
17-09-2004

EVALUATION [jim.graham@Eng 1997-04-22] The submitter is correct. Also, the requestTopDownLeftRightResend method could incur an exception due to the same problem. It isn't quite necessary to synchronize that method since it's operation is optional and if the proxies goes to null while that method is operating then it is OK to simply not do anything. All that is needed is to fetch the field value once into a local variable and then do all further processing (null testing, etc.) on that local variable. Name: dsR10078 Date: 07/04/2001 The problem still exist in merlin b69. ###@###.### 2001-07-02 ======================================================================
02-07-2001

WORK AROUND class laFixedFilteredImageSource extends FilteredImageSource { public laFixedFilteredImageSource(ImageProducer orig, ImageFilter imgf) { super(orig, imgf); } synchronized public void startProduction(ImageConsumer ic) { super.startProduction(ic); } } // End of class laFixedFilteredImageSource ed.burns@Eng 1997-03-10
10-03-1997