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

Intra_process_demo is not zero-copy if doing external communications as well #412

Closed
AlexisTM opened this issue Oct 30, 2019 · 4 comments
Closed

Comments

@AlexisTM
Copy link

Bug report

Intra process communication has a

Required Info:

Steps to reproduce issue

  • Run ros2 run intra_process_demo two_node_pipeline
  • Experience zero-copy (received object address == published object address)
  • Run ros2 topic echo number
  • The received object doesn't have the same address as the published one anymore

Expected behavior

I expect the received object address to always be the published object address even when also subscribing to the topic externally.

Actual behavior

The received object has been copied.

Additional information

NOTE: The object is reallocated to the same address in the lambda function

NOTE: The Published address when listening is equal to the last received address; Due to allocation optimization?

$ ros2 run intra_process_demo two_node_pipeline
Published message with value: 0, and address: 0x563E68561220
 Received message with value: 0, and address: 0x563E68561220
Published message with value: 1, and address: 0x563E68561220
 Received message with value: 1, and address: 0x563E68561220
Published message with value: 2, and address: 0x563E68561220
 Received message with value: 2, and address: 0x563E68561220
Published message with value: 3, and address: 0x563E68561220
 Received message with value: 3, and address: 0x563E68561220
Published message with value: 4, and address: 0x563E68561220
 Received message with value: 4, and address: 0x563E68561220
Published message with value: 5, and address: 0x563E68561220
 Received message with value: 5, and address: 0x563E68561220
Published message with value: 6, and address: 0x563E68561220
 Received message with value: 6, and address: 0x563E68561220
Published message with value: 7, and address: 0x563E68561220
 Received message with value: 7, and address: 0x563E68561220
Published message with value: 8, and address: 0x563E68561220
 Received message with value: 8, and address: 0x563E685D29D0
Published message with value: 9, and address: 0x563E685D29D0
 Received message with value: 9, and address: 0x563E68561220
Published message with value: 10, and address: 0x563E68561220
 Received message with value: 10, and address: 0x563E685D29D0
Published message with value: 11, and address: 0x563E685D29D0
 Received message with value: 11, and address: 0x563E68561220
Published message with value: 12, and address: 0x563E68561220
 Received message with value: 12, and address: 0x563E68561220
$ ros2 topic echo number
data: 8
---
data: 9
---
data: 10
---
data: 11
---
@hidmic
Copy link
Contributor

hidmic commented Nov 4, 2019

@AlexisTM what rclcpp version are you running against?

@AlexisTM
Copy link
Author

AlexisTM commented Nov 5, 2019

ros-dashing-rclcpp/bionic,now 0.7.11-1bionic.20191016.192455 amd64 [installed,automatic]

@hidmic
Copy link
Contributor

hidmic commented Nov 5, 2019

Alright, yeah, I see the problem. I'll open an issue on rclcpp, to assess whether to hotfix or backport (as this is fixed in Eloquent). Thanks for reporting!

@AlexisTM
Copy link
Author

AlexisTM commented Nov 5, 2019

Closing in favor of: ros2/rclcpp#912

@AlexisTM AlexisTM closed this as completed Nov 5, 2019
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