exception in Surface_mesh_2sm_circulators_8cpp

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

exception in Surface_mesh_2sm_circulators_8cpp

J. Scheurich
Hi,

When i try to compile

https://doc.cgal.org/latest/Surface_mesh/Surface_mesh_2sm_circulators_8cpp-example.html

i get the following exception:

$ g++ test_cgal.cpp -lCGAL
$ ./a.out
terminate called after throwing an instance of 'CGAL::Assertion_exception'
   what():  CGAL ERROR: assertion violation!
Expr: _idx < data_.size()
File: /usr/include/CGAL/Surface_mesh/Properties.h
Line: 173
Aborted (core dumped)
$

I tried CGAL 4.11 and CGAL 4.13 without success on Fedora Linux 28.

How can i fill a Surface_mesh with data (without a Off file...).

so long
MUFTI

--
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: exception in Surface_mesh_2sm_circulators_8cpp

Sebastien Loriot (GeometryFactory)
If you have this error message it means that you are trying to access
the property of an element that is outside of the range of simplices.
Are you sure you did not modify the example in the manual?

Sebastien.

On 06/19/2018 04:02 PM, J. Scheurich wrote:

> Hi,
>
> When i try to compile
>
> https://doc.cgal.org/latest/Surface_mesh/Surface_mesh_2sm_circulators_8cpp-example.html 
>
>
> i get the following exception:
>
> $ g++ test_cgal.cpp -lCGAL
> $ ./a.out
> terminate called after throwing an instance of 'CGAL::Assertion_exception'
>    what():  CGAL ERROR: assertion violation!
> Expr: _idx < data_.size()
> File: /usr/include/CGAL/Surface_mesh/Properties.h
> Line: 173
> Aborted (core dumped)
> $
>
> I tried CGAL 4.11 and CGAL 4.13 without success on Fedora Linux 28.
>
> How can i fill a Surface_mesh with data (without a Off file...).
>
> so long
> MUFTI
>

--
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: exception in Surface_mesh_2sm_circulators_8cpp

J. Scheurich
> If you have this error message it means that you are trying to access
> the property of an element that is outside of the range of simplices.
> Are you sure you did not modify the example in the manual?

I did not modified the example, but i found out it runs on
Ubuntu 16.04 Linux.
I also get a internal error in gdb while getting this exception,
maybe a error in gcc/g++ in fedora 28 ?

so long
MUFTI

--
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: exception in Surface_mesh_2sm_circulators_8cpp

J. Scheurich
>> If you have this error message it means that you are trying to access
>> the property of an element that is outside of the range of simplices.
>> Are you sure you did not modify the example in the manual?

 > I did not modified the example, but i found out it runs on
 > Ubuntu 16.04 Linux.
 > I also get a internal error in gdb while getting this exception,
 > maybe a error in gcc/g++ in fedora 28 ?

I found out:

Linux           | runs Surface_m...cpp without problems | realthing
----------------+---------------------------------------+----------
Fedora 28       | O                                     | O
----------------+---------------------------------------+----------
Arch Linux      | X                                     | O
----------------+---------------------------------------+----------
Ubuntu 16-04    | X                                     | X
----------------+---------------------------------------+----------
OpenSuse 42.3   | X                                     | X
----------------+---------------------------------------+----------
Debian strech   | X                                     | O

Realthing is the target csg in white_dune 0.99rc994

ftp://ftp.ourproject.org/pub/wdune/wdune-0.99rc994.tar.bz2

to make csg, use e.g.

$ dune -english

create -> Grouping node -> group
create -> Shape -> Sphere
click to group
create -> Shape -> cone
Convert -> Convert To IndexedFaceSet
click to Sphere
Convert -> Convert To IndexedFaceSet
Click to group
(IndexedFace)Set -> Boolean Operations -> Union

