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

Octomap segfault #828

Open
marip8 opened this issue Oct 19, 2022 · 8 comments
Open

Octomap segfault #828

marip8 opened this issue Oct 19, 2022 · 8 comments

Comments

@marip8
Copy link
Contributor

marip8 commented Oct 19, 2022

There appears to be a bug in the octomap library that causes a segfault for various cases.

tesseract_examples_basic_cartesian_example: /build/octomap-KdBKXz/octomap-1.9.3+dfsg/octomap/include/octomap/OcTreeDataNode.hxx:69: octomap::OcTreeDataNode<T>::~OcTreeDataNode() [with T = float]: Assertion `children == NULL' failed.

There is a PR that addresses this issue, but it hasn't been merged yet.

We might be able to add the same fixes to our code to fix this issue per discussion here

@marip8
Copy link
Contributor Author

marip8 commented Oct 19, 2022

Per @Levi-Armstrong

I tried to add the following in the prune function, but children is not accessible.

        if (node->children != NULL){
          delete[] node->children;
          node->children = NULL;
        }

@Levi-Armstrong
Copy link
Contributor

I am starting to think there may be an issue with it finding different version of the library. The system installs version 1.9.3 and ros noetic has its own version of 1.9.8. If you run ldd on the example library and executable which is creating the error do you only see it linked against one version?

@marip8
Copy link
Contributor Author

marip8 commented Mar 9, 2023

I am starting to think there may be an issue with it finding different version of the library.

This is for sure caused by using the system version of liboctomap-dev rather than the one provided by the ROS build farm. I suppose there is a patch somewhere between 1.9.3 and 1.9.8 that resolves this issue

@marip8
Copy link
Contributor Author

marip8 commented Mar 9, 2023

@Levi-Armstrong how do you feel about adding the appropriate version of octomap to the dependencies.rosinstall? It's not ideal, but I can't find any later versions distributed on PPAs, etc. It also looks like jammy only provides version 1.9.7, which may also not solve the issue

@Levi-Armstrong
Copy link
Contributor

Levi-Armstrong commented Mar 9, 2023

I think adding it to the rosinstall is fine. Should we also add it to the CMake find_package for octomap also?

@marip8
Copy link
Contributor Author

marip8 commented Mar 9, 2023

I suppose there is a patch somewhere between 1.9.3 and 1.9.8 that resolves this issue

I forgot there is an open PR against octomap that fixes this, so it seems like 1.9.8 may only coincidentally fix this issue

I think adding it to the rosinstall is fine. Should we also add it to the CMake find_package for octomap also?

That might be a good idea, but it does technically compile with 1.9.x, so that restriction seems like it could be a bit overly conservative. I'm not sure if this problem always occurs with octomaps or just in this specific unit test

@Levi-Armstrong
Copy link
Contributor

If this occurs on you machine you might run ldd and see if it is linking against both libraries which can cause weird behaviors like this.

@marip8
Copy link
Contributor Author

marip8 commented Mar 9, 2023

It looks like it only links against the system version

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