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

Custom service crash when deserializing request #27

Open
martinfri opened this issue Jun 13, 2024 · 3 comments
Open

Custom service crash when deserializing request #27

martinfri opened this issue Jun 13, 2024 · 3 comments

Comments

@martinfri
Copy link
Contributor

It seems like I got a similar issue to #12 which i try to wrap my head around.
My custom service looks as followed

a topic type called Stream with the following content

uint8 type
string name
string source
uint32 x
uint32 y
uint32[] rate

The service using the topic set Stream

foo_msgs/Stream stream
---
bool ok

Crashes here

Could it be the allocate_message call, when it got one member which contain members with strings?

@v-kiniv
Copy link
Owner

v-kiniv commented Jun 14, 2024

Thanks for the report. Yeah the problem is in the allocate_message, it does not take into account nested messages with strings. I created PR #28 with a fix, please let me know if it's working for you.
It doesn't cover the case where nested message with string is an array(foo_msgs/Stream[] stream), I'll address it in a separate PR when I come up with a solution for that.

@martinfri
Copy link
Contributor Author

Perfect, I have tested the PR, and it does indeed fix the issue. Ah, the cast to auto sub_members = static_cast<const MessageMembers *>(member->members_->data); did the trick!

Regarding the array case, would probably be nice to have, but currently i have no such case.

@v-kiniv
Copy link
Owner

v-kiniv commented Jun 17, 2024

Great, thanks for testing the PR, I'll merge it then. As for the issue, I'm leaving it open till array case is fixed.

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