[Gmsh] segfault when exporting to BREP

Theler German Guillermo gtheler at cites-gss.com
Mon Mar 2 18:17:32 CET 2015


Hello

I found a segmentation fault when trying to export a merged STL into a BREP (or STEP). Perhaps this cannot be done by gmsh, but in any case the code must either give an error message or save an empty file.

Consider the file demos/sphere-surf.stl provided in gmsh svn tree:


gtheler at blinky<mailto:gtheler at blinky>:~/FreeCAD_files/gmsh$ cat sphere-surf.geo
Merge "sphere-surf.stl";
Save "sphere-surf.brep";
gtheler at blinky<mailto:gtheler at blinky>:~/FreeCAD_files/gmsh$ gdb --args gmsh sphere-surf.geo
GNU gdb (Debian 7.7.1+dfsg-5) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from gmsh...done.
(gdb) run
Starting program: /home/gtheler/bin/gmsh sphere-surf.geo
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffdf322700 (LWP 31202)]
[New Thread 0x7fffdeb21700 (LWP 31203)]
[New Thread 0x7fffde320700 (LWP 31204)]
[New Thread 0x7fffddb1f700 (LWP 31205)]
[Thread 0x7fffddb1f700 (LWP 31205) exited]
[Thread 0x7fffdeb21700 (LWP 31203) exited]
[Thread 0x7fffdf322700 (LWP 31202) exited]
[Thread 0x7fffde320700 (LWP 31204) exited]

Program received signal SIGSEGV, Segmentation fault.
0x00007fffeb504d5d in TopTools_IndexedMapOfShape::Clear() () from /usr/lib/x86_64-linux-gnu/libTKBRep.so.8
(gdb) where
#0  0x00007fffeb504d5d in TopTools_IndexedMapOfShape::Clear() () from /usr/lib/x86_64-linux-gnu/libTKBRep.so.8
#1  0x00007ffff6972e87 in OCC_Internals::buildShapeFromGModel (this=0x0, gm=0x7ab100)
    at /home/gtheler/codigos/3ros/build/gmsh/Geo/GModelIO_OCC.cpp:40
#2  0x00007ffff697a89a in GModel::writeOCCBREP (this=0x7ab100, fn="sphere-surf.brep")
    at /home/gtheler/codigos/3ros/build/gmsh/Geo/GModelIO_OCC.cpp:1056
#3  0x00007ffff673d005 in CreateOutputFile (fileName="sphere-surf.brep", format=35, status=false, redraw=false)
    at /home/gtheler/codigos/3ros/build/gmsh/Common/CreateFile.cpp:377
#4  0x00007ffff673c619 in CreateOutputFile (fileName="sphere-surf.brep", format=10, status=true, redraw=true)
    at /home/gtheler/codigos/3ros/build/gmsh/Common/CreateFile.cpp:245
#5  0x00007ffff6e78647 in gmsh_yyparse () at Gmsh.y:2675
#6  0x00007ffff6735565 in ParseFile (fileName="sphere-surf.geo", close=true, warnIfMissing=false)
    at /home/gtheler/codigos/3ros/build/gmsh/Common/OpenFile.cpp:210
#7  0x00007ffff696e778 in GModel::readGEO (name="sphere-surf.geo")
    at /home/gtheler/codigos/3ros/build/gmsh/Geo/GModelIO_GEO.cpp:43
#8  0x00007ffff673728f in MergeFile (fileName="sphere-surf.geo", warnIfMissing=false, setWindowTitle=true, setBoundingBox=true)
    at /home/gtheler/codigos/3ros/build/gmsh/Common/OpenFile.cpp:496
#9  0x00007ffff67383b0 in OpenProject (fileName="sphere-surf.geo", setWindowTitle=true)
    at /home/gtheler/codigos/3ros/build/gmsh/Common/OpenFile.cpp:691
#10 0x00007ffff66b4a0e in GmshFLTK (argc=2, argv=0x7fffffffe008) at /home/gtheler/codigos/3ros/build/gmsh/Common/Gmsh.cpp:349
#11 0x00000000004015bd in main (argc=2, argv=0x7fffffffe008) at /home/gtheler/codigos/3ros/build/gmsh/Fltk/Main.cpp:47
(gdb)



--
Germán Theler :: CTO Eng & IT

CITES – Centro de Innovación Tecnológica Empresarial y Social S.A.
Dirección General Sancor Seguros
Grupo Sancor Seguros
tel +54 3493 –428 500 – Int.: 3374
gtheler at cites-gss.com<mailto:ccipolatti at cites-gss.com>
www.cites-gss.com<http://www.cites-gss.com> - www.gruposancorseguros.com<http://www.gruposancorseguros.com>




________________________________
Imprima este mensaje sólo si es absolutamente necesario.
Para imprimir, en lo posible utilice el papel de ambos lados.
El Grupo Sancor Seguros se compromete con el cuidado del medioambiente.



************AVISO DE CONFIDENCIALIDAD************

El Grupo Sancor Seguros comunica que:

Este mensaje y todos los archivos adjuntos a el son para uso exclusivo del destinatario y pueden contener información confidencial o propietaria, cuya divulgación es sancionada por ley. Si usted recibió este mensaje erróneamente, por favor notifíquenos respondiendo al remitente, borre el mensaje original y destruya las copias (impresas o grabadas en cualquier medio magnético) que pueda haber realizado del mismo. Todas las opiniones contenidas en este mail son propias del autor del mensaje. La publicación, uso, copia o impresión total o parcial de este mensaje o documentos adjuntos queda prohibida.

Disposición DNDP 10-2008. El titular de los datos personales tiene la facultad de ejercer el derecho de acceso a los mismos en forma gratuita a intervalos no inferiores a seis meses, salvo que acredite un interés legítimo al efecto conforme lo establecido en el artículo 14, inciso 3 de la Ley 25.326. La DIRECCIÓN NACIONAL DE PROTECCIÓN DE DATOS PERSONALES, Organo de Control de la Ley 25.326, tiene la atribución de atender las denuncias y reclamos que se interpongan con relación al incumplimiento de las normas sobre la protección de datos personales.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20150302/b8cd96f8/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: sphere-surf.geo
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20150302/b8cd96f8/attachment.geo>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sphere-surf.stl
Type: application/sla
Size: 119425 bytes
Desc: sphere-surf.stl
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20150302/b8cd96f8/attachment.stl>