Segmentation fault at neighbor access

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Segmentation fault at neighbor access

tholzmann
Hi,

I get a weird segmentation fault and I really don't know why. Here is my
code:

if (triangulation_.is_valid(currCell))
{
     for (int k = 0; k < 4; k++)
         cellsToProcess.push(currCell->neighbor(k)); // when accessing
neighbor -> segfault
}

where triangulation_ is a
CGAL::Triangulation_3<CGAL::Exact_predicates_exact_constructions_kernel,
Tds_info>. and currCell is a Cell_handle.

I'm checking the validity of currCell, so the neighbors should exist, right?

Does someone have an idea why that could happen or how to check the
validity of the neighbors  before accessing it in another way?

Thomas


--
====================================================
Dipl.-Ing. Thomas Holzmann
TU Graz - Institut fuer Maschinelles Sehen und Darstellen
Graz University of Technology - Institute for Computer Graphics & Vision
Inffeldgasse 16/II, 8010 Graz, Austria

http://www.icg.tugraz.at/
phone: +43 316 873 5091
====================================================


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|

Re: Segmentation fault at neighbor access

andreas.fabri

Did you check that the triangulation as a whole is valid?

andreas


On 07/04/2017 09:03, Thomas Holzmann wrote:

> Hi,
>
> I get a weird segmentation fault and I really don't know why. Here is my
> code:
>
> if (triangulation_.is_valid(currCell))
> {
>     for (int k = 0; k < 4; k++)
>         cellsToProcess.push(currCell->neighbor(k)); // when accessing
> neighbor -> segfault
> }
>
> where triangulation_ is a
> CGAL::Triangulation_3<CGAL::Exact_predicates_exact_constructions_kernel,
> Tds_info>. and currCell is a Cell_handle.
>
> I'm checking the validity of currCell, so the neighbors should exist,
> right?
>
> Does someone have an idea why that could happen or how to check the
> validity of the neighbors  before accessing it in another way?
>
> Thomas
>
>

--
Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project

phone: +33.492.954.912    skype: andreas.fabri

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|

Re: Segmentation fault at neighbor access

Sylvain Pion-3
Administrator
Did you check that triangulation_.dimension() == 3 ?

2017-04-07 9:27 GMT+02:00 Andreas Fabri <[hidden email]>:

Did you check that the triangulation as a whole is valid?

andreas


On 07/04/2017 09:03, Thomas Holzmann wrote:
Hi,

I get a weird segmentation fault and I really don't know why. Here is my
code:

if (triangulation_.is_valid(currCell))
{
    for (int k = 0; k < 4; k++)
        cellsToProcess.push(currCell->neighbor(k)); // when accessing
neighbor -> segfault
}

where triangulation_ is a
CGAL::Triangulation_3<CGAL::Exact_predicates_exact_constructions_kernel,
Tds_info>. and currCell is a Cell_handle.

I'm checking the validity of currCell, so the neighbors should exist,
right?

Does someone have an idea why that could happen or how to check the
validity of the neighbors  before accessing it in another way?

Thomas



--
Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project

phone: <a href="tel:%2B33.492.954.912" value="+33492954912" target="_blank">+33.492.954.912    skype: andreas.fabri


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss



Reply | Threaded
Open this post in threaded view
|

Re: Segmentation fault at neighbor access

tholzmann

I want to reopen this thread again, as I still have the same issue.

Yes, my triangulation is valid and has dimension 3.

Does someone has another hint?

Thomas


On 04/07/2017 05:58 PM, Sylvain Pion wrote:
Did you check that triangulation_.dimension() == 3 ?

2017-04-07 9:27 GMT+02:00 Andreas Fabri <[hidden email]>:

Did you check that the triangulation as a whole is valid?

andreas


On 07/04/2017 09:03, Thomas Holzmann wrote:
Hi,

I get a weird segmentation fault and I really don't know why. Here is my
code:

if (triangulation_.is_valid(currCell))
{
    for (int k = 0; k < 4; k++)
        cellsToProcess.push(currCell->neighbor(k)); // when accessing
neighbor -> segfault
}

where triangulation_ is a
CGAL::Triangulation_3<CGAL::Exact_predicates_exact_constructions_kernel,
Tds_info>. and currCell is a Cell_handle.

I'm checking the validity of currCell, so the neighbors should exist,
right?

Does someone have an idea why that could happen or how to check the
validity of the neighbors  before accessing it in another way?

Thomas



--
Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project

phone: <a href="tel:%2B33.492.954.912" value="+33492954912" target="_blank" moz-do-not-send="true">+33.492.954.912    skype: andreas.fabri


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss




-- 
====================================================
Dipl.-Ing. Thomas Holzmann
TU Graz - Institut fuer Maschinelles Sehen und Darstellen
Graz University of Technology - Institute for Computer Graphics & Vision
Inffeldgasse 16/II, 8010 Graz, Austria

