I’m running the latest version of NGSolve (NGSolve-6.2.1810-50-g655161c)
When I call the method:
mesh.curve(max(p,2)) with p = 2, I’m getting a segfault in Netgen:
netgen/libsrc/geom2d/genmesh2d.cpp:403
403 if (bbox.Diam() < mp.maxh)
Thread 1 “python3” received signal SIGSEGV, Segmentation fault.
0x00007fffdca3f8ac in netgen::MeshFromSpline2D (geometry=…,
mesh=<error reading variable: Cannot access memory at address 0xa>, mp=…)
at /home/dow/ngsuite/ngsolve-src/external_dependencies/netgen/libsrc/geom2d/genmesh2d.cpp:403
Our code is rather complex, but was working before Christmas and hasn’t changed since. I’m not seeing this issue with versions of NGSolve/Netgen built more than a week or two ago. If you have trouble reproducing it, I can try to provide more details.
Hi,
I cannot reproduce the Segfault, I do not see a problem in changing the base classes but don’t really understand why this fixes the problem and I would assume that it is more or less a coincidence and an explanation would be nice… If you have time to create a reproducible case I would be interested.
Best
Christopher
Swapping the order of the base classes was a suggestion from Joachim, passed along by Jay – not something I would have thought of myself. I’ll try to post a reproducible case soon.
Ah, I think I know, try in the python_geom2d.cpp in the export of the SplineGeometry adding py::multiple_inheritance():
py::class_<SplineGeometry2d, NetgenGeometry, shared_ptr<SplineGeometry2d>>
(m, "SplineGeometry",
"a 2d boundary representation geometry model by lines and splines",
py::multiple_inheritance())
If this fixes your problem then we already know the problem and you don’t need to create a test case. I thought we already fixed that.
I restored the original order of the base classes in netgen/libsrc/geom2d/geometry2d.hpp and added the py:multiple_inheritance() argument to python_geom2d.cpp as you suggested. I’m not seeing any seg faults or other issues after making those changes.