Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Triangulation_ds_face_base_2.h

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Triangulation_ds_face_base_2.h


Chronological Thread 
  • From: Andreas Fabri <>
  • To:
  • Subject: Re: [cgal-discuss] Triangulation_ds_face_base_2.h
  • Date: Wed, 05 Sep 2007 17:50:51 +0200


wrote:
Hello Andreas,

You were right! That is not a vertex from the triangulation. Thought the
whole story sounds pretty absurd. I have:

cout<<"processing vertex "<<(*now)->info().ID()<<endl;
Delaunay::Face_circulator fc = dt.incident_faces(*now);
for(int j=0; j<circulator_size(fc); j++)
{
cout<<"processing vertex "<<(*now)->info().ID()<<endl;
fc++;
}

The first access to the vertex is OK, but the second is not. In theory
nowhere in between could something have invalidated the handle.


Hello Angelina,

What can happen is that the memory that *now and its info()
point to still exists, even if the vertex is already
removed and deallocated. As the memory is not overwritten
with zeros you can still access the adress and exploit
the information.

During the extructions of
> Delaunay::Face_circulator fc = dt.incident_faces(*now);
> for(int j=0; j<circulator_size(fc); j++)

this memory is then reused for storing other information in
there, and when you want to access *now a second time
it is just plain garbage.


I think I should just stick to using my code in debug mode...

I think you should debug your application ==:>-

andreas


Thanks for your advice,
Angelina



Archive powered by MHonArc 2.6.16.

Top of Page