DiscussionsIssue archiveOCCT:Data Exchange

Archived issue #0025689

IGESCAFControl_Writer crash in constructor.

CommunityOCCT:Data Exchangeclosed8 public notes

Search issues

Description

TKIGES.dll!IGESData_GlobalSection::IGESData_GlobalSection(const IGESData_GlobalSection & __that) C++
> TKIGES.dll!IGESData_BasicEditor::SetUnitName(const char * const name) Line 99 C++
     TKIGES.dll!IGESControl_Writer::IGESControl_Writer() Line 57 C++
     TKXDEIGES.dll!IGESCAFControl_Writer::IGESCAFControl_Writer() Line 112 C++

Steps to reproduce

Standard_Boolean IGESData_BasicEditor::SetUnitName (const Standard_CString name)
{
  Standard_Integer flag = IGESData_BasicEditor::UnitNameFlag (name);
  IGESData_GlobalSection GS = themodel->GlobalSection(); //[BUG]themodel is NULL.
  ...
}


//---------------------------------------
It is impossible to create test script as far as the crash can be provided only in clear application. There is attached the .bat script which compiles, build and run the small application.
If the application was run without exceptions - the crash is fixed.
(To use the .bat file, you should have MS Windows and Visual Studio 10.
Please, correct the products path and OCCT path in the script.)

Public activity

8 archived notes

Participants are labeled by their role within this record.

01Commenter 1
Could you please provide us example to reproduce crash or you can analyze cause of the crash and will give us fix for such cases.
02Author
If i call "IGESControl_Controller::Init()" before IGESCAFControl_Writer, the crash won't occur. This might be helpful for bug fix.

My code is simple, i just construct a IGESCAFControl_Writer object and it crash.
03Commenter 2
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: akz
Date: Mon Jan 26 19:12:41 2015 +0300

    0025689: IGESCAFControl_Writer crash in constructor.
    
    Cause of bug is that the IGESData_BasicEditor is created before an initialization of IGESControl_Controller::Init(). IGESData_BasicEditor cannot find template "iges", so the model is still empty after creation.
    
    1) Added a default constructor to the IGESData_BasicEditor. Can be initialized via Init() method.
    2) Added some null checks in the places, where are provided access to the model (IGESData_BasicEditor's member).
    3) Initialization of the IGESData_BasicEditor was placed after initialization if the IGESControl_Controller.
04Commenter 4
The branch CR25689 is ready to be reviewed.
05Commenter 5
Branch CR25689 is ready to be tested

06Commenter 2
Branch [archived branch] has been updated forcibly by Commenter 3.

[revision removed]
07Commenter 3
Dear Commenter 1,
Branch CR25689 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested in Release mode.
[revision removed]

Number of compiler warnings:

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

products component :
Linux: 11 (11 on master)
Windows: 1 (1 on master)

Regressions/Differences:
No regressions

Testing cases:
Attachment 1 (BAT) was run without exceptions - the crash is fixed.

Testing on Linux:
Total MEMORY difference: 369299968 / 370114884
Total CPU difference: 53641.909999999894 / 51750.710000000094

Testing on Windows:
Total MEMORY difference: 276006756 / 275761696
Total CPU difference: 37432.03125 / 38148.203125

There are not differences in images found by testdiff.
08Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]

Related records