[cgma-dev] Seg fault when loading OCC geometry with associations

Jed Brown jed at 59A2.org
Sat Mar 28 15:13:57 CDT 2009


On Sat 2009-03-28 12:47, Jiangtao Hu wrote:

> When you save the geometry file, it crashed, which means the brep file
> you get may already been wrong. That explained the crash when you load
> it again.

When I saved the geometry, iGeom_save returned success, so I don't think
there was a crash there.

> Can you send a journal file to demonstrate the first crash? 

What journal file?  I'm creating the geometry using iGeom so it's source
code.  The snippet that creates the geometry is below.  When
(assoc_with_brick==1) my relation testing code successfully loads the
geometry, but the boundary sets 'facesets' end up being associated with
points instead of the volume.  The geometry file for this case is
'dblock-assoc_with_brick.brep'.  When (assoc_with_brick==0) I get the
seg-fault in iGeom_load (trace in my last message).  The geometry file
for this case is 'dblock.brep'.

I can send you a full test case if necessary, but my current code uses
utilities from my analysis code so it will take a little work to make it
stand alone.

Jed


  if (do_geom) {
    char geom_options[] = "ENGINE=OCC:",
      geom_save_options[] = ":TYPE=OCC:";
    iGeom_Instance geom;
    iRel_Instance assoc;
    iRel_RelationHandle rel;
    iBase_EntityHandle brick;
    iGeom_newGeom(geom_options,&geom,&err,sizeof geom_options);dIGCHK(geom,err);
    iRel_newAssoc(0,&assoc,&err,0);dIRCHK(assoc,err);
    iRel_createAssociation(assoc,geom,0,iRel_IGEOM_IFACE,mesh,1,iRel_IMESH_IFACE,&rel,&err);dIGCHK(assoc,err);
    iGeom_createBrick(geom,box.x1-box.x0,box.y1-box.y0,box.z1-box.z0,&brick,&err);dIGCHK(geom,err);
    iGeom_moveEnt(geom,brick,0.5*(box.x0+box.x1),0.5*(box.y0+box.y1),0.5*(box.z0+box.z1),&err);dIGCHK(geom,err);
    err = PrintBoundingBox(geom,brick,"brick");dCHK(err);
    {
      iBase_EntityHandle gface[6],*gface_p=gface;
      int gface_a=6,gface_s;
      iGeom_getEntAdj(geom,brick,2,&gface_p,&gface_a,&gface_s,&err);dIGCHK(geom,err);
      for (i=0; i<6; i++) {
        char name[20];
        sprintf(name,"face_%d",i);
        err = PrintBoundingBox(geom,gface[i],name);dCHK(err);
      }
      if (assoc_with_brick) {
        for (i=0; i<6; i++) {
          iRel_setEntSetAssociation(assoc,rel,brick,facesets[i],&err);dIRCHK(assoc,err);
        }
      } else {
        iRel_setEntSetAssociation(assoc,rel,gface[0],facesets[3],&err);dIRCHK(assoc,err);
        iRel_setEntSetAssociation(assoc,rel,gface[1],facesets[1],&err);dIRCHK(assoc,err);
        iRel_setEntSetAssociation(assoc,rel,gface[2],facesets[0],&err);dIRCHK(assoc,err);
        iRel_setEntSetAssociation(assoc,rel,gface[3],facesets[2],&err);dIRCHK(assoc,err);
        iRel_setEntSetAssociation(assoc,rel,gface[4],facesets[4],&err);dIRCHK(assoc,err);
        iRel_setEntSetAssociation(assoc,rel,gface[5],facesets[5],&err);dIRCHK(assoc,err);
      }
    }
    iGeom_save(geom,outgeom,geom_save_options,&err,sizeof outgeom,sizeof geom_save_options);dIGCHK(geom,err);
    iGeom_dtor(geom,&err);dIGCHK(geom,err);
    iRel_dtor(assoc,&err);dIRCHK(assoc,err);
  }
-------------- next part --------------
DBRep_DrawableShape

CASCADE Topology V1, (c) Matra-Datavision
Locations 3
1
              1               0               0              -1 
              0               1               0              -1 
              0               0               1              -1 
1
              1               0               0               0 
              0               1               0               0 
              0               0               1               0 