http://www.icg.tugraz.at/
phone: +43 316 873 5091
==================================================== 
Reply | Threaded
Open this post in threaded view
|

Re: Segmentation fault at neighbor access

Julia Fischer


On 6 June 2017 at 14:47, Thomas Holzmann <[hidden email]> wrote:

I want to reopen this thread again, as I still have the same issue.

Yes, my triangulation is valid and has dimension 3.

Does someone has another hint?

Thomas


On 04/07/2017 05:58 PM, Sylvain Pion wrote:
Did you check that triangulation_.dimension() == 3 ?

2017-04-07 9:27 GMT+02:00 Andreas Fabri <[hidden email]>:

Did you check that the triangulation as a whole is valid?

andreas


On 07/04/2017 09:03, Thomas Holzmann wrote:
Hi,

I get a weird segmentation fault and I really don't know why. Here is my
code:

if (triangulation_.is_valid(currCell))
{
    for (int k = 0; k < 4; k++)
        cellsToProcess.push(currCell->neighbor(k)); // when accessing
neighbor -> segfault
}

where triangulation_ is a
CGAL::Triangulation_3<CGAL::Exact_predicates_exact_constructions_kernel,
Tds_info>. and currCell is a Cell_handle.

I'm checking the validity of currCell, so the neighbors should exist,
right?

Does someone have an idea why that could happen or how to check the
validity of the neighbors  before accessing it in another way?

Thomas



--
Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project

phone: <a href="tel:%2B33.492.954.912" value="+33492954912" target="_blank">+33.492.954.912    skype: andreas.fabri


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss




-- 
====================================================
Dipl.-Ing. Thomas Holzmann
TU Graz - Institut fuer Maschinelles Sehen und Darstellen
Graz University of Technology - Institute for Computer Graphics & Vision
Inffeldgasse 16/II, 8010 Graz, Austria

http://www.icg.tugraz.at/
phone: <a href="tel:+43%20316%208735091" value="+433168735091" target="_blank">+43 316 873 5091
==================================================== 


signature.txt (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Segmentation fault at neighbor access

Sebastien Loriot (GeometryFactory)
In reply to this post by tholzmann
Did you modify the triangulation since the time the cell handle was saved?

Sebastien.

On 06/06/2017 02:47 PM, Thomas Holzmann wrote:

> I want to reopen this thread again, as I still have the same issue.
>
> Yes, my triangulation is valid and has dimension 3.
>
> Does someone has another hint?
>
> Thomas
>
>
> On 04/07/2017 05:58 PM, Sylvain Pion wrote:
>> Did you check that triangulation_.dimension() == 3 ?
>>
>> 2017-04-07 9:27 GMT+02:00 Andreas Fabri
>> <[hidden email]
>> <mailto:[hidden email]>>:
>>
>>
>>     Did you check that the triangulation as a whole is valid?
>>
>>     andreas
>>
>>
>>     On 07/04/2017 09:03, Thomas Holzmann wrote:
>>
>>         Hi,
>>
>>         I get a weird segmentation fault and I really don't know why.
>>         Here is my
>>         code:
>>
>>         if (triangulation_.is_valid(currCell))
>>         {
>>             for (int k = 0; k < 4; k++)
>>                 cellsToProcess.push(currCell->neighbor(k)); // when
>>         accessing
>>         neighbor -> segfault
>>         }
>>
>>         where triangulation_ is a
>>         CGAL::Triangulation_3<CGAL::Exact_predicates_exact_constructions_kernel,
>>         Tds_info>. and currCell is a Cell_handle.
>>
>>         I'm checking the validity of currCell, so the neighbors should
>>         exist,
>>         right?
>>
>>         Does someone have an idea why that could happen or how to
>>         check the
>>         validity of the neighbors  before accessing it in another way?
>>
>>         Thomas
>>
>>
>>
>>     --
>>     Andreas Fabri, PhD
>>     Chief Officer, GeometryFactory
>>     Editor, The CGAL Project
>>
>>     phone: +33.492.954.912 <tel:%2B33.492.954.912>    skype:
>>     andreas.fabri
>>
>>
>>     --
>>     You are currently subscribed to cgal-discuss.
>>     To unsubscribe or access the archives, go to
>>     https://sympa.inria.fr/sympa/info/cgal-discuss
>>     <https://sympa.inria.fr/sympa/info/cgal-discuss>
>>
>>
>>
>
> --
> ====================================================
> Dipl.-Ing. Thomas Holzmann
> TU Graz - Institut fuer Maschinelles Sehen und Darstellen
> Graz University of Technology - Institute for Computer Graphics & Vision
> Inffeldgasse 16/II, 8010 Graz, Austria
>
> http://www.icg.tugraz.at/
> phone: +43 316 873 5091
> ====================================================
>


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss