JDK-6538511 : NPE when removing one of the monitors at runtime, win32
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6u2
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2007-03-24
  • Updated: 2012-01-16
Related Reports
Relates :  
Relates :  
Relates :  
Description
I am running a swing application which opens up a JFrame on each monitor in a multi-mon virtual screen system. When both the frames are shown, I am opening the display settings and removing one of the monitors. This was crashing the VM on JDK6-FCS but on 6u2-b01, it throws a NullPointerException. This exception is intermittent but I was able to reproduce 5 out of 10 times. This was reproduced on WinXPProf with ATI Radeon 9600 video card. This was not reproducible on WinXP with Nvidia GeForce4 FX5900. So I tend to think that it could be video card specific.

Here is the exception -
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at sun.awt.image.VolatileSurfaceManager.displayChanged(VolatileSurfaceManager.java:316)
at sun.awt.SunDisplayChanger.notifyListeners(SunDisplayChanger.java:102)
at sun.awt.Win32GraphicsEnvironment.displayChanged(Win32GraphicsEnvironment.java:175)
at sun.awt.windows.WToolkit$4.run(WToolkit.java:755)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

To reproduce the bug, run the attached test on the specified config using 6u2-b01. When both the frames appear in the respective monitors, go to display settings and remove the secondary monitor. Ideally, the frame on the sec monitor should be moved to the primary. But if you see the above exception on the console, the bug is reproduced.

Comments
EVALUATION This is the same stack trace that is seen in two other bug reports: 6325718 (X11 pipeline, on Unix) 6319745 (OGL pipeline, on Windows) Now that it's been reported for three different platforms/pipelines, it seems that it is a generic problem (would be nice to kill three birds with one stone if we can get to the root of the problem). As mentioned in 6325718, it comes down to some sort of synchronization or timing issue.
25-03-2007