double free or corruption (out) when applying pcl::SACSegmentation;

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

double free or corruption (out) when applying pcl::SACSegmentation;

icedoggy
This post was updated on .
Hi!
I was running the code below on my ubnutu 16.04 machine without any
problems. Recently I changed to the Manjaro distribution and now I am
getting the error (see subject) during runtime. Compilation works fine.
In addition to the different linux distribution, I am also using the newest
GCC compiler 8.1. Before, on my ubuntu, I was using gcc 5.x. I think.

The PCL version I am using is 1.8.1.-4 that is what it said in the package manager of Manjaro. However, the pcl was compile on my machine automatically using the package manager.

I found this
https://stackoverflow.com/questions/14063791/double-free-or-corruption-but-why
,however, it seems the mistake is not actually happening in my code. The
code below is basically from the plane extraction tutorial from the pcl
website and the error occurs in one of the pcl modules.

I have no idea how to approach this? Does anyone have any idea how to
approach this?

Regards





--
Sent from: http://www.pcl-users.org/
_______________________________________________
PCL-users@pointclouds.org / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: double free or corruption (out) when applying pcl::SACSegmentation;

icedoggy
Okay, i can rule out the gcc 8 compiler. I still have the ubuntu as a virtual
machine and just installed gcc 8.0.1 which was the latest i could get. It
seems that this is not the issue...although it is not the exact same version
as the Manjaro which uses 8.1.

So it most likely somehow related to the operating system? Any ideas ?



--
Sent from: http://www.pcl-users.org/
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: double free or corruption (out) when applying pcl::SACSegmentation;

Stephen McDowell
What do you mean by virtual machine here?

How did you upgrade your Ubuntu?

If you did say a dist-upgrade through apt, you probably need to recompile / reinstall PCL?



On Wed, May 30, 2018, 2:10 PM icedoggy <[hidden email]> wrote:
Okay, i can rule out the gcc 8 compiler. I still have the ubuntu as a virtual
machine and just installed gcc 8.0.1 which was the latest i could get. It
seems that this is not the issue...although it is not the exact same version
as the Manjaro which uses 8.1.

So it most likely somehow related to the operating system? Any ideas ?



--
Sent from: http://www.pcl-users.org/
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users

_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: double free or corruption (out) when applying pcl::SACSegmentation;

icedoggy
I used to use a virtualBox virtual machine that had Ubuntu 16.04 as a guest
OS. I used this quite a while for development but I was annoyed by the
relatively slow speed of a VM.
Therefore I thought I will install a Linux distro as a second OS alongside
my Windows and use this for development. However, instead of using Ubuntu
again, I decided to use Manjaro which is a distro based on Arch Linux.

So while I was able to run my code on the VM using Ubuntu (and GCC 5.4) I
cannot run the same code on my Manjaro distro (using GCC 8.1).  But as I
still had my VM with Ubuntu, i upgraded to GCC of the Ubuntu VM to 8.0.1 and
tried running my code. And it still works there but not on Manjaro. The
strange thing is that it compiles alright...

I hope this is clear now. :)



--
Sent from: http://www.pcl-users.org/
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: double free or corruption (out) when applying pcl::SACSegmentation;

Stephen McDowell
Ah.  Yes, I understand.  Though unfortunately, nothing obvious sticks out in terms of how to remedy it :/

Thought 1: did you increase the resources for the VM?  In VirtualBox you can (while the VM is shutdown) add additional cores, RAM, etc.  Additionally, make sure the host operating system (e.g., Windows) is doing nothing you don’t need it to.  For example, even having an internet browser open can utilize more resources than you would think (especially chrome).

Though personally I agree with your decision — you will always get better performance out of a native installation rather than a VM.

So thought 2: try a different compiler with Manjaro.  Let it be known that this may very well result in the same issues.  While it would be rather annoying for you, try and keep track of how much time it is taking to get new compilers and compile PCL — if it goes on too long, it may be better for you to just cut your losses and install Ubuntu if you need PCL :/

I am not familiar with Manjaro (though it seems rather intriguing), but the rolling update strategy seems to tightly couple kernel versions and GCC toolchains.  You mentioned upgrading the Ubuntu VM to 8.0.1, but Manjaro is at 8.1.  A minor release can actually have a lot of very different stuff in there.  At this point in time PCL is not using C++11 (I think the plan is to skip to C++14, there’s some stuff on that on the GitHub issues).  Given this, I think your best bet is to try using say GCC 7.

Note: in my own projects I’ve also experienced some issues with GCC 8, but they have usually surfaced as compilation issues.    I don’t think this is uncommon.

I’m not sure how Manjaro works in terms of package management or if you are expected to compile everything from source.  Compiling GCC can be a little painful if you’ve never done it before, so if possible installing it with Manjaro’s package manager (if it exists) would be fastest (since you will still need to re-compile PCL).

If that requires bloody steps (e.g., a full “stable” downgrade to whenever GCC 7 was the latest version in Manjaro since they do rolling updates), you may get good success compiling GCC 7 with the “spack” package manager: https://spack.readthedocs.io/en/latest/getting_started.html

However, spack is rather complicated, definitely look around and see if Manjaro has an easier way to get GCC 7.  They should — it was previously packaged, so there should at least be a build recipe somewhere :)

I hope something in there is even remotely helpful.  Unfortunately your problem seems isolated to Manjaro, it could be related to how they have their standard GCC toolchain setup.  That’s stuff I don’t know much about, but maybe there are Manjaro gurus that may know if there’s something special about their toolchains or if there are easy ways for you to roll back your kernel and GCC toolchain?

Good luck!

On May 31, 2018, at 1:18 PM, icedoggy <[hidden email]> wrote:

I used to use a virtualBox virtual machine that had Ubuntu 16.04 as a guest
OS. I used this quite a while for development but I was annoyed by the
relatively slow speed of a VM.
Therefore I thought I will install a Linux distro as a second OS alongside
my Windows and use this for development. However, instead of using Ubuntu
again, I decided to use Manjaro which is a distro based on Arch Linux.

So while I was able to run my code on the VM using Ubuntu (and GCC 5.4) I
cannot run the same code on my Manjaro distro (using GCC 8.1).  But as I
still had my VM with Ubuntu, i upgraded to GCC of the Ubuntu VM to 8.0.1 and
tried running my code. And it still works there but not on Manjaro. The
strange thing is that it compiles alright...

I hope this is clear now. :)



--
Sent from: http://www.pcl-users.org/
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users


_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: double free or corruption (out) when applying pcl::SACSegmentation;

Stephen McDowell
Oh hey something more concrete did occur to me, what is the default CXX standard for your Manjaro compiler?


If it’s adding something “too recent”, this could be why there are problems.  Other users have reported success with PCL and compiling with C++11, so you could try forcing that in there in the top-level PCL CMakeLists.txt as well.

I think maybe your error is coming from potential standard changes or something?  But this is purely conjecture.


On May 31, 2018, at 9:42 PM, Stephen McDowell <[hidden email]> wrote:

Ah.  Yes, I understand.  Though unfortunately, nothing obvious sticks out in terms of how to remedy it :/

Thought 1: did you increase the resources for the VM?  In VirtualBox you can (while the VM is shutdown) add additional cores, RAM, etc.  Additionally, make sure the host operating system (e.g., Windows) is doing nothing you don’t need it to.  For example, even having an internet browser open can utilize more resources than you would think (especially chrome).

Though personally I agree with your decision — you will always get better performance out of a native installation rather than a VM.

So thought 2: try a different compiler with Manjaro.  Let it be known that this may very well result in the same issues.  While it would be rather annoying for you, try and keep track of how much time it is taking to get new compilers and compile PCL — if it goes on too long, it may be better for you to just cut your losses and install Ubuntu if you need PCL :/

