Skip to content
New issue

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

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

Already on GitHub? # to your account

Segmentation fault error during federated execution caused by multiport #1717

Closed
jackyk02 opened this issue Apr 27, 2023 · 2 comments
Closed

Comments

@jackyk02
Copy link
Collaborator

jackyk02 commented Apr 27, 2023

target Python;

reactor ClientReactor {
    input global_parameter
    output updated_parameters
    
    reaction(startup) {=
        global_parameter = 0
     =}
     
     reaction(global_parameter) -> updated_parameters {=
        print(global_parameter.value)
        global_temp = global_parameter.value + 1
        updated_parameters.set(global_temp)
    =}
}

reactor ServerReactor{
    output global_parameter
    input[2] updated_parameters  
    
    reaction(startup) -> global_parameter{=
        global_temp = 0
        global_parameter.set(global_temp)
    =}
    
    reaction(updated_parameters) -> global_parameter{=
        global_temp = updated_parameters[0].value + updated_parameters[1].value
        print(global_temp)
        global_parameter.set(global_temp)
    =}
}

federated reactor{
    clients = new [2]ClientReactor()
    Server = new ServerReactor()
    (Server.global_parameter)+ -> clients.global_parameter after 0
    clients.updated_parameters -> Server.updated_parameters 
}

image

Description: I encountered a segmentation fault when executing the provided code in a federated setting. However, the same code works without any issues when running in an unfederated setting. The error appears to be caused by the use of multiport for federated execution.

ClientReactors Output
startup reaction of both clients seems to be fine:
image
image

ServerReactor Ouput
image

The problems seems to be caused by the convert_C_port_to_py function
image

@lhstrh
Copy link
Member

lhstrh commented May 22, 2023

Suggested fix in lf-lang/lf-python-support#25 but needs to be applied to reactor-c because the files moved. Tagging @petervdonovan.

@petervdonovan
Copy link
Collaborator

Resolved by lf-lang/reactor-c#218

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants