Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception error in Undo #1234

Open
mengstr opened this issue Nov 18, 2023 · 3 comments
Open

Exception error in Undo #1234

mengstr opened this issue Nov 18, 2023 · 3 comments

Comments

@mengstr
Copy link

mengstr commented Nov 18, 2023

[Edit: I forgot to attach the software version info
Screenshot 2023-11-18 at 13 03 11
]
It has happened twice before in this particular design. The undo stops working but everything else is fine. After restarting Digital the undo is back to working normally with no messages during startup except stating that a port has been opened. So it seems like the file can be loaded fine and there are no errors in it.

mats@Matss-MacBook-Pro ~ % digital
[AWT-EventQueue-0] INFO de.neemann.digital.gui.Main - open remote port 41114

Here's an abridged version of what's printed in the console when I try to "undo" when the problem is in effect.. Full log is attached.

java.lang.RuntimeException: internal error in undo
	at de.neemann.digital.gui.components.CircuitComponent.undo(CircuitComponent.java:554)
	at de.neemann.digital.gui.components.CircuitComponent.access$100(CircuitComponent.java:58)
	at de.neemann.digital.gui.components.CircuitComponent$3.actionPerformed(CircuitComponent.java:190)
	at java.desktop/javax.swing.SwingUtilities.notifyAction(Unknown Source)
	at java.desktop/javax.swing.JComponent.processKeyBinding(Unknown Source)
	at java.desktop/javax.swing.JComponent.processKeyBindings(Unknown Source)
	at java.desktop/javax.swing.JComponent.processKeyEvent(Unknown Source)
	at java.desktop/java.awt.Component.processEvent(Unknown Source)
	at java.desktop/java.awt.Container.processEvent(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
	at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
	at java.desktop/java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
	at java.desktop/java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
	at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
Caused by: de.neemann.digital.undo.ModifyException: Exception during event processing
 Selection deleted.
 Wire inserted.
 Component 'Text' inserted.
 Attributes of component 'Text' modified.
 Selection moved.

.....<SNIP>.....

 Component 'Pull-Up Resistor' inserted.
 Component 'Pull-Down Resistor' inserted.
 Component 'Pull-Down Resistor' inserted.
 Selection deleted.
 Component 'NOr' moved or rotated.
>
	at de.neemann.digital.undo.UndoManager.createTrace(UndoManager.java:140)
	at de.neemann.digital.undo.UndoManager.undo(UndoManager.java:121)
	at de.neemann.digital.gui.components.CircuitComponent.undo(CircuitComponent.java:552)
	... 37 more
Caused by: de.neemann.digital.undo.ModifyException: internal error: Wire not found!
	at de.neemann.digital.gui.components.modification.ModificationOfWire.getWire(ModificationOfWire.java:53)
	at de.neemann.digital.gui.components.modification.ModifyDeleteWire.modify(ModifyDeleteWire.java:29)
	at de.neemann.digital.gui.components.modification.ModifyDeleteWire.modify(ModifyDeleteWire.java:16)
	at de.neemann.digital.undo.UndoManager.undo(UndoManager.java:114)
	... 38 more
[AWT-EventQueue-0] INFO de.neemann.digital.gui.DigitalUncaughtExceptionHandler - uncaught exception log written to /Users/mats/Digital_2023-11-18_12-47-22.log

Digital_2023-11-18_12-47-22.log

@hneemann
Copy link
Owner

Are you able to reproduce this error?
I have known about this bug for a long time and have tried to fix it several times without success, as it cannot be reproduced.

@mengstr
Copy link
Author

mengstr commented Nov 18, 2023

Unfortunately not. After restart it works for many hours until it just suddenly bugs out. (Which happened twice on this design)

I can't recall it ever happened in another design, but my PDP8 project that I worked on a lot a couple of years ago tended to get slower and slower doing the undos until it took several seconds per undo. But I think you fixed that issue by keeping fewer steps in the undo-buffer.

This bug is not very important considering the program doesn't crash or makes you lose any work. Digital is really really crash resilient compared to other softwares in the same size and complexity. It's nice to know that it just works and you don't need to save your design every 5 minutes.

@hneemann
Copy link
Owner

See #919 and #364

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants