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

Bug in Federated Execution with RTI host specification #2244

Open
vinzbarbuto opened this issue Mar 13, 2024 · 3 comments
Open

Bug in Federated Execution with RTI host specification #2244

vinzbarbuto opened this issue Mar 13, 2024 · 3 comments

Comments

@vinzbarbuto
Copy link
Collaborator

Hello,

I stumbled upon a tricky bug when specifying your RTI host as demonstrated below:

federated reactor DistributedTest at 192.168.1.6 {

After the building phase, the resulting executable file appears as follows:

...
38 ssh 192.168.1.6 'mkdir -p log; \
39    echo "-------------- Federation ID: "'$FEDERATION_ID' >> log/CoralTestC_RTI.log; \
40    date >> log/CoralTestC_RTI.log; \
41    echo "Executing RTI: RTI -i '${FEDERATION_ID}' \
42                        -n 2 \
43                       -c init \
44 exchanges-per-interval 10 \" 2>&1 | tee -a log/CoralTestC_RTI.log; \
45    # First, check if the RTI is on the PATH
46  if ! command -v RTI &> /dev/null
...

After debugging, that is, removing the & for background execution, I encountered the error zsh:18: unmatched "

I discovered that the bug resided on line 44, where the \" acted as an escape sequence for the character ". The federated program functions seamlessly after removing the separator \.

I hope this insight proves helpful.

@edwardalee
Copy link
Collaborator

I just pushed a possible fix to this to the lingua-franca branch include-clock-sync which has this PR. Can you check whether the script is fixed in that branch?

@vinzbarbuto
Copy link
Collaborator Author

Actually, no, this issue is specifically related to the automatic generation of the executable file in the bin/ folder. It's distinct from the include-clock-sync problem. However, after conducting tests, I've confirmed that the \" sequence still persists in the executable.

@edwardalee
Copy link
Collaborator

Hmm... I must have dreamed that I made this fix... I've posted another PR with a two-character fix for this problem.

For me, however, there is still difficulty using this because when you ssh a command on a remote machine, it does not source any profile files, so the PATH variable does not get set, and, for me, the RTI is not found. I think the "right" fix for this is a bigger project than I can take on now (the RTI should be code generated and launched just like a federate). There are patches we could put into the current mechanism, or you can just move the RTI into /bin on the remote machine.

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

No branches or pull requests

2 participants