In case of realthing X this works, otherwise i get the
Exception of the fedora28 failure 8-(

So i think, the code is correct, but there is something
in (newer ?) CGAL, that causes the exception.

so long
MUFTI





--
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: exception in Surface_mesh_2sm_circulators_8cpp

Sebastien Loriot (GeometryFactory)
There must be something fishy here. See for example our test results here:

https://cgal.geometryfactory.com/CGAL/testsuite/results-4.13-I-34.shtml

You'll see that the line Surface_mesh_Examples where sm_circulators.cpp
is tested can be compiled and ran successfully on all our test platforms
(that includes some of yours).

Note also that in your compilation line with gcc you are missing
-frounding-math but that should not be responsible for the issue you have.

Could you indicate the gcc version with which sm_circulators.cpp is
failing?

Sebastien.

On 06/19/2018 11:22 PM, J. Scheurich wrote:

>>> If you have this error message it means that you are trying to access
>>> the property of an element that is outside of the range of simplices.
>>> Are you sure you did not modify the example in the manual?
>
>  > I did not modified the example, but i found out it runs on
>  > Ubuntu 16.04 Linux.
>  > I also get a internal error in gdb while getting this exception,
>  > maybe a error in gcc/g++ in fedora 28 ?
>
> I found out:
>
> Linux           | runs Surface_m...cpp without problems | realthing
> ----------------+---------------------------------------+----------
> Fedora 28       | O                                     | O
> ----------------+---------------------------------------+----------
> Arch Linux      | X                                     | O
> ----------------+---------------------------------------+----------
> Ubuntu 16-04    | X                                     | X
> ----------------+---------------------------------------+----------
> OpenSuse 42.3   | X                                     | X
> ----------------+---------------------------------------+----------
> Debian strech   | X                                     | O
>
> Realthing is the target csg in white_dune 0.99rc994
>
> ftp://ftp.ourproject.org/pub/wdune/wdune-0.99rc994.tar.bz2
>
> to make csg, use e.g.
>
> $ dune -english
>
> create -> Grouping node -> group
> create -> Shape -> Sphere
> click to group
> create -> Shape -> cone
> Convert -> Convert To IndexedFaceSet
> click to Sphere
> Convert -> Convert To IndexedFaceSet
> Click to group
> (IndexedFace)Set -> Boolean Operations -> Union
>
> In case of realthing X this works, otherwise i get the
> Exception of the fedora28 failure 8-(
>
> So i think, the code is correct, but there is something
> in (newer ?) CGAL, that causes the exception.
>
> so long
> MUFTI
>
>
>
>
>

--
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: exception in Surface_mesh_2sm_circulators_8cpp

J. Scheurich
> There must be something fishy here. See for example our test results here:
>
> https://cgal.geometryfactory.com/CGAL/testsuite/results-4.13-I-34.shtml
>
> You'll see that the line Surface_mesh_Examples where sm_circulators.cpp
> is tested can be compiled and ran successfully on all our test platforms
> (that includes some of yours).

Sorry for the table, it is misleading. sm_circulators.cpp failes only
under fedora 28 (not in the list of the tested systems) but i get
the exception of it under also under Debian and Arch Linux when i do

...
#include <CGAL/Surface_mesh.h>
typedef Kernel::Point_3 Point;
typedef CGAL::Surface_mesh<Point> Surface;
typedef Surface::Vertex_index vertex_index;
...

static void
build_mesh(Surface *meshOut, MyMesh *mesh, Matrix matrix)
{
     Array<vertex_index> u;
     for (int i = 0; i < mesh->getVertices()->getSFSize(); i++) {
         Vec3f v = mesh->getVertices()->getVec(i);
         v = matrix * v;
         u.append(meshOut->add_vertex(Kernel::Point_3(v.x, v.y, v.z)));
     }
     MFInt32 *meshCoords = mesh->getCoordIndex();
     int vert = 0;
     vertex_index v1;
     vertex_index v2;
     vertex_index v3;

     for (int i = 0; i < mesh->getSFSize(); i++) {
          int face = meshCoords->getValue(i);
          Vec3f v = mesh->getVertices()->getVec(face);
          if (face > -1) {
              switch (vert) {
                case 0:
                  v1 = u[face];
                  break;
                case 1:
                  v2 = u[face];
                 break;
                case 2:
                  v3 = u[face];
                  break;
              }
              if (vert++ == 2) {
                  vert = 0;
                  meshOut->add_face(v1, v2, v3);
              }
          }
     }
}

Array is a std::vector like, mesh->getVertices() are the vertices of the
mesh,  meshCoords is a numVertex1, numVertex2, numVertex2, -1 List as in
X3D.
Is this a valid way to fill a CGAL::Surface_mesh ?
It works on Ubuntu and OpenSuse.

> Note also that in your compilation line with gcc you are missing
> -frounding-math but that should not be responsible for the issue you have.

This is often missing in CGAL compiled by Linux distributors.
This fails valgrind to run on programs with CGAL linked, it throws a
other exception 8-(
Can't you add -frounding-math to the default cmake ?

> Could you indicate the gcc version with which sm_circulators.cpp is
> failing?

$ g++ --version
g++ (GCC) 8.1.1 20180502 (Red Hat 8.1.1-1)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

so long
MUFTI

--
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: exception in Surface_mesh_2sm_circulators_8cpp

Laurent Rineau (CGAL/GeometryFactory)
Le Wednesday, June 20, 2018 10:05:48 AM CEST J. Scheurich a écrit :

> > There must be something fishy here. See for example our test results
> > here:
> >
> > https://cgal.geometryfactory.com/CGAL/testsuite/results-4.13-I-34.shtml
> >
> > You'll see that the line Surface_mesh_Examples where sm_circulators.cpp
> > is tested can be compiled and ran successfully on all our test platforms
> > (that includes some of yours).
>
> Sorry for the table, it is misleading. sm_circulators.cpp failes only
> under fedora 28 (not in the list of the tested systems) but i get
> the exception of it under also under Debian and Arch Linux when i do

In the CGAL test results, all the test platforms named Fedora<something> (but
not Fedora-rawhide) are using the last public version of Fedora: Fedora 28.

--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory           http://www.geometryfactory.com/
Release Manager of the CGAL Project       http://www.cgal.org/




--
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: exception in Surface_mesh_2sm_circulators_8cpp

J. Scheurich
In reply to this post by J. Scheurich
 > > There must be something fishy here. See for example our test results
 > > here:
 > >
 > > https://cgal.geometryfactory.com/CGAL/testsuite/results-4.13-I-34.shtml
 > >
 > > You'll see that the line Surface_mesh_Examples where
sm_circulators.cpp
 > > is tested can be compiled and ran successfully on all our test
platforms
 > > (that includes some of yours).

 > In the CGAL test results, all the test platforms named
Fedora<something> (but
 > not Fedora-rawhide) are using the last public version of Fedora:
Fedora 28.

Are you really sure ? Fedora 28 was realeased on 1. Mai 2018, maybe

  the test is not in sync with the fedora release...

so long

MUFTI


--
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: exception in Surface_mesh_2sm_circulators_8cpp

Laurent Rineau (CGAL/GeometryFactory)
Le Thursday, June 21, 2018 12:23:22 PM CEST j. scheurich a écrit :

>  > > There must be something fishy here. See for example our test results
>  > > here:
>  > >
>  > > https://cgal.geometryfactory.com/CGAL/testsuite/results-4.13-I-34.shtm
>  > > l
>  > >
>  > > You'll see that the line Surface_mesh_Examples where
>
> sm_circulators.cpp
>
>  > > is tested can be compiled and ran successfully on all our test
>
> platforms
>
>  > > (that includes some of yours).
>  >
>  > In the CGAL test results, all the test platforms named
>
> Fedora<something> (but
>
>  > not Fedora-rawhide) are using the last public version of Fedora:
> Fedora 28.
>
> Are you really sure ? Fedora 28 was realeased on 1. Mai 2018, maybe
>
>   the test is not in sync with the fedora release...
>
> so long

Of course I am sure. The testing of the internal release CGAL-4.13-I-34 was done during the night between 1st June 2018 and the 2nd. And our test platforms are updated every week (on Sundays, I think).

Anyway, if you read

  https://cgal.geometryfactory.com/CGAL/testsuite/CGAL-4.13-I-34/Installation/TestReport_lrineau_Fedora.gz

then you can see that the compiler /usr/bin/c++ is GCC 8.1.1, and that is the version of Fedora 28, whereas Fedora 27 was using GCC 7.3.1. See:

  https://apps.fedoraproject.org/packages/gcc

--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory           http://www.geometryfactory.com/
Release Manager of the CGAL Project       http://www.cgal.org/




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