View Issue Details

IDProjectCategoryView StatusLast Update
0024072CommunityOCCT:Foundation Classespublic2013-12-19 13:56
Reporterapn Assigned ToRoman Lygin  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2008 
Target Version6.7.0Fixed in Version6.7.0 
Summary0024072: VC9 64-bit compiler crashes while compiling IntPoly_ShapeSection.cxx
DescriptionCompilation is broken by MSVC++ 9.0 (MSVC 2008) in 64-bit mode while compiling IntPoly_ShapeSection.cxx
TagsNo tags attached.
Test case numberNot needed

Relationships

has duplicate 0024071 closedabv Open CASCADE VC 2009 64-bit compiler crashes while compiling IntPoly_ShapeSection.cxx 
has duplicate 0024063 closedbugmaster Community LNK1136: invalid or corrupt file - when compiling OCCT 
related to 0024042 closedapn Community Performance improvements: Foundation Classes 

Activities

Roman Lygin

2013-07-14 23:02

developer   ~0025057

After a few hours of root-causing I have isolated the issue to a single line of code in Intpoly_ShapeSection::Explore()

    gp_Vec OA1(A1.XYZ());

which can be fixed as follows:
    gp_Vec OA1(A1.X(), A1.Y(), A2.Z());

This is a compiler (optimizer) bug.
The fix is in progress and will be committed soon.

Roman Lygin

2013-07-16 21:43

developer   ~0025087

The fix for IntPoly_ShapeSection.cxx has been pushed.

In addition to that, I have withdrawn part of the 0024042 to make more conservative inlining:
- rolled back Array2 constructor, destructor and Init()
- rolled back Array1::Init(); in Array1 constructor removed check for the memory allocation - it adds extra check/branching although failed allocation will likely lead to prompt crash downstream anyway.

I have not checked if rolling back part of TCollection would be enough to get the IntPoly stuff compile, instead I decided to please the compiler and modify IntPoly anyway.

Roman Lygin

2013-07-16 21:49

developer   ~0025088

Fix for 0024072 partially rolls back modifications made in TCollection to be more conservative.
Note for the future: however, if some workloads demonstrate that inlining Array2 helps performance without inflating the code size then constructor/destructor can be inlined again.

kgv

2013-07-17 11:55

developer   ~0025096

Patch has been reviewed without remarks, please test it.

> although failed allocation will likely lead to prompt crash downstream anyway.
There is more dangerous issue caused by possible (and really happens sometime) integer overflow in 2D arrays allocations (#0023419).

mkv

2013-07-18 10:44

tester   ~0025105

Dear BugMaster,

Branch CR24072 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
SHA-1: 679982ac8785aa3af790c39f889ee8e195992e42

Number of compiler warnings:

occt component :
Linux: 2 (2 on master)
Windows: 1767 (1767 on master)

products component :
Linux: 0 (0 on master)
Windows: 288 (288 on master)

Regressions:
No regressions

Improvements:
No improvements

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 354072032 / 437089504
Total CPU difference: 37331.0400000006 / 130368.84999999979

Testing on Windows:
Total MEMORY difference: 424000716 / 426150756
Total CPU difference: 33234.984375 / 31424.96875

There are not differences in images found by testdiff.

apn

2013-07-18 10:46

administrator   ~0025106

CR24072 was successfully compiled on Windows vc9 x64 Release. There are no compile errors.

Roman Lygin

2013-08-05 17:22

developer   ~0025236

Minor comment. Of course, the code change to work-around compiler bug was
- gp_Vec OA1(A1.XYZ());
+ gp_Vec OA1(A1.X(), A1.Y(), A1.Z());

i.e. A1.Z() not A2.Z() as given the above note, that was a simple typo. Sorry for any possible confusion.

Related Changesets

occt: master efef9da8

2013-07-16 17:33:29

Roman Lygin

Details Diff
0024072: VC 2009 64-bit compiler crashes while compiling IntPoly_ShapeSection.cxx Affected Issues
0024072
mod - src/IntPoly/IntPoly_ShapeSection.cxx Diff File
mod - src/TCollection/TCollection_Array1.cdl Diff File
mod - src/TCollection/TCollection_Array1.gxx Diff File
mod - src/TCollection/TCollection_Array1.lxx Diff File
mod - src/TCollection/TCollection_Array2.cdl Diff File
mod - src/TCollection/TCollection_Array2.gxx Diff File
mod - src/TCollection/TCollection_Array2.lxx Diff File

Issue History

Date Modified Username Field Change
2013-07-12 16:30 apn New Issue
2013-07-12 16:30 apn Assigned To => Roman Lygin
2013-07-12 16:31 apn Relationship added has duplicate 0024071
2013-07-12 16:31 Pawel Relationship added has duplicate 0024063
2013-07-12 16:33 apn Status new => assigned
2013-07-12 16:36 apn Relationship added related to 0024042
2013-07-14 23:02 Roman Lygin Note Added: 0025057
2013-07-16 21:43 Roman Lygin Note Added: 0025087
2013-07-16 21:43 Roman Lygin Assigned To Roman Lygin => abv
2013-07-16 21:43 Roman Lygin Status assigned => resolved
2013-07-16 21:49 Roman Lygin Note Added: 0025088
2013-07-17 09:54 apn Assigned To abv => kgv
2013-07-17 11:55 kgv Note Added: 0025096
2013-07-17 11:55 kgv Assigned To kgv => bugmaster
2013-07-17 11:55 kgv Status resolved => reviewed
2013-07-17 11:55 kgv Product Version 6.6.0 =>
2013-07-17 11:55 kgv Summary VC 2009 64-bit compiler crashes while compiling IntPoly_ShapeSection.cxx => VC9 64-bit compiler crashes while compiling IntPoly_ShapeSection.cxx
2013-07-17 11:58 mkv Assigned To bugmaster => mkv
2013-07-18 10:44 mkv Note Added: 0025105
2013-07-18 10:46 apn Note Added: 0025106
2013-07-18 10:46 apn Test case number => Not needed
2013-07-18 10:46 apn Assigned To mkv => bugmaster
2013-07-18 10:46 apn Status reviewed => tested
2013-07-19 13:33 Roman Lygin Changeset attached => occt master efef9da8
2013-07-19 13:33 Roman Lygin Assigned To bugmaster => Roman Lygin
2013-07-19 13:33 Roman Lygin Status tested => verified
2013-07-19 13:33 Roman Lygin Resolution open => fixed
2013-08-05 17:22 Roman Lygin Note Added: 0025236
2013-12-19 13:52 bugmaster Status verified => closed
2013-12-19 13:56 bugmaster Fixed in Version => 6.7.0