nl-utwente-groove / code

GROOVE code base
https://groove.cs.utwente.nl
4 stars 0 forks source link

Error during graph merge (simplicity property?!) #774

Closed rensink closed 2 weeks ago

rensink commented 2 weeks ago

The precise circumstances are not clear. Here's a stack trace:

Exception in thread "AWT-EventQueue-0" java.lang.AssertionError: Graphs should have same simplicity property
    at nl.utwente.groove/nl.utwente.groove.grammar.aspect.AspectGraph.mergeGraphs(AspectGraph.java:722)
    at nl.utwente.groove/nl.utwente.groove.grammar.model.GrammarModel.getStartGraphModel(GrammarModel.java:394)
    at nl.utwente.groove/nl.utwente.groove.grammar.model.GrammarModel.computeGrammar(GrammarModel.java:551)
    at nl.utwente.groove/nl.utwente.groove.grammar.model.GrammarModel.initGrammar(GrammarModel.java:488)
    at nl.utwente.groove/nl.utwente.groove.grammar.model.GrammarModel.getErrors(GrammarModel.java:423)
    at nl.utwente.groove/nl.utwente.groove.grammar.model.GrammarModel.hasErrors(GrammarModel.java:430)
    at nl.utwente.groove/nl.utwente.groove.gui.action.ExplorationDialogAction.refresh(ExplorationDialogAction.java:25)
    at nl.utwente.groove/nl.utwente.groove.gui.action.ActionStore.refreshActions(ActionStore.java:81)
    at nl.utwente.groove/nl.utwente.groove.gui.action.ActionStore.update(ActionStore.java:59)
    at nl.utwente.groove/nl.utwente.groove.gui.SimulatorModel.fireUpdate(SimulatorModel.java:1364)
    at nl.utwente.groove/nl.utwente.groove.gui.SimulatorModel.finish(SimulatorModel.java:1333)
    at nl.utwente.groove/nl.utwente.groove.gui.SimulatorModel.doAddGraph(SimulatorModel.java:257)
    at nl.utwente.groove/nl.utwente.groove.gui.action.SaveAction.doSaveGraph(SaveAction.java:91)
    at nl.utwente.groove/nl.utwente.groove.gui.action.SaveAction.execute(SaveAction.java:63)
    at nl.utwente.groove/nl.utwente.groove.gui.action.SimulatorAction.actionPerformed(SimulatorAction.java:224)
    at java.desktop/javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1810)
    at java.desktop/javax.swing.JComponent.processKeyBinding(JComponent.java:2947)
    at java.desktop/javax.swing.JComponent.processKeyBindings(JComponent.java:3009)
    at java.desktop/javax.swing.JComponent.processKeyEvent(JComponent.java:2909)
    at java.desktop/java.awt.Component.processEvent(Component.java:6403)
    at java.desktop/java.awt.Container.processEvent(Container.java:2266)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5001)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
    at java.desktop/java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1952)
    at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:883)
    at java.desktop/java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1150)
    at java.desktop/java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:1020)
    at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:848)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4882)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
    at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:746)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:744)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:743)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
rensink commented 2 weeks ago

The simplicity property message is not the root of the problem - something happened in the SimulatorModel, a transaction was started that was not finished. Added try - finally to all start/finish pairs in the SimulatorModel in an attempt to avoid this in the future; without further information, it's the best I can do

rensink commented 2 weeks ago

This can be reproduced in the enclosed rule system by editing and then saving one of the enabled start graphs. The graph is actually saved (as can be discovered by restarting GROOVE) but the reported crash happens.

reaction-simplified.gps.zip

rensink commented 2 weeks ago

Apparently, a just-edited host graph (more precisely, its AspectGraph) was marked as "simple" whereas they are not "simple" when loaded. This discrepancy emerges only when merging multiple start graphs into one, specifically after editing one of them. Rather than marking this as a conflict, the solution is now to make the merged graph non-simple as soon as one of the operands is non-simple.