DiscussionsIssue archiveOCCT:Modeling Data

Archived issue #0031349

Modeling Data - GC_MakeSegment causes reading from NULL when start point and end point are identical

CommunityOCCT:Modeling Datanew1 public note

Search issues

Description

In OCCT 7.4.0, when start point and end point are identical, the constructor of GC_MakeSegment tries to read at address NULL and causes an access violation.

Steps to reproduce

pload MODELING
point p0 0 0 0
point p1 1 0 0
gcarc s1 seg p0 p1 # OK
gcarc s0 seg p0 p0 # KO


** Exception ** [revision removed] : StdFail_NotDone: GC_MakeLine::Value() - no result



Compile and run the following code:
    gp_Pnt ps;
    GC_MakeSegment make_segment(ps, ps);

Public activity

1 archived note

Participants are labeled by their role within this record.

01Commenter 1
The current design of GC tools is throwing an exception only in Debug builds - so that it is expected that application will NEVER pass invalid input to these tools (e.g. pre-validate input):
  StdFail_NotDone_Raise_if (TheError != gce_Done,
                            "GC_MakeArcOfHyperbola::Value() - no result");


So the current behavior - is by design.
It might be reconsidered to throw exception in Release builds (shouldn't harm performance, I think).