View Issue Details

IDProjectCategoryView StatusLast Update
0032279Open CASCADEOCCT:DRAWpublic2021-05-29 13:12
Reporterkgv Assigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version7.5.0 
Target Version7.6.0Fixed in Version7.6.0 
Summary0032279: Draw Harness - protect incmesh from hanging on syntax error
DescriptionPassing the following input to incmesh:
psphere s 1
incmesh s 0.008 -a 0

and
psphere s1 1
psphere s2 1
psphere s3 1
incmesh s1 s2 s3 0.008

doesn't raise any errors and instead leads to infinite loop due to passing 0 as deflection parameters.
It is desired improving BRepMesh to raise exception on obviously invalid input parameters (<=0, though alternative might be clamping too small values to some reasonable lower limit), as well as incmesh to better validate input parameters.
Steps To ReproduceNot required
TagsNo tags attached.
Test case numberNot required

Activities

mkrylova

2021-05-18 17:59

developer   ~0101155

Solution elaboration, Testing

git

2021-05-19 13:40

administrator   ~0101174

Branch CR32279 has been created by mkrylova.

SHA-1: 87d3d391d071ac0139b5360609bbe545824f97ba


Detailed log of new commits:

Author: mkrylova
Date: Tue May 18 13:51:22 2021 +0300

    0032279: Draw Harness - protect incmesh from hanging on syntax error
    
    - improved incmesh to raise exception on obviously invalid input parameters
    - added possibility to operate multiple objects

kgv

2021-05-19 14:53

developer   ~0101177

    TCollection_AsciiString aName = aNamesOfShapes.Value (anIter);
    TopoDS_Shape aShape = DBRep::Get (aName);
    if (aShape.IsNull())
    {
      di << " Null shapes are not allowed here\n";
      continue;
    }

