-
Notifications
You must be signed in to change notification settings - Fork 15
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
Galactic + Protobuf typesupport: Runtime crash "File already exists in database" #12
Comments
I also tried with
Same issue. |
Hi Sebastian, Good Info: It's not your fault. I debugged that issue in the past, so let me share what I got back then. Unfortunately I wasn't skilled enough with rmw implementation to fix the issue, but I can say what one has to change. If you are skilled with RMW implementation we are grateful for any help. The crucial thing is the following message from your console:
Protobuf has that unique behavior that it stores all descriptor information in a global database (for each process). So, when your process loads multiple shared objects each of them will add their protobuf descriptors in that database. Protobuf will not allow duplicates. If you let gdb output the loaded libraries at the time of the crash, you will get something similar to the following:
As you can see at the end (i.e. right before the crash), it loaded two libraries:
I then opened those two Both so files that get loaded bring their own copy of Duration.proto compiled into them. And that's the issue. For some reason, that issue came with galactic. Older ROS versions apparently behaved different and didn't load both the C and CPP library. How can it be solvedEssentially, we have to remove the Protobuf Objects from either one of the libraries. As both depend on them, It may be a good Idea to entirely move them into their own shared object file, that both the C and CPP typesupport will then use. So with this proposal we would have:
which is then used by:
as the "main" typesupport_protobuf.so is a shared object file, it will only be loaded once for each process, even if both the C and CPP typesupport attempt to load it. |
Thank you for the very detailed explanation. Can you keep this issue open, so that others see the discussion, please? Closed issues are harder to find with google ;). And maybe we find a proper solution (or someone manages a PR for ROS2 to fix it.. ) I already suspected something in that direction. I went in a different direction to work around it. I managed to hack a workaround and that is compile protobuf from source and hack it to disable the checks. I don't like that hack to become permanent but I though I share it still:
|
Earlier discussion in https://github.com/continental/ecal/issues/354 and https://github.com/continental/rmw_ecal/issues/19 |
Moved issue to typesupport repo, since its typesupport related issue |
ROS2 Galactic
Ubuntu 20.04
rmw_ecal master
rosidl_typesupport_protobuf master
ecal v5.10.0-alpha-10-g221e5b7e (11.03.2022)
When I run simple examples, I see something like this and the process ends:
The text was updated successfully, but these errors were encountered: