mesh build crash
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?
Can you provide a backtrace?
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.
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++
@cgohlke, thanks for tracking that down! That looks like an upstream (TetGen) bug. I've emailed Hang Si.
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.