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

Reaction is executed without triggering #1489

Closed
a-sr opened this issue Nov 22, 2022 · 2 comments
Closed

Reaction is executed without triggering #1489

a-sr opened this issue Nov 22, 2022 · 2 comments
Assignees
Labels
bug Something isn't working c Related to C target
Milestone

Comments

@a-sr
Copy link
Collaborator

a-sr commented Nov 22, 2022

In the following program, the reaction in ForwardFailure is executed without a justified triggering (failure is never set).

target C
reactor OnlySuccess {
    input start:bool
    output success:bool
    output failure:bool
    
    reaction (start)  -> success, failure {=
        lf_print("Create Success");
        lf_set(success, true);
    =}
}
reactor ForwardFailure {
    input in:bool
    output out:bool
    reaction (in) -> out {=
        lf_print("Forward Failure");
        lf_set(out, true);
    =}
}
reactor Sequence {
    input start:bool
    output success:bool
    output failure:bool
    s = new OnlySuccess();
    f = new ForwardFailure();
    start -> s.start
    s.success -> success
    s.failure -> f.in
    f.out -> failure
}
main reactor {
    s = new Sequence()
    reaction(startup) -> s.start {=
        lf_print("Start");
        lf_set(s.start, true);
    =}
// Uncommenting this reaction will fix the problem 
// ForwardFailure is no longer executed
//    reaction(s.success) {=
//        lf_print("Success");
//    =}
    reaction(s.failure) {=
        lf_print("Failure");
    =}
}

IllegalTriggering

Produced output:

Start
Create Success
Forward Failure
Failure

The problem seems to relate to the fact that the output at the success port is not consumed. If uncommenting the reaction in the main reactor, the program yields the correct behavior:

Start
Create Success
Success

This issue may relate to the bug reported in #1433. There, an unused connection seems to be involve in the suppression of a reaction triggering.

@a-sr a-sr added the bug Something isn't working label Nov 22, 2022
@cmnrd cmnrd added the c Related to C target label Nov 23, 2022
@petervdonovan
Copy link
Collaborator

To me, this looks the same as #1321, which is still unresolved.

@edwardalee
Copy link
Collaborator

This is fixed with #2416.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working c Related to C target
Projects
None yet
Development

No branches or pull requests

5 participants