2  1 1 2 1 0
Curve2ds 24
1 0 0 1 0 
1 0 0 1 0 
1 2 0 0 -1 
1 0 0 0 1 
1 0 -2 1 0 
1 0 0 1 0 
1 0 0 0 -1 
1 0 0 0 1 
1 0 0 1 0 
1 0 2 1 0 
1 2 0 0 -1 
1 2 0 0 1 
1 0 -2 1 0 
1 0 2 1 0 
1 0 0 0 -1 
1 2 0 0 1 
1 0 0 0 1 
1 0 0 1 0 
1 2 0 0 1 
1 0 0 1 0 
1 0 0 0 1 
1 0 2 1 0 
1 2 0 0 1 
1 0 2 1 0 
Curves 12
1 0 0 0 0 0 1 
1 0 0 2 -0 1 0 
1 0 2 0 0 0 1 
1 0 0 0 -0 1 0 
1 2 0 0 0 0 1 
1 2 0 2 0 1 0 
1 2 2 0 0 0 1 
1 2 0 0 -0 1 0 
1 0 0 0 1 0 -0 
1 0 0 2 1 0 -0 
1 0 2 0 1 0 -0 
1 0 2 2 1 0 -0 
Polygon3D 0
PolygonOnTriangulations 0
Surfaces 6
1 0 0 0 1 0 -0 0 0 1 0 -1 0 
1 0 0 0 -0 1 0 0 0 1 1 0 -0 
1 0 0 2 0 0 1 1 0 -0 -0 1 0 
1 0 2 0 -0 1 0 0 0 1 1 0 -0 
1 0 0 0 0 0 1 1 0 -0 -0 1 0 
1 2 0 0 1 0 -0 0 0 1 0 -1 0 
Triangulations 0

TShapes 35
Ve
1e-07
0 0 2
0 0

CGM_ATTRIB ENTITY_ID* * 4 -2147483648 -1 * *
*
0101101
*
Ve
1e-07
0 0 0
0 0

CGM_ATTRIB ENTITY_ID* * 1 -2147483648 -1 * *
*
0101101
*
Ed
 1e-07 1 1 0
1  1 0 0 2
2  1 1 0 0 2
2  2 2 0 0 2
0

CGM_ATTRIB ENTITY_ID* * 4 -2147483648 -1 * *
*
0101000
-35 0 +34 0 *
Ve
1e-07
0 2 2
0 0

CGM_ATTRIB ENTITY_ID* * 3 -2147483648 -1 * *
*
0101101
*
Ed
 1e-07 1 1 0
1  2 0 0 2
2  3 1 0 0 2
2  4 3 0 0 2
0

CGM_ATTRIB ENTITY_ID* * 3 -2147483648 -1 * *
*
0101000
-32 0 +35 0 *
Ve
1e-07
0 2 0
0 0

CGM_ATTRIB ENTITY_ID* * 2 -2147483648 -1 * *
*
0101101
*
Ed
 1e-07 1 1 0
1  3 0 0 2
2  5 1 0 0 2
2  6 4 0 0 2
0

CGM_ATTRIB ENTITY_ID* * 2 -2147483648 -1 * *
*
0101000
-32 0 +30 0 *
Ed
 1e-07 1 1 0
1  4 0 0 2
2  7 1 0 0 2
2  8 5 0 0 2
0

CGM_ATTRIB ENTITY_ID* * 1 -2147483648 -1 * *
*
0101000
-30 0 +34 0 *
Wi

0101000
-33 0 -31 0 +29 0 +28 0 *
Fa
0  1e-07 1 0

CGM_ATTRIB ENTITY_ID* * 1 -2147483648 -1 * *
*
0111000
+27 0 *
Ve
1e-07
2 0 2
0 0

CGM_ATTRIB ENTITY_ID* * 6 -2147483648 -1 * *
*
0101101
*
Ve
1e-07
2 0 0
0 0

CGM_ATTRIB ENTITY_ID* * 5 -2147483648 -1 * *
*
0101101
*
Ed
 1e-07 1 1 0
1  5 0 0 2
2  9 6 0 0 2
2  10 2 0 0 2
0

CGM_ATTRIB ENTITY_ID* * 5 -2147483648 -1 * *
*
0101000
-25 0 +24 0 *
Ve
1e-07
2 2 2
0 0

CGM_ATTRIB ENTITY_ID* * 8 -2147483648 -1 * *
*
0101101
*
Ed
 1e-07 1 1 0
1  6 0 0 2
2  11 6 0 0 2
2  12 3 0 0 2
0

CGM_ATTRIB ENTITY_ID* * 8 -2147483648 -1 * *
*
0101000
-22 0 +25 0 *
Ve
1e-07
2 2 0
0 0

CGM_ATTRIB ENTITY_ID* * 7 -2147483648 -1 * *
*
0101101
*
Ed
 1e-07 1 1 0
1  7 0 0 2
2  13 6 0 0 2
2  14 4 0 0 2
0

CGM_ATTRIB ENTITY_ID* * 7 -2147483648 -1 * *
*
0101000
-22 0 +20 0 *
Ed
 1e-07 1 1 0
1  8 0 0 2
2  15 6 0 0 2
2  16 5 0 0 2
0

CGM_ATTRIB ENTITY_ID* * 6 -2147483648 -1 * *
*
0101000
-20 0 +24 0 *
Wi

0101000
-23 0 -21 0 +19 0 +18 0 *
Fa
0  1e-07 6 0

CGM_ATTRIB ENTITY_ID* * 2 -2147483648 -1 * *
*
0111000
+17 0 *
Ed
 1e-07 1 1 0
1  9 0 0 2
2  17 2 0 0 2
2  18 5 0 0 2
0

CGM_ATTRIB ENTITY_ID* * 10 -2147483648 -1 * *
*
0101000
-24 0 +34 0 *
Ed
 1e-07 1 1 0
1  10 0 0 2
2  19 2 0 0 2
2  20 3 0 0 2
0

CGM_ATTRIB ENTITY_ID* * 9 -2147483648 -1 * *
*
0101000
-25 0 +35 0 *
Wi

0101000
-15 0 -23 0 +14 0 +33 0 *
Fa
0  1e-07 2 0

CGM_ATTRIB ENTITY_ID* * 3 -2147483648 -1 * *
*
0111000
+13 0 *
Ed
 1e-07 1 1 0
1  11 0 0 2
2  21 4 0 0 2
2  22 5 0 0 2
0

CGM_ATTRIB ENTITY_ID* * 11 -2147483648 -1 * *
*
0101000
-20 0 +30 0 *
Ed
 1e-07 1 1 0
1  12 0 0 2
2  23 4 0 0 2
2  24 3 0 0 2
0

CGM_ATTRIB ENTITY_ID* * 12 -2147483648 -1 * *
*
0101000
-22 0 +32 0 *
Wi

0101000
-11 0 -19 0 +10 0 +29 0 *
Fa
0  1e-07 4 0

CGM_ATTRIB ENTITY_ID* * 4 -2147483648 -1 * *
*
0111000
+9 0 *
Wi

0101000
-28 0 -11 0 +18 0 +15 0 *
Fa
0  1e-07 5 0

CGM_ATTRIB ENTITY_ID* * 5 -2147483648 -1 * *
*
0111000
+7 0 *
Wi

0101000
-31 0 -10 0 +21 0 +14 0 *
Fa
0  1e-07 3 0

CGM_ATTRIB ENTITY_ID* * 6 -2147483648 -1 * *
*
0111000
+5 0 *
Sh

0101100
-26 0 +16 0 -12 0 +8 0 -6 0 +4 0 *
So

CGM_ATTRIB ENTITY_ID* * 1 -2147483648 -1 * *
*
0100000
+3 0 *
Co

1100000
+2 3 *

+1 0 
-------------- next part --------------
DBRep_DrawableShape

CASCADE Topology V1, (c) Matra-Datavision
Locations 3
1
              1               0               0              -1 
              0               1               0              -1 
              0               0               1              -1 
1
              1               0               0               0 
              0               1               0               0 
              0               0               1               0 
