segfault in MTetrahedron::getVolume
I found this segfault (using latest git source) when trying to mesh the attached BREP directly with
$ gmsh -3 cube-sphere-cube-compound.brep
Thread 1 "gmsh" received signal SIGSEGV, Segmentation fault.
MTetrahedron::getVolume (this=<optimized out>) at /home/gtheler/codigos/3ros/build/gmsh/Geo/MTetrahedron.cpp:113
113 getMat(mat);
(gdb) where
#0 MTetrahedron::getVolume (this=<optimized out>) at /home/gtheler/codigos/3ros/build/gmsh/Geo/MTetrahedron.cpp:113
#1 0x0000555555a9654d in MTetrahedron::getVolumeSign (this=<optimized out>)
at /home/gtheler/codigos/3ros/build/gmsh/Geo/MTetrahedron.h:122
#2 0x0000555555a7c79c in MElement::setVolumePositive (this=0x555556b875a0) at /home/gtheler/codigos/3ros/build/gmsh/Geo/MElement.cpp:456
#3 0x000055555598609b in GModel::setAllVolumesPositive (this=this@entry=0x555556b26330)
at /home/gtheler/codigos/3ros/build/gmsh/Geo/GModel.cpp:810
#4 0x0000555555b25716 in OptimizeMeshNetgen (m=m@entry=0x555556b26330) at /home/gtheler/codigos/3ros/build/gmsh/Mesh/Generator.cpp:967
#5 0x0000555555b280d3 in GenerateMesh (m=m@entry=0x555556b26330, ask=<optimized out>)
at /home/gtheler/codigos/3ros/build/gmsh/Mesh/Generator.cpp:1089
#6 0x0000555555986039 in GModel::mesh (this=this@entry=0x555556b26330, dimension=<optimized out>)
at /home/gtheler/codigos/3ros/build/gmsh/Geo/GModel.cpp:797
#7 0x000055555580028a in GmshBatch () at /home/gtheler/codigos/3ros/build/gmsh/Common/Gmsh.cpp:312
#8 0x00005555557f379c in main (argc=3, argv=0x7fffffffe088) at /home/gtheler/codigos/3ros/build/gmsh/Fltk/Main.cpp:35
(gdb)
As the stack seems to imply, the problem is in the optimization. So if I call the attached geo as
$ gmsh -3 cube-sphere-cube.geo
then Gmsh does not crash, but the resulting mesh is weird (3d-weird.png). If I stick to 2D, the mesh is the expected one (2d-ok):
$ gmsh -2 cube-sphere-cube.geo