Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Incremental_neighbor_search crash with exact kernel

Subject: CGAL users discussion list

List archive

[cgal-discuss] Incremental_neighbor_search crash with exact kernel


Chronological Thread 
  • From: Martin Mörth <>
  • To:
  • Subject: [cgal-discuss] Incremental_neighbor_search crash with exact kernel
  • Date: Fri, 2 Oct 2009 09:32:26 -0700 (PDT)


Hello Again!

I stumbled across another problem. This time when using
Incremental_neighbor_search in conjunction with an exact kernel.

] typedef CGAL::Exact_predicates_exact_constructions_kernel CgKernel;
] typedef CgKernel::Point_2 CgPoint;
]
] typedef CGAL::Search_traits_2< CgKernel > CgSearchTraits;
] typedef CGAL::Kd_tree< CgSearchTraits,
] CGAL::Sliding_midpoint< CgSearchTraits > > CgKdTree;
]
] typedef CGAL::Incremental_neighbor_search< CgSearchTraits,
] CGAL::Euclidean_distance< CgSearchTraits >,
] CGAL::Sliding_midpoint< CgSearchTraits >, CgKdTree > CgSearch;
] typedef CgSearch::iterator CgSearchIter;
]
] CgKdTree tree;
] tree.insert( CgPoint( 1.0, 1.5 ) );
] tree.insert( CgPoint( -1.0, 1.5 ) );
] tree.insert( CgPoint( 0.0, 0.5 ) );
]
] CgSearch search( tree, CgPoint( 0.0, 0.0 ) ); // crash here
] CgSearchIter iter = search.begin();
] assert( ( *iter ).first == CgPoint( 0.0, 0.5 ) );

When I run a test program containing the code shown above
the application crashes in the line where 'search' is constructed.
The debugger says: 'Access violation reading location 0xfdfdfe0d'

Execution stack backtrace can be found here:
http://www.sbox.tugraz.at/home/m/mmoerth/cgal/crash_backtrace.txt

Digging deeper it seems the problem occurs in line 310 of
incremental_neighbor_search.h where a bounding box is
calculated:

] Node_box *bounding_box = new Node_box((tree.bounding_box()));

The crash seems to be related to a subtraction in line 91 of
kd_tree_rectangle.h:

] FT span = upper_[0]-lower_[0];

After switching the kernel to 'Simple_homogeneous< double >'
the program runs fine. This may [ :-) ] indicate that the code
itself is OK.

Are there any restrictions to which kernels I can use with
Kd_tree / Incremental_neighbor_search?

I am using CGAL 3.4 and VS 8.0 on Windows XP.

Thanks for any help on this!

Martin
--
View this message in context:
http://www.nabble.com/Incremental_neighbor_search-crash-with-exact-kernel-tp25716733p25716733.html
Sent from the cgal-discuss mailing list archive at Nabble.com.



  • [cgal-discuss] Incremental_neighbor_search crash with exact kernel, Martin Mörth, 10/02/2009

Archive powered by MHonArc 2.6.16.

Top of Page