Skip to content

scripts: Fix port aliasing bug in blackboard entry loading#44

Merged
otavio merged 4 commits intomasterfrom
fix_port_alias
Mar 29, 2026
Merged

scripts: Fix port aliasing bug in blackboard entry loading#44
otavio merged 4 commits intomasterfrom
fix_port_alias

Conversation

@nandojve
Copy link
Copy Markdown
Contributor

Summary

  • Fix loadBlackboardEntries to use copy.deepcopy(entry) instead of appending shared references, preventing all instances of the same node type from getting the same blackboard ref when they have different port bindings
  • Add port_alias sample exercising the fix with WriteValue/ReadValue nodes bound to distinct blackboard variables ({variable_a} and {variable_b})

Fixes #40

Test plan

  • Run the generator against the port_alias sample XML and verify distinct .ref values in the generated _data.c
  • Build and run the port_alias sample on qemu_cortex_m3 — confirm write_value and read_value nodes access their own blackboard variables
  • Verify existing samples (dynamic, subtree_reuse, tutorial) still generate correctly

Supersides #42

nandojve and others added 4 commits March 29, 2026 18:08
Add .envrc file to automatically enable nix exposing correct tools
including the code formating software.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
Remove all un-referenced default variables to save memory. In addition,
print the variable name in the C vector code.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
Add a sample that validates multiple instances of the same node type
with different port bindings get distinct blackboard references.

This serves as a regression test for the port aliasing bug fixed in
issue #40.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
The loadBlackboardEntries function returned references to shared entry
objects from blackboard_set. When multiple instances of the same node
type had different port bindings, each instance overwrote entry[4],
causing all instances to end up with the same blackboard ref.

Use copy.deepcopy(entry) to ensure each node instance gets its own
copy of the blackboard entry, so port bindings are resolved correctly.

Fixes #40

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
@otavio otavio merged commit 1ccce23 into master Mar 29, 2026
3 checks passed
@otavio otavio deleted the fix_port_alias branch March 29, 2026 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Port Aliasing Bug

2 participants