tesseract icon indicating copy to clipboard operation
tesseract copied to clipboard

Octomap segfault

Open marip8 opened this issue 2 years ago • 8 comments

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 avatar Oct 19 '22 02:10 marip8

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;
        }

marip8 avatar Oct 19 '22 02:10 marip8

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?

Levi-Armstrong avatar Oct 20 '22 16:10 Levi-Armstrong

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 avatar Mar 09 '23 14:03 marip8

@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

marip8 avatar Mar 09 '23 16:03 marip8

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

Levi-Armstrong avatar Mar 09 '23 17:03 Levi-Armstrong

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

marip8 avatar Mar 09 '23 18:03 marip8

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.

Levi-Armstrong avatar Mar 09 '23 18:03 Levi-Armstrong

It looks like it only links against the system version

marip8 avatar Mar 09 '23 19:03 marip8