Comment 4 for bug 1666339

Revision history for this message
Bruno Chareyre (bruno-chareyre) wrote : Re: [Bug 1666339] Re: DFNflow crashes for compiled trunk but not non-optimized debug compiled trunk

On 02/23/2017 11:24 PM, Robert Caulk wrote:
> 195: RTriangulation::Facet_circulator facet1 =
> Tri.incident_facets(*edge);
>
> This is where I believe there may be a problem. facet1 does not appear
> to be the address of a facet, instead it appears to be the circulator.
The "circulator" is just an iterator (i.e. a pointer) which cyclically
goes back to the same point.
So, "facet->first" is ok.
If "facet" was really a facet (not a circulator) it would be "facet.first".

> Am I right to say that in this case *facet1 is the facet that we are
> interested in using [1]? If so, we should be able to change lines 174
> and 175 to:
>
> const CellHandle& cell1 = *facet->first;
> const CellHandle& cell2 = *facet->first->neighbor(*facet->second);
>
> But of course, the compiler says this is an invalid initialization of
> reference.
If your idea was correct the current code would not work at all, you
need to include in the picture the fact that this same code actually
works for us without problem.
So it is more a matter of finding which special case makes the problem
appear, keeping in mind that it usually works.
You are maybe not far: what happens if during the circulation about one
edge we find a facet incident to the infinite vertex, for instance?
There can be special cases of this sort.

Could you output more data on the crashing facet? Which are the vertices
connected to it, etc. It may ring a bell about which special case need
to be handled differently.

Bruno