Project

General

Profile

Bug #4064

Synthesis View: Crash when opening without an imported project

Added by Simon Barner 24 days ago. Updated 15 days ago.

Status:
Resolved
Priority:
Normal
Category:
-
Start date:
09/30/2020
Due date:
% Done:

100%

Estimated time:
2.00 h

Description

Steps to reproduce
  • Switch to DSE perspective
  • Open synthesis view
  • Select synthesis type (e.g. Deployment)
  • Observe below NPE
Hint:
  • Probably, the synthesis, constrants und visualization button should be disabled as long as no project has been imported.
  • However, also the synthesis view should be made more robust and should prevent this NPE (the view might be restored without using the "Synthesis" button after closing and starting AF3)
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
    at org.fortiss.af3.exploration.ui.perspective.synthesis.SynthesisFXContentController.enableDisableRuleSetButtons(SynthesisFXContentController.java:628)
    at org.fortiss.af3.exploration.ui.perspective.synthesis.SynthesisFXContentController.propertyChanged(SynthesisFXContentController.java:592)
    at org.fortiss.af3.exploration.ui.perspective.service.EventBroker.firePropertyChanged(EventBroker.java:66)
    at org.fortiss.af3.exploration.ui.perspective.synthesis.SynthesisFXViewPart$1.onChanged(SynthesisFXViewPart.java:108)
    at javafx.base/com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
    at javafx.base/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
    at javafx.base/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:233)
    at impl.org.controlsfx.collections.ReadOnlyUnbackedObservableList.callObservers(ReadOnlyUnbackedObservableList.java:44)
    at org.controlsfx.control.CheckBitSetModelBase.lambda$new$1(CheckBitSetModelBase.java:125)
    at javafx.base/com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
    at javafx.base/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
    at javafx.base/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:233)
    at impl.org.controlsfx.collections.ReadOnlyUnbackedObservableList.callObservers(ReadOnlyUnbackedObservableList.java:44)
    at org.controlsfx.control.CheckBitSetModelBase$3.invalidated(CheckBitSetModelBase.java:315)
    at javafx.base/com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:348)
    at javafx.base/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
    at javafx.base/javafx.beans.property.BooleanPropertyBase.fireValueChangedEvent(BooleanPropertyBase.java:104)
    at javafx.base/javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:111)
    at javafx.base/javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:145)
    at javafx.base/com.sun.javafx.binding.BidirectionalBinding$BidirectionalBooleanBinding.changed(BidirectionalBinding.java:264)
    at javafx.base/com.sun.javafx.binding.BidirectionalBinding$BidirectionalBooleanBinding.changed(BidirectionalBinding.java:227)
    at javafx.base/com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(ExpressionHelper.java:181)
    at javafx.base/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
    at javafx.base/javafx.beans.property.BooleanPropertyBase.fireValueChangedEvent(BooleanPropertyBase.java:104)
    at javafx.base/javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:111)
    at javafx.base/javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:145)
    at javafx.controls/javafx.scene.control.CheckBox.setSelected(CheckBox.java:157)
    at javafx.controls/javafx.scene.control.CheckBox.fire(CheckBox.java:237)
    at javafx.controls/com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:206)
    at javafx.controls/com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274)
    at javafx.base/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
    at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
    at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
    at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
    at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
    at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
    at javafx.graphics/javafx.scene.Scene$MouseHandler.process(Scene.java:3862)
    at javafx.graphics/javafx.scene.Scene.processMouseEvent(Scene.java:1849)
    at javafx.graphics/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2590)
    at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:409)
    at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:299)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:447)
    at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:412)
    at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:446)
    at javafx.graphics/com.sun.glass.ui.View.handleMouseEvent(View.java:556)
    at javafx.graphics/com.sun.glass.ui.View.notifyMouse(View.java:942)
    at org.eclipse.swt.internal.win32.OS.DispatchMessage(Native Method)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3585)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1160)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1049)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:660)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:559)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:154)
    at org.fortiss.af3.rcp.application.AF3Application.start(AF3Application.java:49)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
ACC.af3_23 (1.16 MB) ACC.af3_23 Corrupted ACC model (line 11408ff) Simon Barner, 10/07/2020 04:20 PM
resource-out-of-sync.PNG (23.2 KB) resource-out-of-sync.PNG Simon Barner, 10/07/2020 04:21 PM

History

#1 Updated by Alexander Diewald 18 days ago

  • Status changed from New to Resolved
  • Assignee changed from Alexander Diewald to Simon Barner
  • % Done changed from 0 to 100

All items are implemented.

Please note for testing:
Another bug has been resolved within this ticket that prevented AF3 projects to load successfully if a user defined custom SolverSettings (Backend settings). Please verify that this bug is fixed, too :)

MR: https://git.fortiss.org/af3/af3/-/merge_requests/372

#2 Updated by Simon Barner 17 days ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Simon Barner to Alexander Diewald
The current behavior of synthesis view when it is restored: There are buttons, but they are non-operational. I recommend the following:
  • Either, gray out out buttons in the view until a project is imported
  • Automatically load the previous project when the view is restored.

When testing, I noted another bug when importing a fresh copy of the ACC model from the modeling perspective. Due to this bug I could not test he SolverSettings restoration.

