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

free #13

Open
pengsongyou opened this issue Nov 29, 2020 · 2 comments
Open

free #13

pengsongyou opened this issue Nov 29, 2020 · 2 comments

Comments

@pengsongyou
Copy link

First, of all, thanks a lot for the amazing python binder for SPSR!

I am using Ubuntu 20.04, python=3.7.3, cython 0.29.12, GCC 7.3.

Following the readme file, I have successfully installed it. However, when I was trying to run your example folder, I encountered the error as below:

free(): double free detected in tcache 2
Aborted (core dumped)

I was trying to debug, and realize the issue happening inside this line. Then, I tried to compiled and ran examples using the original PoissonRecon V6.13 code, it also worked perfectly. Therefore, I think the problem might come when compiling with the cython?

I then changed another machine with Ubuntu 18.04, and it worked with your tool. Therefore, I am just curious what could be the possible reasons.

Thanks a lot for your effort in advance!

Best,
Songyou

@bhatiaharsh
Copy link
Contributor

I tried to figure out the case of this memory issue. While not fully successful, I have narrowed it down to this function ConstNeighborKey3::~ConstNeighborKey3.

The original PoissonRecon V6.13 code is now very old and is failing to keep up with the stricter checks of the new compilers, python, and cython. While I am not fully sure, I strongly suspect the latest gcc is putting additional constraints on how the memory is freed, and some of the old pointer-stuff is failing. This is a very useful piece of code, so if someone wants to volunteer to update all the pointer/array usage into std::vector, it would be a great community service. :-)

Immediate solution: until that happens, I was able to run this using gcc@7. I used the following. Hope this helps. It seems from comments above that others have also had success in rolling back os/gcc.

gcc-mp-7 (MacPorts gcc7 7.5.0_2) 7.5.0
Python 3.7.11
Cython version 0.29.24

@YuliangXiu
Copy link

I switch to gcc-7 and recompile, then the segmentation fault disappears.

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

3 participants