I am not familiar with Manjaro (though it seems rather intriguing), but the rolling update strategy seems to tightly couple kernel versions and GCC toolchains.  You mentioned upgrading the Ubuntu VM to 8.0.1, but Manjaro is at 8.1.  A minor release can actually have a lot of very different stuff in there.  At this point in time PCL is not using C++11 (I think the plan is to skip to C++14, there’s some stuff on that on the GitHub issues).  Given this, I think your best bet is to try using say GCC 7.

Note: in my own projects I’ve also experienced some issues with GCC 8, but they have usually surfaced as compilation issues.    I don’t think this is uncommon.

I’m not sure how Manjaro works in terms of package management or if you are expected to compile everything from source.  Compiling GCC can be a little painful if you’ve never done it before, so if possible installing it with Manjaro’s package manager (if it exists) would be fastest (since you will still need to re-compile PCL).

If that requires bloody steps (e.g., a full “stable” downgrade to whenever GCC 7 was the latest version in Manjaro since they do rolling updates), you may get good success compiling GCC 7 with the “spack” package manager: https://spack.readthedocs.io/en/latest/getting_started.html

However, spack is rather complicated, definitely look around and see if Manjaro has an easier way to get GCC 7.  They should — it was previously packaged, so there should at least be a build recipe somewhere :)

I hope something in there is even remotely helpful.  Unfortunately your problem seems isolated to Manjaro, it could be related to how they have their standard GCC toolchain setup.  That’s stuff I don’t know much about, but maybe there are Manjaro gurus that may know if there’s something special about their toolchains or if there are easy ways for you to roll back your kernel and GCC toolchain?

Good luck!

On May 31, 2018, at 1:18 PM, icedoggy <[hidden email]> wrote:

I used to use a virtualBox virtual machine that had Ubuntu 16.04 as a guest
OS. I used this quite a while for development but I was annoyed by the
relatively slow speed of a VM.
Therefore I thought I will install a Linux distro as a second OS alongside
my Windows and use this for development. However, instead of using Ubuntu
again, I decided to use Manjaro which is a distro based on Arch Linux.

So while I was able to run my code on the VM using Ubuntu (and GCC 5.4) I
cannot run the same code on my Manjaro distro (using GCC 8.1).  But as I
still had my VM with Ubuntu, i upgraded to GCC of the Ubuntu VM to 8.0.1 and
tried running my code. And it still works there but not on Manjaro. The
strange thing is that it compiles alright...

I hope this is clear now. :)



--
Sent from: http://www.pcl-users.org/
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users



_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: double free or corruption (out) when applying pcl::SACSegmentation;

icedoggy
Dear Stephen,

thank you for your many thoughts on this. I also thought of recompiling pcl
from source as I suspected it may have something to do with the tool chain.
So I think I will add the c++11 flag as you suggested and then recompile and
see what is happening...

regards.





--
Sent from: http://www.pcl-users.org/
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: double free or corruption (out) when applying pcl::SACSegmentation;

icedoggy
This post was updated on .
Okay, I finally managed to try the above. However, it was not successful. I
get the same error, i did find however, something else that may be related
to my problem.
As discussed  here <https://aur.archlinux.org/packages/pcl/>   there seems
to be a bug in pcl and "coincidentally" in the same class where my problem
occurs.
Other users complain about not being able to BUILD pcl with GCC 8. Although
my problem occurs during runtime, i think this is related.
Considering this:
https://github.com/jspricke/pcl/commit/7e0c0eba0bc6917592bb7f0db88dde48c168d24a

So I will try to recompile pcl with this patch in place and see if it works.
If not I will reinstall my Manjaro distribution and disable the rolling
update of some packages, like gcc, boost, eigen etc.... rolling release
model is not suitable for development imho. I didn't think about this before
but now it seems obvious!

I will report if it works or not.





--
Sent from: http://www.pcl-users.org/
_______________________________________________
PCL-users@pointclouds.org / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users