-
Notifications
You must be signed in to change notification settings - Fork 152
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
Double free or corruption error when trying to use libfive #543
Comments
@gsohler It seems we may be hitting the same error :) |
This error dominantly happens, when the meshing result from Mesh::render is void. Is there a reason why Mesh::render returns an unique_ptr and not a shared_ptr ? |
Nice work @gsohler :) |
Description
[Description of the issue]
When trying to use internals of livfive i get a double free or corruption error, segfault
[Steps to reproduce]
I use this code to evaluate the tree only once:
double sdf_func(libfive::Tree &tr, Vector3d pt)
{
ArrayEvaluator e((Tree(tr))); <- segfaults here
// double xx =e.value({pt[0], pt[1], pt[2]});
}
Reading the internet i understand, why its not allowed to use a local variable for use in make_shared in ArrayEvaluator.cpp
(the memory will be freed once in local scope and once when the std_shared ptr is not used anymore.
However, in this case i dont know how to fix it, because "Tree" is a variable and not a ptr to variable.
[What did you expect to happen? What happened? All the time?]
It should return a value and not segfault.
Are there any other initialisation steps required to make simple ArrayEvaluator Class not crash ?
[Are there any error messages printed to the console?]
Yes:
double free or corruption (out)
Aborted (core dumped)
Versions
libfive
commit hash:master
? noAdditional Information
Any additional information, configuration or data that might be necessary to reproduce the issue.
The text was updated successfully, but these errors were encountered: