Segfault in BDS.cpp:537
I have a segfault (double free) when calling gmsh 4.0.5-git-ffcd149f to mesh this model:
gmsh -2 model.brep
The gdb stack is:
(gdb) where
#0 0x00007fffebb69fff in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007fffebb6b42a in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007fffebba7c00 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#3 0x00007fffebbadfc6 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#4 0x00007fffebbae80e in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#5 0x00007ffff6fd1bc7 in BDS_Mesh::del_point (this=0x555555a79330, p=0x555555a75ae0)
at /home/gtheler/codigos/3ros/build/gmsh/Mesh/BDS.cpp:537
#6 0x00007ffff6b7f493 in buildConsecutiveListOfVertices (gf=gf@entry=0x555555a3b0c0, gel=..., result=..., bbox=...,
m=m@entry=0x555555a79330, recoverMap=..., count=@0x7fffffffd7b0: 16, countTot=18, tol=tol@entry=9.9767556186605115e-12,
seam_the_first=true) at /home/gtheler/codigos/3ros/build/gmsh/Mesh/meshGFace.cpp:1875
#7 0x00007ffff6b8131f in meshGeneratorPeriodic (gf=gf@entry=0x555555a3b0c0, debug=false,
repairSelfIntersecting1dMesh=<optimized out>) at /home/gtheler/codigos/3ros/build/gmsh/Mesh/meshGFace.cpp:2011
#8 0x00007ffff6ee9e44 in meshGFace::operator() (this=this@entry=0x7fffffffdcc6, gf=gf@entry=0x555555a3b0c0,
print=print@entry=true) at /home/gtheler/codigos/3ros/build/gmsh/Mesh/meshGFace.cpp:2832
#9 0x00007ffff6cf46c7 in GFace::mesh (this=0x555555a3b0c0, verbose=true)
at /home/gtheler/codigos/3ros/build/gmsh/Geo/GFace.cpp:1531
#10 0x00007ffff6ed8a0b in Mesh2D (m=0x5555557a9800) at /home/gtheler/codigos/3ros/build/gmsh/Mesh/Generator.cpp:480
#11 GenerateMesh (m=<optimized out>, ask=ask@entry=2) at /home/gtheler/codigos/3ros/build/gmsh/Mesh/Generator.cpp:1081
#12 0x00007ffff6d2a8e9 in GModel::mesh (this=<optimized out>, dimension=dimension@entry=2)
at /home/gtheler/codigos/3ros/build/gmsh/Geo/GModel.cpp:869
#13 0x00007ffff6b92816 in GmshBatch () at /home/gtheler/codigos/3ros/build/gmsh/Common/GmshGlobal.cpp:312
#14 0x00007ffff6b9375f in GmshMainFLTK (argc=3, argv=0x7fffffffe0e8)
at /home/gtheler/codigos/3ros/build/gmsh/Common/GmshGlobal.cpp:473
#15 0x00007fffebb572e1 in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6
#16 0x0000555555554aaa in _start ()
(gdb)
Source BDS.cpp
reads
void BDS_Mesh::del_point(BDS_Point *p)
{
points.erase(p);
delete p;
}
Line 537 is the delete
instruction.