2  1 1 2 1 0
Curve2ds 24
1 0 0 1 0 
1 0 0 1 0 
1 2 0 0 -1 
1 0 0 0 1 
1 0 -2 1 0 
1 0 0 1 0 
1 0 0 0 -1 
1 0 0 0 1 
1 0 0 1 0 
1 0 2 1 0 
1 2 0 0 -1 
1 2 0 0 1 
1 0 -2 1 0 
1 0 2 1 0 
1 0 0 0 -1 
1 2 0 0 1 
1 0 0 0 1 
1 0 0 1 0 
1 2 0 0 1 
1 0 0 1 0 
1 0 0 0 1 
1 0 2 1 0 
1 2 0 0 1 
1 0 2 1 0 
Curves 12
1 0 0 0 0 0 1 
1 0 0 2 -0 1 0 
1 0 2 0 0 0 1 
1 0 0 0 -0 1 0 
1 2 0 0 0 0 1 
1 2 0 2 0 1 0 
1 2 2 0 0 0 1 
1 2 0 0 -0 1 0 
1 0 0 0 1 0 -0 
1 0 0 2 1 0 -0 
1 0 2 0 1 0 -0 
1 0 2 2 1 0 -0 
Polygon3D 0
PolygonOnTriangulations 0
Surfaces 6
1 0 0 0 1 0 -0 0 0 1 0 -1 0 
1 0 0 0 -0 1 0 0 0 1 1 0 -0 
1 0 0 2 0 0 1 1 0 -0 -0 1 0 
1 0 2 0 -0 1 0 0 0 1 1 0 -0 
1 0 0 0 0 0 1 1 0 -0 -0 1 0 
1 2 0 0 1 0 -0 0 0 1 0 -1 0 
Triangulations 0

TShapes 35
Ve
1e-07
0 0 2
0 0

CGM_ATTRIB ENTITY_ID* * 4 -2147483648 -1 * *
*
0101101
*
Ve
1e-07
0 0 0
0 0

CGM_ATTRIB ENTITY_ID* * 1 -2147483648 -1 * *
*
0101101
*
Ed
 1e-07 1 1 0
1  1 0 0 2
2  1 1 0 0 2
2  2 2 0 0 2
0

CGM_ATTRIB ENTITY_ID* * 4 -2147483648 -1 * *
*
0101000
-35 0 +34 0 *
Ve
1e-07
0 2 2
0 0

CGM_ATTRIB ENTITY_ID* * 3 -2147483648 -1 * *
*
0101101
*
Ed
 1e-07 1 1 0
1  2 0 0 2
2  3 1 0 0 2
2  4 3 0 0 2
0

CGM_ATTRIB ENTITY_ID* * 3 -2147483648 -1 * *
*
0101000
-32 0 +35 0 *
Ve
1e-07
0 2 0
0 0

CGM_ATTRIB ENTITY_ID* * 2 -2147483648 -1 * *
*
0101101
*
Ed
 1e-07 1 1 0
1  3 0 0 2
2  5 1 0 0 2
2  6 4 0 0 2
0

CGM_ATTRIB ENTITY_ID* * 2 -2147483648 -1 * *
*
0101000
-32 0 +30 0 *
Ed
 1e-07 1 1 0
1  4 0 0 2
2  7 1 0 0 2
2  8 5 0 0 2
0

CGM_ATTRIB ENTITY_ID* * 1 -2147483648 -1 * *
*
0101000
-30 0 +34 0 *
Wi

0101000
-33 0 -31 0 +29 0 +28 0 *
Fa
0  1e-07 1 0

CGM_ATTRIB ITAPS_TAG* ASSOCIATION0* 1 8 4 -1342177280 * *
CGM_ATTRIB ENTITY_ID* * 1 -2147483648 -1 * *
*
0111000
+27 0 *
Ve
1e-07
2 0 2
0 0

CGM_ATTRIB ENTITY_ID* * 6 -2147483648 -1 * *
*
0101101
*
Ve
1e-07
2 0 0
0 0

CGM_ATTRIB ENTITY_ID* * 5 -2147483648 -1 * *
*
0101101
*
Ed
 1e-07 1 1 0
1  5 0 0 2
2  9 6 0 0 2
2  10 2 0 0 2
0

CGM_ATTRIB ENTITY_ID* * 5 -2147483648 -1 * *
*
0101000
-25 0 +24 0 *
Ve
1e-07
2 2 2
0 0

