Closed fujitatomoya closed 2 years ago
@MiguelCompany i am not sure if this is bug, could you take a look? CC: @Barry-Xu-2018 @iuhilnehc-ynos
@fujitatomoya Sorry for the late answer (we were on Easter holidays here). This seems to have been previously reported at eProsima/Fast-DDS#2533, but we didn't have time to check it yet.
We will reproduce and debug it this week.
@MiguelCompany Any thoughts on what might be going on here?
Any thoughts on what might be going on here?
Not much yet. I could reproduce it, but not in a deterministic way (so nothing that could be turned into a regression test). I've been debugging it a bit, but didn't get to a conclusion yet.
@MiguelCompany Should the TopicPayloadPool::shrink() function be something like this?
bool TopicPayloadPool::shrink (
uint32_t max_num_payloads)
{
assert(max_num_payloads == 0 || payload_pool_allocated_size() - payload_pool_available_size() <= max_num_payloads);
while (max_num_payloads < all_payloads_.size())
{
if (free_payloads_.empty())
{
// This may happen if max_num_payloads is zero.
break;
}
PayloadNode* payload = free_payloads_.back();
free_payloads_.pop_back();
// Find data in allPayloads, remove element, then delete it
all_payloads_.at(payload->data_index()) = all_payloads_.back();
all_payloads_.back()->data_index(payload->data_index());
all_payloads_.pop_back();
delete payload;
}
return true;
}
I understand that zero is a valid value of max_num_payloads. Is it correct?
@fujitatomoya @clalancette This should have been fixed by eProsima/Fast-DDS#2853, backport to 2.6.x
pending CI on eProsima/Fast-DDS#2861
@MiguelCompany
add_two_ints_client: /root/ros2_ws/colcon_ws/src/eProsima/Fast-DDS/src/cpp/rtps/history/TopicPayloadPool.cpp:263: bool eprosima::fastrtps::rtps::TopicPayloadPool::shrink(uint32_t): Assertion `payload_pool_allocated_size() - payload_pool_available_size() <= max_num_payloads' failed.
[ros2run]: Aborted
above problem has been solved, i cannot reproduce that assertion.
but, we can see service not available
message instead.
# ./test.sh
root@tomoyafujita:~/ros2_ws/colcon_ws# [INFO] [1658999884.962398783] [add_two_ints_client]: Result of add_two_ints: 5
[INFO] [1658999884.971446955] [add_two_ints_client]: Result of add_two_ints: 5
[INFO] [1658999884.975172233] [add_two_ints_client]: Result of add_two_ints: 5
[INFO] [1658999884.980538959] [add_two_ints_client]: Result of add_two_ints: 5
[INFO] [1658999884.987139210] [add_two_ints_client]: Result of add_two_ints: 5
[INFO] [1658999884.988729905] [add_two_ints_client]: Result of add_two_ints: 5
[INFO] [1658999884.990040116] [add_two_ints_client]: Result of add_two_ints: 5
[INFO] [1658999884.998537695] [add_two_ints_client]: Result of add_two_ints: 5
[INFO] [1658999885.001958420] [add_two_ints_client]: Result of add_two_ints: 5
[INFO] [1658999885.061093777] [add_two_ints_client]: Result of add_two_ints: 5
[INFO] [1658999885.061093287] [add_two_ints_client]: Result of add_two_ints: 5
[INFO] [1658999885.974434720] [add_two_ints_client]: service not available, waiting again...
[INFO] [1658999885.976093427] [add_two_ints_client]: service not available, waiting again...
[INFO] [1658999885.979039142] [add_two_ints_client]: service not available, waiting again...
[INFO] [1658999885.985281537] [add_two_ints_client]: service not available, waiting again...
@fujitatomoya This was already fixed and backported. Do you think we can close it?
Bug report
Required Info:
Steps to reproduce issue
Expected behavior
test.sh succeeds w/o error
Actual behavior
assertion failture
Additional information
core stack trace with debug build.
gdb ./build/demo_nodes_cpp/add_two_ints_client core
```bash # gdb ./build/demo_nodes_cpp/add_two_ints_client core GNU gdb (Ubuntu 12.0.90-0ubuntu1) 12.0.90 Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later