osate / osate2

Open Source AADL2 Tool Environment
http://osate.org
Eclipse Public License 2.0
39 stars 8 forks source link

Annex/EMV2 error with fault tree analysis #1718

Closed maximouth closed 5 years ago

maximouth commented 5 years ago

Summary

Hello,

I am trying to launch a Fault Tree Analysis on my AADL model with some error annex code in it.

Expected and Current Behavior

When I try to launch it on a specific port output, it works well. But when I try to launch it on a specific state I have got the message Error null Argument from Osate.

Here I post the Exeception stack trace of Osate :+1:

org.eclipse.core.runtime.AssertionFailedException: null argument:
    at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:85)
    at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:73)
    at org.eclipse.sirius.ui.business.internal.dialect.editor.DialectEditorCloserFilter.<init>(DialectEditorCloserFilter.java:45)
    at org.eclipse.sirius.ui.business.internal.dialect.editor.DialectEditorCloser.<init>(DialectEditorCloser.java:45)
    at org.eclipse.sirius.ui.business.internal.session.EditingSession.attachEditor(EditingSession.java:160)
    at org.eclipse.sirius.ui.tools.internal.editor.AbstractDTreeEditor.init(AbstractDTreeEditor.java:371)
    at org.eclipse.sirius.table.ui.tools.internal.editor.AbstractDTableEditor.init(AbstractDTableEditor.java:208)
    at org.eclipse.ui.internal.EditorReference.initialize(EditorReference.java:362)
    at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:333)
    at sun.reflect.GeneratedMethodAccessor191.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
    at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:990)
    at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:955)
    at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:124)
    at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:399)
    at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:318)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
    at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:105)
    at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:74)
    at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:56)
    at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:129)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:992)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:661)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:767)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$0(PartRenderingEngine.java:738)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:732)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:716)
    at org.eclipse.e4.ui.internal.workbench.PartServiceImpl$1.handleEvent(PartServiceImpl.java:104)
    at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:40)
    at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:233)
    at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:144)
    at org.eclipse.swt.widgets.Display.syncExec(Display.java:5535)
    at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:212)
    at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:36)
    at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:201)
    at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
    at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
    at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
    at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
    at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
    at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:52)
    at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:60)
    at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
    at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:173)
    at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:620)
    at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:584)
    at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:769)
    at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.bringToTop(PartServiceImpl.java:401)
    at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:1188)
    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:3261)
    at org.eclipse.ui.internal.WorkbenchPage.access$25(WorkbenchPage.java:3176)
    at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:3158)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3153)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3117)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3098)
    at org.eclipse.sirius.table.ui.business.internal.dialect.TableDialectUIServices$1.run(TableDialectUIServices.java:128)
    at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:233)
    at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:144)
    at org.eclipse.swt.widgets.Display.syncExec(Display.java:5535)
    at org.eclipse.sirius.common.ui.tools.api.util.EclipseUIUtil.displaySyncExec(EclipseUIUtil.java:336)
    at org.eclipse.sirius.table.ui.business.internal.dialect.TableDialectUIServices.openEditor(TableDialectUIServices.java:134)
    at org.eclipse.sirius.ui.business.internal.dialect.DialectUIManagerImpl.openEditor(DialectUIManagerImpl.java:95)
    at org.osate.aadl2.errormodel.faulttree.util.SiriusUtil.autoOpenModel(SiriusUtil.java:385)
    at org.osate.aadl2.errormodel.faulttree.handler.FTAHandler.execute(FTAHandler.java:166)
    at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:291)
    at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:92)
    at sun.reflect.GeneratedMethodAccessor160.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:305)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:239)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
    at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
    at org.eclipse.core.commands.Command.executeWithChecks(Command.java:494)
    at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:487)
    at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
    at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:431)
    at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.handleWidgetSelection(AbstractContributionItem.java:446)
    at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.lambda$2(AbstractContributionItem.java:472)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5348)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1348)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4602)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4183)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1039)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1472)

and here my Session data

eclipse.buildId=unknown
java.version=1.8.0_191
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments:  -os linux -ws gtk -arch x86_64

This is a continuation of log file /home/myself/tools/osate2/workspace/.metadata/.bak_0.log
Created Time: 2019-02-27 15:07:33.317

Steps to Reproduce

  1. Instantiate System Impl fgs.impl
  2. Run Fault tree analysis on ot
  3. Chose Fault tree with Computed probability and CricitalModeFailure state in the select error state case.
