DiscussionsIssue archiveOCCT:Data Exchange

Archived issue #0024383

Access violation during STEP file import

CommunityOCCT:Data Exchangeclosed7 public notes

Search issues

Description

The constructor for gp_Dir throws in the constructor, resulting in a corrupted heap. The access violation occurs after the transfer is complete and the objects are being freed from memory.

The constructor is called by StepToGeom_MakeLine::Convert(const Handle(StepGeom_Line)& SC, Handle(GeomLine)& CC) at line 49 of the file StepToGeom_MakeLine.cxx.

Steps to reproduce

Load the file using STEPCAFControl_Reader::Read() then STEPCAFControl_Reader::Transfer(Handle_TDocStd_Document doc).

Public activity

7 archived notes

Participants are labeled by their role within this record.

01Commenter 1
Note that the file contains corrupted data: some points used in definition of B-Spline curves have coordinates out of reasonable domain. For instance, here is excerpt containing point #76964 (with two 'normal' neighbors):

#76963=CARTESIAN_POINT('',(-4.83182210693315,-13.5595372826271,-99.3028366263764));
#76964=CARTESIAN_POINT('',(-30313711.4733752,-30313720.2010904,-30313805.9443898));
#76965=CARTESIAN_POINT('',(-4.83182395018699,-13.5595368160101,-99.3028362962861));

That point is located 50 km far from the shape whose size is 17 mm... Needless to say that this shape is invalid, and numeric problems can be encountered while working with it.

As for exception, I have not encountered it (working with DRAW, vc10 64-bit mode, Release)

02Commenter 2
Exception "Standard_ConstructionError" is raised in debug mode during translation of face #9869
This face based of surface of revolution refers to vector with null magnitude:
 
#9869 = ADVANCED_FACE('',(#12612),#1048,.T.);
#1048 = SURFACE_OF_REVOLUTION('',#5380,#1128);
#5380 = LINE('',#61843,#7414);
#7414=VECTOR('',#50042,0.);

Protection for this case will be added.
03Commenter 3
Branch CR24383 is ready to be reviewed.
04Commenter 4
Dear Commenter 1,

Branch CR24383 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
[revision removed]

Number of compiler warnings:

occt component :
Linux: 320 (320 on master)
Windows: 0 (0 on master)

products component :
Linux: 188 (188 on master)
Windows: 286 (286 on master)

Regressions/Differences:
No regressions/differences

Testing cases:
http://occt-tests/CR24383-master-occt/Debian60-64/bugs/step/bug24383.html
http://occt-tests/CR24383-master-occt/Windows-32-VC9/bugs/step/bug24383.html
bugs step(014) bug24383: OK

Testing on Linux:
Total MEMORY difference: 358545040 / 358567412
Total CPU difference: 44203.56000000015 / 43977.750000000386

Testing on Windows:
Total MEMORY difference: 412572588 / 412755496
Total CPU difference: 33564.796875 / 32189.921875

There are not differences in images found by testdiff.
05Commenter 5
Dear gka,
could you please validate test case bugs/step(014)/bug24383
06Commenter 6
This test should be checked only in Debug mode.
07Commenter 2
Branch CR24383 (and products from GIT master) was compiled on Linux and Windows platforms (vc9 win32 Debug) and tested.

Regressions/Differences:
No regressions/differences

Testing cases:
bugs step bug24383 - OK
http://jenkins-test-02.nnov.opencascade.com:8080/job/mnt-CR24383-master_occt_tests_linux_start_deb/label=Debian60-64,tests_group=bugs,tests_subgroup=014/4/HTML_Report/?
http://jenkins-test-02.nnov.opencascade.com:8080/job/mnt-CR24383-master_occt_tests_windows_start_deb/label=windows_test,tests_group=bugs,tests_subgroup=014/4/HTML_Report/?

Also branch was compiled with vc10 win64 Debug (as in issue description). Test case is OK.