chrisidefix / cgal-bindings

Automatically exported from code.google.com/p/cgal-bindings
Boost Software License 1.0
0 stars 0 forks source link

Segfault with intersecting constraints and 2D Mesh CDT #11

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Install CGAL-4.0.tar.gz
2. Install cgal-bindings from google code head (head commit 
ee76d762fe18f2fbc8f2dc36bad78ce57dc50eb5)
3. Execute the following code:

from CGAL.CGAL_Kernel import Point_2
import CGAL.CGAL_Mesh_2

try:
    cdt = CGAL.CGAL_Mesh_2.Mesh_2_Constrained_Delaunay_triangulation_2()
    va = cdt.insert(Point_2(-1.0, 0.0))
    vb = cdt.insert(Point_2( 1.0, 0.0))
    vc = cdt.insert(Point_2( 0.0,-1.0))
    vd = cdt.insert(Point_2( 0.0, 1.0))
    cdt.insert_constraint(va, vb) 
    cdt.insert_constraint(vc, vd) 
except:
    print 'caught exception'

The expected result is to see:

 sorry, this triangulation does not deal with
 intersecting constraints
caught exception

The actual result is:

 sorry, this triangulation does not deal with
 intersecting constraints
Segmentation fault

Test Environment

Ubuntu 11.10
boost 1.46.1 (from ubuntu repositories)
python 2.7.2+ (from ubuntu repositories)
libgmp-dev (from ubuntu repositories)
libmpfr-dev (from ubuntu repositories)
SWIG 2.0.4 (built from source)
cmake 2.8.5 (from Ubuntu repositories)

Problem also reproduced on RHEL.

Original issue reported on code.google.com by walker...@gmail.com on 5 Apr 2012 at 12:35

GoogleCodeExporter commented 9 years ago
This is not really a problem with the bindings, it's a general issue in CGAL. 
If you try to do something wrong with a CGAL algorithm then an assertion is 
there but it is deactivated in release mode.

Note that an exception is thrown if you compile the bindings in debug mode.
The in-between situation is to compile in debug but with the optimizations 
(cmake -DCMAKE_CXX_FLAGS="-O3 -fno-strict-aliasing" ).

Original comment by sloriot...@gmail.com on 5 Apr 2012 at 1:03