If you can confirm, we can also trace this in a separate ticket:

!ENTRY org.fortiss.af3.rcp.application 4 0 2020-10-07 08:55:39.022
!MESSAGE The project cannot be loaded.
!STACK 0
java.lang.NullPointerException
    at java.base/java.io.File.<init>(File.java:278)
    at org.fortiss.af3.project.utils.ProjectUtils.importFileProject(ProjectUtils.java:272)
    at org.fortiss.af3.project.ui.utils.ImportProjectUtils.importUISelectedFile(ImportProjectUtils.java:158)
    at org.fortiss.af3.rcp.application.handler.ApplicationCommandHandler.loadExistingModel(ApplicationCommandHandler.java:100)
    at org.fortiss.af3.rcp.application.handler.ApplicationCommandHandler$LoadACCExampleCommandHandler.execute(ApplicationCommandHandler.java:277)
    at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:283)
    at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:97)

#3 Updated by Alexander Diewald 17 days ago

  • Status changed from Feedback to Resolved
  • Assignee changed from Alexander Diewald to Simon Barner

Please formulate problem description more precisely in future. Importing means a file import from an arbitrary location of the local file system. The issue only occurs when loading an example project.

This has been fixed now. Please update to the head of the branch.

The root cause was located in the underlying project "import" code that is shared by the import and the example loading: It was based on file descriptors that are not able to handle plugin resources. This was a result from resolving #4059. By using In-/OutputStreams, we are now agnostic of the actual descriptors.

#4 Updated by Simon Barner 17 days ago

Unfortunately, there are some further problems that prevent me from testing this ticket (if something is unclear, just contact me...!)

Steps to reproduce
  • Start with a fresh runtime workspace
  • Load the ACC example
  • Set the Safety Standard in the PA's annotations to ISO 26262 (seems to be a new requirement of the import wizard)
    • the resulting model should be used to update the template in the RCP such that we have a model that can directly be imported into the DSE perspective
    • Save the project. From time to time, I observe a message window that the resource ACC.af3_23 is out of sync with the file systems. In this case, ignore it and restart AF3 to be sure.
  • Switch to the DSE perspective and import the model
    • Open the synthesis view, select Deployment and _Check feasibility"
    • What until the DSE has finished
    • Save the model (now I got the resource out-of-sync error here)
    • Switching back and forth between Modelling and DSE I was able to work around this
  • When restarting AF3, observe that the model is corrupt.
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'org.fortiss.af3.exploration.smt.backend.Z3Backend@325410ce' is not legal. (platform:/resource/AF3-Project-Directory/ACC.af3_23, 11408, 90)
    at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2715)
    at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setAttribValue(XMLHandler.java:2769)
    at org.eclipse.emf.ecore.xmi.impl.SAXXMIHandler.handleObjectAttribs(SAXXMIHandler.java:79)
    at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFactory(XMLHandler.java:2247)
    at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFeatureType(XMLHandler.java:2213)
    at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObject(XMLHandler.java:2089)
    at org.eclipse.emf.ecore.xmi.impl.XMIHandler.createObject(XMIHandler.java:151)
    at org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLHandler.java:1868)
    at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1048)
    at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:82)
    at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:1026)
    at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:720)
    at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:190)
    at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:510)
    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1397)
    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2710)
    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:534)
    at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888)
    at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824)
    at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
    at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1216)
    at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:635)
    at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:324)
    at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175)
    ... 34 more
In summary, there are the following three problems:
  1. Safety standard needs to be preset for ACC example
  2. Resource out-of-sync when saving the model (frequent, but not always)
  3. Corrupted model when saving after deployment synthesis

#5 Updated by Alexander Diewald 16 days ago

  • Assignee changed from Alexander Diewald to Simon Barner
  • Estimated time set to 2.00 h

Issues resolved. I also found and resolved another UI bug: Switch to the DSE Perspective, load a model, go to the synthesis view, switch back to the modelling view, delete the model. No errors should be logged now. Before, there were invalid thread accesses.

The solver setting storing is correct now: The handling was based on instances, instead of IDSEBackend classes as it should have been from the beginning. Stupid beginners mistake...

The Resource-out-of-Sync problem is a local one and could not be reproduced.

#6 Updated by Simon Barner 15 days ago

  • Status changed from Feedback to Resolved
  • Assignee changed from Simon Barner to Alexander Diewald

Merged, thanks.

A few more remarks:
  • The following problem that there are enabled buttons in the Synthesis View with an imported DSE model (when the view is restored after a restart of AF3 ) should probably better be resolved when the handling of views in the DSE perspective is cleaned up (e.g., request to save pseudo resources named after the views when closing AF3 from the DSE perspective
  • The request to update the ACC model in the RCP application has been included into a more general task for the release preparation (#4069)
  • I could not observe the resource out-of-sync problems on Linux, so it probably really has something to do with my Windows installation

#7 Updated by Alexander Diewald 15 days ago

  • Assignee changed from Alexander Diewald to Simon Barner

#8 Updated by Simon Barner 15 days ago

  • Assignee changed from Simon Barner to Alexander Diewald

ACC model update has been merged.

Also available in: Atom PDF