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

mesh build crash #26

Open
JaniKallankari opened this issue Apr 23, 2017 · 5 comments
Open

mesh build crash #26

JaniKallankari opened this issue Apr 23, 2017 · 5 comments

Comments

@JaniKallankari
Copy link

I'm using windows:MeshPy‑2016.1.2+unstable‑cp35‑cp35m‑win_amd64.whl.
Following code crash python:

from meshpy.tet import MeshInfo, build
mesh_info = MeshInfo()
mesh_info.set_points([(0,0,0), (2,0,0), (2,2,0)])
mesh_info.set_facets([[0,1,2]])
mesh = build(mesh_info)

What I'm doing wrong?

@inducer
Copy link
Owner

inducer commented Apr 23, 2017

Can you provide a backtrace?

@JaniKallankari
Copy link
Author

Ubuntu 16.04 and new meshpy from git same problem, segment fault. Could you provide instructions how to get backtrace? If you have everything setup it might be faster that you try out those five lines though.

@cgohlke
Copy link
Contributor

cgohlke commented Apr 25, 2017

The crash is in tetgenmesh::orient3dfast when indexing pd[0], which is not valid.
The tetgenmesh::incrementaldelaunay passes permutarray[i] with i=3 to tetgenmesh::orient3dfast, but permutarray is only allocated for 3 points.

 	_tetgen.cp36-win_amd64.pyd!tetgenmesh::orient3dfast(double * pa, double * pb, double * pc, double * pd) Line 6308	C++
>	_tetgen.cp36-win_amd64.pyd!tetgenmesh::incrementaldelaunay(long & tv) Line 11666	C++
 	_tetgen.cp36-win_amd64.pyd!tetrahedralize(tetgenbehavior * b, tetgenio * in, tetgenio * out, tetgenio * addin, tetgenio * bgmin) Line 30901	C++
 	_tetgen.cp36-win_amd64.pyd!`anonymous namespace'::tetrahedralizeWrapper(tetgenbehavior & bhv, `anonymous-namespace'::tMeshInfo & in, `anonymous-namespace'::tMeshInfo & out, `anonymous-namespace'::tMeshInfo * addin) Line 220	C++
 	_tetgen.cp36-win_amd64.pyd!boost::python::detail::invoke<int,void (__cdecl*)(tetgenbehavior & __ptr64,`anonymous namespace'::tMeshInfo & __ptr64,`anonymous namespace'::tMeshInfo & __ptr64,A0xd08dc9b3::tMeshInfo * __ptr64),boost::python::arg_from_python<tetgenbehavior & __ptr64>,boost::python::arg_from_python<`anonymous namespace'::tMeshInfo & __ptr64>,boost::python::arg_from_python<`anonymous namespace'::tMeshInfo & __ptr64>,boost::python::arg_from_python<`anonymous namespace'::tMeshInfo * __ptr64> >(boost::python::detail::invoke_tag_<1,0> __formal, const int & __formal, void(*)(tetgenbehavior &, `anonymous-namespace'::tMeshInfo &, `anonymous-namespace'::tMeshInfo &, `anonymous-namespace'::tMeshInfo *) & f, boost::python::arg_from_python<tetgenbehavior &> & ac0, boost::python::arg_from_python<`anonymous namespace'::tMeshInfo &> & ac1, boost::python::arg_from_python<`anonymous namespace'::tMeshInfo &> & ac2, boost::python::arg_from_python<`anonymous namespace'::tMeshInfo *> & ac3) Line 82	C++
 	_tetgen.cp36-win_amd64.pyd!boost::python::detail::caller_arity<4>::impl<void (__cdecl*)(tetgenbehavior & __ptr64,`anonymous namespace'::tMeshInfo & __ptr64,`anonymous namespace'::tMeshInfo & __ptr64,A0xd08dc9b3::tMeshInfo * __ptr64),boost::python::default_call_policies,boost::mpl::vector5<void,tetgenbehavior & __ptr64,`anonymous namespace'::tMeshInfo & __ptr64,A0xd08dc9b3::tMeshInfo & __ptr64,A0xd08dc9b3::tMeshInfo * __ptr64> >::operator()(_object * args_, _object * __formal) Line 218	C++
 	_tetgen.cp36-win_amd64.pyd!boost::python::objects::caller_py_function_impl<boost::python::detail::caller<void (__cdecl*)(tetgenbehavior & __ptr64,`anonymous namespace'::tMeshInfo & __ptr64,`anonymous namespace'::tMeshInfo & __ptr64,A0xd08dc9b3::tMeshInfo * __ptr64),boost::python::default_call_policies,boost::mpl::vector5<void,tetgenbehavior & __ptr64,`anonymous namespace'::tMeshInfo & __ptr64,A0xd08dc9b3::tMeshInfo & __ptr64,A0xd08dc9b3::tMeshInfo * __ptr64> > >::operator()(_object * args, _object * kw) Line 39	C++

@inducer
Copy link
Owner

inducer commented Apr 25, 2017

@cgohlke, thanks for tracking that down! That looks like an upstream (TetGen) bug. I've emailed Hang Si.

@JaniKallankari
Copy link
Author

Great to see some progress. This was not only happening with this tiny point data set. I did find some other data sets also caused crashing too.

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