Please move this code to "for (Standard_Integer anArgIter = 1; anArgIter < nbarg; ++anArgIter)" loop, so that NCollection_Sequence<TCollection_AsciiString> aNamesOfShapes could be replaced by TopoDS_ListOfShape.

  for (Standard_Integer anIter = 1; anIter <= aNamesOfShapes.Length(); ++anIter)
  {

Please don't call meshing tool for each shape individually - make a TopoDS_Compound instead if there are more than 1 shape in input.

      di << " Null shapes are not allowed here\n";
      continue;

This should be an error within "return 1" result.

      if (aVal <= Precision::Confusion())
      {
        di << "Syntax error: invalid input parameter '" << argv[anArgIter] << "'";
        return 1;
      }

Please try also embedding such checks into the algorithm itself (throwing Standard_NumericError or similar).

git

2021-05-20 11:08

administrator   ~0101196

Branch CR32279 has been updated by mkrylova.

SHA-1: 822f12a1b163460e33d652b0843f7a927ac87042


Detailed log of new commits:

Author: mkrylova
Date: Wed May 19 19:42:13 2021 +0300

    # kgv remarks
    - fixed remarks
    - added checking for too small values in BrepMesh algorithm

git

2021-05-20 11:13

administrator   ~0101197

Branch CR32279_1 has been created by mkrylova.

SHA-1: 7c18980f0667f178d20be67e77f9e03e9478acc0


Detailed log of new commits:

Author: mkrylova
Date: Tue May 18 13:51:22 2021 +0300

    0032279: Draw Harness - protect incmesh from hanging on syntax error
    
    - improved incmesh to raise exception on invalid input parameters
    - added possibility to operate multiple objects
    - added checking for too small values in BrepMesh algorithm

mkrylova

2021-05-20 11:16

developer   ~0101198

Fixing remarks, Testing

git

2021-05-20 12:59

administrator   ~0101201

Branch CR32279_1 has been updated by mkrylova.

SHA-1: b5618780a09a6eef0c7216b41453bbafeff519aa


Detailed log of new commits:

Author: mkrylova
Date: Thu May 20 12:59:28 2021 +0300

    # kgv remarks
    - fixed remarks

git

2021-05-20 13:02

administrator   ~0101202

Branch CR32279_2 has been created by mkrylova.

SHA-1: cae9667d198ac0518e452d6f4b02b22275ed99ea


Detailed log of new commits:

Author: mkrylova
Date: Tue May 18 13:51:22 2021 +0300

    0032279: Draw Harness - protect incmesh from hanging on syntax error
    
    - improved incmesh to raise exception on invalid input parameters
    - added possibility to operate multiple objects
    - added checking for too small values in BrepMesh algorithm

git

2021-05-20 16:15

administrator   ~0101213

Branch CR32279_2 has been updated by mkrylova.

SHA-1: 608c527a3cb81613579f5fa490abdc259efbf412


Detailed log of new commits:

Author: mkrylova
Date: Thu May 20 16:16:15 2021 +0300

    # kgv remarks
    - moved converting values to radians

git

2021-05-20 16:17

administrator   ~0101214

Branch CR32279_3 has been created by mkrylova.

SHA-1: 7a2b4e01c0454cd00a2ef4469e2b68b5ff6b6465


Detailed log of new commits:

Author: mkrylova
Date: Tue May 18 13:51:22 2021 +0300

    0032279: Draw Harness - protect incmesh from hanging on syntax error
    
    - improved incmesh to raise exception on invalid input parameters
    - added possibility to operate multiple objects
    - added checking for too small values in BrepMesh algorithm

mkrylova

2021-05-21 11:30

developer   ~0101228

Last edited: 2021-05-24 12:07

Solution implementation

git

2021-05-24 17:50

administrator   ~0101332

Branch CR32279_3 has been updated forcibly by mkrylova.

SHA-1: a230498076e1a2550280eea127876e6c7c3b7488

git

2021-05-24 17:51

administrator   ~0101333

Branch CR32279_4 has been created by mkrylova.

SHA-1: bc7e8fcb183852ca29f4814d9930c08b344db5e6


Detailed log of new commits:

Author: mkrylova
Date: Tue May 18 13:51:22 2021 +0300

    0032279: Draw Harness - protect incmesh from hanging on syntax error
    
    - improved incmesh to raise exception on invalid input parameters
    - added possibility to operate multiple objects
    - added checking for too small values in BrepMesh algorithm

mkrylova

2021-05-24 18:42

developer   ~0101336

Solution implementation, Testing

mkrylova

2021-05-25 18:34

developer   ~0101362

http://jenkins-test-occt/view/CR32279_4-master-MKRYLOVA/view/ALL/

kgv

2021-05-26 11:44

developer   ~0101381

-  const Standard_Real aDeflection = GetDeflection (theShape, theDrawer);
+  const Standard_Real aDeflection = Max (GetDeflection (theShape, theDrawer), Precision::Confusion());

Could you please share a specific test case (preferably localized) which triggers this issue?
Does GetDeflection() returns 0.0 in this case of value between 0 and Precision::Confusion()?
In the latter case, I guess that it would be better clamping computed within GetDeflection() method, or change Incmesh checks to protect from 0.0 instead of Precision::Confusion().

mkrylova

2021-05-27 11:27

developer   ~0101419

It triggered in the bugs/caf/bug26293_2 test http://occt-tests/CR32279_3-master-MKRYLOVA-OCCT/Windows-64-VC14/bugs/caf/bug26293_2.html. The GetDeflection() method returned a value much less than Precision::Confusion (), so an error was triggered from BRepMesh_IncrementalMesh

kgv

2021-05-27 17:45

developer   ~0101430

Please update method Prs3d::GetDeflection() to clamp output value instead of currently modified place:
  static Standard_Real GetDeflection (const Graphic3d_Vec3d& theBndMin,
                                      const Graphic3d_Vec3d& theBndMax,
                                      const Standard_Real theDeviationCoefficient)
  {
    const Graphic3d_Vec3d aDiag = theBndMax - theBndMin;
    return Max (aDiag.maxComp() * theDeviationCoefficient * 4.0, Precision::Confusion());
  }

git

2021-05-28 14:22

administrator   ~0101447

Branch CR32279_4 has been updated by mkrylova.

SHA-1: f2962f70d2012bb4d1c6a8e86dd8fc2cd03c9d27


Detailed log of new commits:

Author: mkrylova
Date: Fri May 28 14:22:37 2021 +0300

    # kgv remarks

git

2021-05-28 14:23

administrator   ~0101448

Branch CR32279_5 has been created by mkrylova.

SHA-1: 84c723db83b193fc663cbb6fedb303492714ebb4


Detailed log of new commits:

Author: mkrylova
Date: Tue May 18 13:51:22 2021 +0300

    0032279: Draw Harness - protect incmesh from hanging on syntax error
    
    - improved incmesh to raise exception on invalid input parameters
    - added possibility to operate multiple objects
    - added checking for too small values in BrepMesh algorithm

kgv

2021-05-28 16:28

developer   ~0101453

Please raise corrected patch
- OCCT: branch CR32279_5.

mkrylova

2021-05-28 18:15

developer   ~0101462

Solution implementation

bugmaster

2021-05-29 12:03

administrator   ~0101478

Combination -
OCCT branch : IR-2021-05-28
master SHA - 2315a044240803013da63dd2f5209c739ab03727
a87b7ddc8cb44606b91e3f37113847c3f5f50fdc
Products branch : IR-2021-05-28 SHA - 2131ac830b9e3c707d427f2aac9c50dcfa5c74db
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 17574.5700000004 / 17867.41000000037 [-1.64%]
Products
Total CPU difference: 11533.700000000124 / 11535.680000000108 [-0.02%]
Windows-64-VC14:
OCCT
Total CPU difference: 19393.5625 / 19367.75 [+0.13%]
Products
Total CPU difference: 12891.8125 / 12920.9375 [-0.23%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2021-05-29 13:12

administrator   ~0101487

Branch CR32279 has been deleted by mnt.

SHA-1: 822f12a1b163460e33d652b0843f7a927ac87042

git

2021-05-29 13:12

administrator   ~0101488

Branch CR32279_1 has been deleted by mnt.

SHA-1: b5618780a09a6eef0c7216b41453bbafeff519aa

git

2021-05-29 13:12

administrator   ~0101489

Branch CR32279_2 has been deleted by mnt.

SHA-1: 608c527a3cb81613579f5fa490abdc259efbf412

git

2021-05-29 13:12

administrator   ~0101490

Branch CR32279_3 has been deleted by mnt.

SHA-1: a230498076e1a2550280eea127876e6c7c3b7488

git

2021-05-29 13:12

administrator   ~0101491

Branch CR32279_4 has been deleted by mnt.

SHA-1: f2962f70d2012bb4d1c6a8e86dd8fc2cd03c9d27

git

2021-05-29 13:12

administrator   ~0101492

Branch CR32279_5 has been deleted by mnt.

SHA-1: 84c723db83b193fc663cbb6fedb303492714ebb4

Related Changesets

occt: master 2315a044

2021-05-18 10:51:22

mkrylova


Committer: bugmaster Details Diff
0032279: Draw Harness - protect incmesh from hanging on syntax error

- improved incmesh to raise exception on invalid input parameters
- added possibility to operate multiple objects
- added checking for too small values in BrepMesh algorithm
Affected Issues
0032279
mod - src/BRepMesh/BRepMesh_IncrementalMesh.hxx Diff File
mod - src/MeshTest/MeshTest.cxx Diff File
mod - src/Prs3d/Prs3d.hxx Diff File

Issue History

Date Modified Username Field Change
2021-04-02 19:16 kgv New Issue
2021-04-02 19:16 kgv Assigned To => abv
2021-04-02 19:17 kgv Assigned To abv => mkrylova
2021-04-02 19:17 kgv Status new => assigned
2021-05-18 12:10 kgv Description Updated
2021-05-18 17:59 mkrylova Note Added: 0101155
2021-05-19 13:40 git Note Added: 0101174
2021-05-19 13:41 mkrylova Assigned To mkrylova => kgv
2021-05-19 13:41 mkrylova Status assigned => resolved
2021-05-19 13:41 mkrylova Steps to Reproduce Updated
2021-05-19 14:53 kgv Note Added: 0101177
2021-05-19 14:53 kgv Assigned To kgv => mkrylova
2021-05-19 14:53 kgv Status resolved => assigned
2021-05-20 11:08 git Note Added: 0101196
2021-05-20 11:13 git Note Added: 0101197
2021-05-20 11:15 mkrylova Assigned To mkrylova => kgv
2021-05-20 11:15 mkrylova Status assigned => resolved
2021-05-20 11:16 mkrylova Note Added: 0101198
2021-05-20 12:03 kgv Assigned To kgv => mkrylova
2021-05-20 12:03 kgv Status resolved => assigned
2021-05-20 12:59 git Note Added: 0101201
2021-05-20 13:02 git Note Added: 0101202
2021-05-20 13:12 mkrylova Assigned To mkrylova => kgv
2021-05-20 13:12 mkrylova Status assigned => resolved
2021-05-20 13:55 kgv Assigned To kgv => mkrylova
2021-05-20 13:55 kgv Status resolved => assigned
2021-05-20 16:15 git Note Added: 0101213
2021-05-20 16:17 git Note Added: 0101214
2021-05-21 11:30 mkrylova Note Added: 0101228
2021-05-24 12:07 mkrylova Note Edited: 0101228
2021-05-24 17:50 git Note Added: 0101332
2021-05-24 17:51 git Note Added: 0101333
2021-05-24 18:42 mkrylova Note Added: 0101336
2021-05-25 18:34 mkrylova Note Added: 0101362
2021-05-25 18:34 mkrylova Assigned To mkrylova => kgv
2021-05-25 18:34 mkrylova Status assigned => resolved
2021-05-26 11:44 kgv Note Added: 0101381
2021-05-26 11:44 kgv Assigned To kgv => mkrylova
2021-05-26 11:44 kgv Status resolved => assigned
2021-05-27 11:27 mkrylova Note Added: 0101419
2021-05-27 17:45 kgv Note Added: 0101430
2021-05-28 14:22 git Note Added: 0101447
2021-05-28 14:23 git Note Added: 0101448
2021-05-28 16:28 kgv Note Added: 0101453
2021-05-28 16:28 kgv Assigned To mkrylova => bugmaster
2021-05-28 16:28 kgv Status assigned => resolved
2021-05-28 16:28 kgv Status resolved => reviewed
2021-05-28 18:15 mkrylova Note Added: 0101462
2021-05-29 12:03 bugmaster Note Added: 0101478
2021-05-29 12:03 bugmaster Status reviewed => tested
2021-05-29 12:09 bugmaster Test case number => Not required
2021-05-29 12:12 bugmaster Changeset attached => occt master 2315a044
2021-05-29 12:12 bugmaster Status tested => verified
2021-05-29 12:12 bugmaster Resolution open => fixed
2021-05-29 13:12 git Note Added: 0101487
2021-05-29 13:12 git Note Added: 0101488
2021-05-29 13:12 git Note Added: 0101489
2021-05-29 13:12 git Note Added: 0101490
2021-05-29 13:12 git Note Added: 0101491
2021-05-29 13:12 git Note Added: 0101492