Hardware Simulator crashes

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Hardware Simulator crashes

Uli Kastlunger
This post was updated on .
Hello,

unfortunately there seem to be bugs in the GUI of the hardware simulator, but maybe it's also a bug in fucking old AWT.

kuli@ares:~/tecs/projects/05$ java -version
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)

kuli@ares:~/tecs/projects/05$ Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at javax.swing.BufferStrategyPaintManager.flushAccumulatedRegion(BufferStrategyPaintManager.java:399)
        at javax.swing.BufferStrategyPaintManager.endPaint(BufferStrategyPaintManager.java:363)
        at javax.swing.RepaintManager.endPaint(RepaintManager.java:1288)
        at javax.swing.JComponent._paintImmediately(JComponent.java:5078)
        at javax.swing.JComponent.paintImmediately(JComponent.java:4882)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:785)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:713)
        at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:693)
        at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:125)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

... after running ComputerRect.test

I think the problem is that there is an invalid thread access to awt/swing components (swing is not thread save). See also:
http://www.mail-archive.com/java2d-interest@capra.eng.sun.com/msg05135.html

best regards,
uli
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hardware Simulator crashes

Uli Kastlunger
ClassCastException(!):

Exception in thread "Thread-44" java.lang.ClassCastException: HackGUI.PointedMemoryComponent cannot be cast to java.awt.Window
        at javax.swing.BufferStrategyPaintManager$BufferInfo.createBufferStrategy(BufferStrategyPaintManager.java:846)
        at javax.swing.BufferStrategyPaintManager$BufferInfo.createBufferStrategy(BufferStrategyPaintManager.java:797)
        at javax.swing.BufferStrategyPaintManager$BufferInfo.getBufferStrategy(BufferStrategyPaintManager.java:730)
        at javax.swing.BufferStrategyPaintManager.prepare(BufferStrategyPaintManager.java:506)
        at javax.swing.BufferStrategyPaintManager.copyArea(BufferStrategyPaintManager.java:305)
        at javax.swing.RepaintManager.copyArea(RepaintManager.java:1239)
        at javax.swing.JViewport.blitDoubleBuffered(JViewport.java:1604)
        at javax.swing.JViewport.windowBlitPaint(JViewport.java:1573)
        at javax.swing.JViewport.setViewPosition(JViewport.java:1118)
        at javax.swing.JViewport.scrollRectToVisible(JViewport.java:415)
        at javax.swing.JComponent.scrollRectToVisible(JComponent.java:3065)
        at HackGUI.Utilities.tableCenterScroll(Unknown Source)
        at HackGUI.PointedMemoryComponent.setPointer(Unknown Source)
        at builtInChips.ROM32K.reCompute(Unknown Source)
        at Hack.Gates.Gate.doEval(Unknown Source)
        at Hack.Gates.Gate.eval(Unknown Source)
        at Hack.Gates.CompositeGate.reCompute(Unknown Source)
        at Hack.Gates.Gate.doEval(Unknown Source)
        at Hack.Gates.Gate.tock(Unknown Source)
        at Hack.HardwareSimulator.HardwareSimulator.performTock(Unknown Source)
        at Hack.HardwareSimulator.HardwareSimulator.doCommand(Unknown Source)
        at Hack.Controller.HackController.miniStep(Unknown Source)
        at Hack.Controller.HackController.singleStep(Unknown Source)
        at Hack.Controller.HackController.access$000(Unknown Source)
        at Hack.Controller.HackController$SingleStepTask.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:619)

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hardware Simulator crashes

Uli Kastlunger
And another:

Exception in thread "Thread-19" java.lang.NullPointerException
        at javax.swing.BufferStrategyPaintManager.prepare(BufferStrategyPaintManager.java:509)
        at javax.swing.BufferStrategyPaintManager.copyArea(BufferStrategyPaintManager.java:305)
        at javax.swing.RepaintManager.copyArea(RepaintManager.java:1239)
        at javax.swing.JViewport.blitDoubleBuffered(JViewport.java:1604)
        at javax.swing.JViewport.windowBlitPaint(JViewport.java:1573)
        at javax.swing.JViewport.setViewPosition(JViewport.java:1118)
        at javax.swing.JViewport.scrollRectToVisible(JViewport.java:415)
        at javax.swing.JComponent.scrollRectToVisible(JComponent.java:3065)
        at HackGUI.Utilities.tableCenterScroll(Unknown Source)
        at HackGUI.PointedMemoryComponent.setPointer(Unknown Source)
        at builtInChips.RAM.reCompute(Unknown Source)
        at Hack.Gates.Gate.doEval(Unknown Source)
        at Hack.Gates.Gate.eval(Unknown Source)
        at Hack.Gates.CompositeGate.reCompute(Unknown Source)
        at Hack.Gates.Gate.doEval(Unknown Source)
        at Hack.Gates.Gate.eval(Unknown Source)
        at Hack.Gates.CompositeGate.reCompute(Unknown Source)
        at Hack.Gates.Gate.doEval(Unknown Source)
        at Hack.Gates.Gate.tock(Unknown Source)
        at Hack.HardwareSimulator.HardwareSimulator.performTock(Unknown Source)
        at Hack.HardwareSimulator.HardwareSimulator.doCommand(Unknown Source)
        at Hack.Controller.HackController.miniStep(Unknown Source)
        at Hack.Controller.HackController.singleStep(Unknown Source)
        at Hack.Controller.HackController.access$000(Unknown Source)
        at Hack.Controller.HackController$FastForwardTask.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:619)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hardware Simulator crashes

Uli Kastlunger
In reply to this post by Uli Kastlunger
I could reproduce the bug only, iff the GUI elements of RAM 16K, ROM and the registers were visible (by resizing the window, which btw. uses fixed sizes for its sub-components). If only the screen is visible, then the problem doesn't occur.
Loading...