CGM_ATTRIB ENTITY_ID* * 8 -2147483648 -1 * *
*
0101101
*
Ed
 1e-07 1 1 0
1  6 0 0 2
2  11 6 0 0 2
2  12 3 0 0 2
0

CGM_ATTRIB ENTITY_ID* * 8 -2147483648 -1 * *
*
0101000
-22 0 +25 0 *
Ve
1e-07
2 2 0
0 0

CGM_ATTRIB ENTITY_ID* * 7 -2147483648 -1 * *
*
0101101
*
Ed
 1e-07 1 1 0
1  7 0 0 2
2  13 6 0 0 2
2  14 4 0 0 2
0

CGM_ATTRIB ENTITY_ID* * 7 -2147483648 -1 * *
*
0101000
-22 0 +20 0 *
Ed
 1e-07 1 1 0
1  8 0 0 2
2  15 6 0 0 2
2  16 5 0 0 2
0

CGM_ATTRIB ENTITY_ID* * 6 -2147483648 -1 * *
*
0101000
-20 0 +24 0 *
Wi

0101000
-23 0 -21 0 +19 0 +18 0 *
Fa
0  1e-07 6 0

CGM_ATTRIB ITAPS_TAG* ASSOCIATION0* 1 8 2 -1342177280 * *
CGM_ATTRIB ENTITY_ID* * 2 -2147483648 -1 * *
*
0111000
+17 0 *
Ed
 1e-07 1 1 0
1  9 0 0 2
2  17 2 0 0 2
2  18 5 0 0 2
0

CGM_ATTRIB ENTITY_ID* * 10 -2147483648 -1 * *
*
0101000
-24 0 +34 0 *
Ed
 1e-07 1 1 0
1  10 0 0 2
2  19 2 0 0 2
2  20 3 0 0 2
0

CGM_ATTRIB ENTITY_ID* * 9 -2147483648 -1 * *
*
0101000
-25 0 +35 0 *
Wi

0101000
-15 0 -23 0 +14 0 +33 0 *
Fa
0  1e-07 2 0

CGM_ATTRIB ITAPS_TAG* ASSOCIATION0* 1 8 1 -1342177280 * *
CGM_ATTRIB ENTITY_ID* * 3 -2147483648 -1 * *
*
0111000
+13 0 *
Ed
 1e-07 1 1 0
1  11 0 0 2
2  21 4 0 0 2
2  22 5 0 0 2
0

CGM_ATTRIB ENTITY_ID* * 11 -2147483648 -1 * *
*
0101000
-20 0 +30 0 *
Ed
 1e-07 1 1 0
1  12 0 0 2
2  23 4 0 0 2
2  24 3 0 0 2
0

CGM_ATTRIB ENTITY_ID* * 12 -2147483648 -1 * *
*
0101000
-22 0 +32 0 *
Wi

0101000
-11 0 -19 0 +10 0 +29 0 *
Fa
0  1e-07 4 0

CGM_ATTRIB ITAPS_TAG* ASSOCIATION0* 1 8 3 -1342177280 * *
CGM_ATTRIB ENTITY_ID* * 4 -2147483648 -1 * *
*
0111000
+9 0 *
Wi

0101000
-28 0 -11 0 +18 0 +15 0 *
Fa
0  1e-07 5 0

CGM_ATTRIB ITAPS_TAG* ASSOCIATION0* 1 8 5 -1342177280 * *
CGM_ATTRIB ENTITY_ID* * 5 -2147483648 -1 * *
*
0111000
+7 0 *
Wi

0101000
-31 0 -10 0 +21 0 +14 0 *
Fa
0  1e-07 3 0

CGM_ATTRIB ITAPS_TAG* ASSOCIATION0* 1 8 6 -1342177280 * *
CGM_ATTRIB ENTITY_ID* * 6 -2147483648 -1 * *
*
0111000
+5 0 *
Sh

0101100
-26 0 +16 0 -12 0 +8 0 -6 0 +4 0 *
So

CGM_ATTRIB ENTITY_ID* * 1 -2147483648 -1 * *
*
0100000
+3 0 *
Co

1100000
+2 3 *

+1 0 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/cgma-dev/attachments/20090328/eb1c60fe/attachment.pgp>


More information about the cgma-dev mailing list