Raw topic subscription crashes node under Cyclone when subscriber leaves
See original GitHub issueBug report
Required Info:
- Operating System:
- Ubuntu 18.04
- Version or commit hash:
- Foxy
- DDS implementation:
- Cyclone
- Client library (if applicable):
- rclpy
Steps to reproduce issue
Minimal subscriber example, slightly modified to use raw=True and output the raw msg instead of a string
import rclpy
from rclpy.node import Node
from std_msgs.msg import String
class MinimalSubscriber(Node):
def __init__(self):
super().__init__('minimal_subscriber')
self.subscription = self.create_subscription(
String,
'topic',
self.listener_callback,
10,
raw=True )
self.subscription # prevent unused variable warning
def listener_callback(self, msg):
self.get_logger().info(f'I got: {msg}')
def main(args=None):
rclpy.init(args=args)
minimal_subscriber = MinimalSubscriber()
rclpy.spin(minimal_subscriber)
# Destroy the node explicitly
# (optional - otherwise it will be done automatically
# when the garbage collector destroys the node object)
minimal_subscriber.destroy_node()
rclpy.shutdown()
if __name__ == '__main__':
main()
Run this node under a Cyclone DDS setup. In a second terminal, publish to the topic, and then stop publishing
ros2 topic pub /topic std_msgs/msg/String
...
Ctrl+c
Expected behavior
The node stays up and happy
Actual behavior
Traceback (most recent call last):
File "minimal_crash.py", line 38, in <module>
main()
File "minimal_crash.py", line 28, in main
rclpy.spin(minimal_subscriber)
File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/__init__.py", line 191, in spin
executor.spin_once()
File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/executors.py", line 711, in spin_once
raise handler.exception()
File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/task.py", line 239, in __call__
self._handler.send(None)
File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/executors.py", line 419, in handler
arg = take_from_wait_list(entity)
File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/executors.py", line 344, in _take_subscription
msg_info = _rclpy.rclpy_take(capsule, sub.msg_type, sub.raw)
_rclpy.RCLError: Failed to take_serialized from a subscription: error not set
Additional information
Default dds, or removing raw=True fixes the crash
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Subscription and publication to same topic from one node ...
I'm trying to both listen and publish to the same topic from one node. No matter in which order I try, I get...
Read more >Documentation - Apache Kafka
We'll call processes that subscribe to topics and process the feed of published messages consumers.. Kafka is run as a cluster comprised of...
Read more >Untitled
A place for CycloneReport.com subscribers to talk non-sports topics. 1 2 3 … ... The 1981-2010 average number of named storms in the...
Read more >Bug listing with status RESOLVED with resolution OBSOLETE ...
issue with udev ("the udev init script is written for baselayout 2, please do not use this script with baselayout 1")" status:RESOLVED resolution:OBSOLETE ......
Read more >RAW: MT: SNOWY WEATHER CAUSES MULTIPLE CRASHES
Montana Highway Patrol, report the initial accident came from one vehicle hitting a guard rail, causing multiple cars to rear-end and hit ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
https://docs.ros.org/en/foxy/Installation/Ubuntu-Development-Setup.html has the instructions on building from source for Foxy.
@fujitatomoya I suppose I could try.
Do I understand correctly that this should suffice in handling
rcl_take_serialized_message
result?Are there instructions on how to setup the necessary build environment?