-- fgs.aadl
package FGS
public
    with EMV2;

    system fgs
        features
            P1: in  data port;
            P2: out data port;

    end fgs;    

    system implementation fgs.impl
        subcomponents
            fg1 : device fg;
            fg2 : device fg;
            ap1 : device ap;
            ap2 : device ap;
            ac1 : device ac;
        connections
            input1 : port P1      -> fg1.P1;
            input2 : port P1      -> fg2.P1;
            fgap1  : port fg1.P2  -> ap1.P1;
            fgap2  : port fg2.P2  -> ap2.P1;
            apac1  : port ap1.P2  -> ac1.P1;
            apac2  : port ap2.P2  -> ac1.P1;
            acout1 : port ac1.P2  -> P2;

            annex EMV2 {**
          --composite error behavior
          use types ErrorModelLibrary;
          use behavior ErrorModelLibrary::ThreeState;

          error propagations
            P1 : in propagation {NoValue};
            P2: out propagation {Critical, NonCritical,NoValue};
          end propagations;     

          component error behavior
            propagations    
                CriticalModeFailure    -[]-> P2{Critical};
--              NonCriticalModeFailure -[]-> P2{NonCritical};
--              Operational            -[]-> P2{NonCritical};
                all -[]-> P2{Novalue};
            end component;

          composite error behavior
            states
            [ AP1.Operational and AP2.Operational and
                FG1.Operational and FG2.Operational and AC1.Operational ]-> Operational;
            [ (AP1.Failed or AP2.Failed)  ]-> NonCriticalModeFailure;
            [ AC1.Failed or (AP1.Failed and FG1.Failed) or (AP1.Failed and FG2.Failed) ]-> CriticalModeFailure;
            end composite;

**};

    end fgs.impl;

    device fg
        features
            P1: in  data port;
            P2: out data port;
        annex EMV2{**
            -- fg component
            use types ErrorModelLibrary;
            use behavior ErrorModelLibrary::Simple;
            error propagations
                P1: in propagation {NoValue};
                P2: out propagation {NoValue};
            end propagations;

            component error behavior
            propagations    
                Failed -[]-> P2{Novalue};
                Operational -[ P1{NoValue}]-> P2{NoValue};              
            end component;
        **};
    end fg;

    device implementation fg.impl

    end fg.impl;

    device ap
        features
            P1: in  data port;
            P2: out data port;
        annex EMV2 {**
            -- AP component
            use types ErrorModelLibrary;
            use behavior ErrorModelLibrary::Simple;
            error propagations
                P1: in propagation {NoValue};
                P2: out propagation {NoValue};
            end propagations;

            component error behavior
            propagations        
                Failed -[]-> P2{Novalue};
                Operational -[ P1{NoValue}]-> P2{NoValue};
            end component;
        **};
    end ap;

device implementation ap.impl

    end ap.impl;

    device ac
        features
            P1: in  data port;
            P2: out data port;
                -- AC component
        annex EMV2 {**
        use types ErrorModelLibrary;
        use behavior ErrorModelLibrary::Simple;
        error propagations
            P1: in propagation {NoValue};
            P2: out propagation {NoValue};
        end propagations;

        component error behavior
        propagations
            Failed -[]-> P2{NoValue};
            Operational -[P1{NoValue}]-> P2{NoValue};
        end component;
        **};    
    end ac;

    device implementation ac.impl

    end ac.impl;
end FGS;
-- ErrorModelLibrary.aadl
package ErrorModelLibrary
public
annex EMV2 {**
    error types
        Critical    : type;
        NonCritical : type;
        NoValue     : type;
        Fail        : type;
    end types;

    error behavior Simple
    events
        Failure: error event;
    States
        Operational: initial state;
        Failed: state;
    Transitions
        BadValueTransition : Operational -[Failure]-> Failed;
        properties
        emv2::OccurrenceDistribution => [ ProbabilityValue => 4.5e-5 ; Distribution => Poisson;] applies to Failure;

    end behavior;

    error behavior ThreeState
    events 
        Failuree: error event;
        toto : error event;
    States
        Operational: initial state;
        NonCriticalModeFailure: state;
        CriticalModeFailure: state;
--  transitions
--      Faileappend : Operational         -[Failuree]-> (CriticalModeFailure with 0.8,
--                                                     NonCriticalModeFailure with 0.2);
--      Recovery    : NonCriticalModeFailure  -[toto]-> (Operational with 0.5, 
--                                                     CriticalModeFailure with 0.5);
    properties
        emv2::OccurrenceDistribution => [ ProbabilityValue => 4.5e-5 ; Distribution => Poisson;] applies to Failuree;

    end behavior;

**};

-- Annex subclause for FGS system

End ErrorModelLibrary;

Environment

reteprelief commented 5 years ago

I could not reproduce the error.

The log shows that error occurs when OSATE tries to open the Sirius based editor on the fault tree. At that time the fault tree has already been generated. My guess is that the "representations.aird" file in your project that Sirius maintains its diagrams in got corrupted. Delete the file and invoke the fault tree analysis again.

maximouth commented 5 years ago

done and it's work, thank you.