View Issue Details

IDProjectCategoryView StatusLast Update
0027259CommunityOCCT:Modeling Datapublic2016-03-29 17:34
Reporterrhplaxis Assigned Toabv 
PrioritynormalSeveritycrash 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2013 
Product Version7.0.0 
Target Version7.0.0Fixed in Version7.0.0 
Summary0027259: crash intersecting simple objects in occ7.0.0rc
DescriptionWhile testing the 7.0.0rc there were several crashes in simple intersections (BOPAlgo_Builder) Strangely complex cases seen to work without a hitch.

one of the simplest cases (as reproduced in code below) is a box and two planar surfaces.

Not tessellating the box and not using parallellization in BOPAlgo_Builder seem to prevent the bug. (not really a solution we can use)
Also the problem only occurred in release mode.

the stacktrace:
7fee53b3 +011 TKernel.dll ?SubType@Standard_Type@@QEBAIAEBV?$handle@VStandard_Type@@@opencascade@@@Z
7fee9655 +09f TKBRep.dll ?EmptyCopy@BRep_TEdge@@UEBA?AV?$handle@VTopoDS_TShape@@@opencascade@@XZ
7fee4699 +083 TKBO.dll ?MakeSplitEdge@BOPTools_AlgoTools@@SAXAEBVTopoDS_Edge@@AEBVTopoDS_Vertex@@N1NAEAV2@@Z
7fef1e25 +18d MSVCR120.dll _endthreadex


The problem occurred with the VS 2013. 64-bit binaries from http://dev.opencascade.org/index.php?q=node/1151
I am working with VS2013 update 5 on windows 7 (64-bits)
Steps To Reproduce#include <gtest/gtest.h>

#include <TopoDS_Shape.hxx>
#include <BRep_Builder.hxx>
#include <BRepTools.hxx>
#include <BOPAlgo_Builder.hxx>
#include <BRepPrimAPI_MakePrism.hxx>
#include <BRepMesh_IncrementalMesh.hxx>
#include <BRepBuilderAPI_MakePolygon.hxx>
#include <gce_MakePln.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>

TEST(PlayGround, soilVolume)
{
  //contour 0 0 12 8
  auto contour = makePolygonFace({
    {0.0, 0.0, -4.0},
    {12.0, 0.0, -4.0},
    {12.0, 8.0, -4.0},
    {0.0, 8.0, -4.0}});

  gp_Vec displacement(0.0, 0.0, 5.0);
  BRepPrimAPI_MakePrism prismMaker(contour, displacement);

  prismMaker.Build();

  if (!prismMaker.IsDone() || prismMaker.Shape().IsNull())
  {
    FAIL();
  }

  // box from z = -4 to 1
  auto box = prismMaker.Shape();
 
// Tessellator::simpleTessellate(box);
  BRepTools::Clean(box);
  BRepMesh_IncrementalMesh BRepMesher(box, 0.01, Standard_True, M_PI / 18.0, true);

  // two surfaces bigger than the box
  auto top = makePolygonFace({
    {-2.0, -2.0, 0.0},
    {14.0, -2.0, 0.0},
    {14.0, 10.0, 0.0},
    {-2.0, 10.0, 0.0}});

  auto bottom = makePolygonFace({
    {-2.0, -2.0, -3.0},
    {14.0, -2.0, -3.0},
    {14.0, 10.0, -3.0},
    {-2.0, 10.0, -3.0}});

//intersection
  BOPAlgo_Builder builder;

  builder.AddArgument(box);
  builder.AddArgument(top);
  builder.AddArgument(bottom);

  builder.SetRunParallel(true);
  builder.Perform();
}

TopoDS_Face makePolygonFace(const std::vector<gp_Pnt> &points)
{
  assert(points.size() >= 3);

  if (points.size() < 3)
  {
    return {};
  }

  BRepBuilderAPI_MakePolygon polygon{};

  for (const auto &point: points)
  {
    polygon.Add(point);
  }
  polygon.Close();

  TopoDS_Wire contourWire = polygon.Wire();
  if (contourWire.IsNull())
  {
    return {};
  }

  // plane
  gp_Pln plane = gce_MakePln(points[0], points[1], points[2]);

  //make face
  BRepBuilderAPI_MakeFace faceBuilder(plane, contourWire, Standard_True);
  if (!faceBuilder.IsDone())
  {
    return {};
  }

  TopoDS_Face face = faceBuilder.Face();
  if (face.IsNull())
  {
    return {};
  }

  return face;
}
TagsNo tags attached.
Test case number

Relationships

duplicate of 0027254 closedabv [Regression] 7.0 types initialization mechanism is not thread-safe on VS2013 

Activities

abv

2016-03-15 11:24

manager   ~0051621

The cause of problem is apparently the same as previously reported in 0027254: due to wrong check for capabilities of VS 2013 compiler, OCCT type system turned to be non-thread safe with VS 2013. The fix in branch CR27254 eliminates this problem (tested on the above reproducer).

Issue History

Date Modified Username Field Change
2016-03-14 17:50 rhplaxis New Issue
2016-03-14 17:50 rhplaxis Assigned To => msv
2016-03-14 17:56 rhplaxis Description Updated
2016-03-15 11:21 abv Relationship added duplicate of 0027254
2016-03-15 11:24 abv Note Added: 0051621
2016-03-15 11:25 abv Status new => resolved
2016-03-15 11:25 abv Target Version 7.1.0 => 7.0.0
2016-03-16 10:31 abv Assigned To msv => abv
2016-03-29 17:34 abv Status resolved => closed
2016-03-29 17:34 abv Resolution open => fixed
2016-03-29 17:34 abv Fixed in Version => 7.0.0