MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0029769Community[OCCT] OCCT:Foundation Classespublic2018-05-14 23:012018-07-21 20:02
ReporterAaron Michalk 
Assigned Tobugmaster 
PrioritynormalSeveritycrash 
StatusverifiedResolutionfixed 
PlatformVC++ 2017 64 bitOSWindowsOS Version10
Product Version[OCCT] 7.2.0 
Target Version[OCCT] 7.4.0*Fixed in Version 
Summary0029769: Uninitialized data with BSplCLib_Cache, BSplSLib_Cache
DescriptionUsing malloc instead of calloc results in accessing invalid memory when evaluating spline cache. This is due to uninitialized data.
Steps To Reproduce1. Set MMGT_CLEAR to false (to use malloc instead of calloc in Standard.cxx).

Note that in default environment script env.bat by default sets MMGT_CLEAR to 1, thus it should be edited to set it to 0.

2. Exercise the spline evaluation caching, for instance, in DRAW run:

Draw[]> test demo samples cad
Additional information
and documentation updates
Copying the member variable initialization from the default constructor to the other constructors of BSplCLib_Cache, BSplSLib_Cache fixes the problem.
TagsNo tags attached.
Test case numberNot needed
Attached Filestxt file icon warnings.txt (31,909 bytes) 2018-07-18 19:14

- Relationships
related to 0024208closedapn Open CASCADE Optimization of the edge-edge and edge-face intersection algorithms 
child of 0028203newkgv Open CASCADE Coding rules - check testing with MMGT_CLEAR turned OFF 
child of 0024682closedbugmaster Open CASCADE Move out B-spline cache from curves and surfaces to dedicated classes BSplCLib_Cache and BSplSLib_Cache 

-  Notes
(0076725)
git (administrator)
2018-06-12 22:06

Branch CR29769 has been created by abv.

SHA-1: efbfdf32a21e07a8e5d1976b4645a423d4c75d42


Detailed log of new commits:

Author: abv
Date: Sun Jun 10 22:40:12 2018 +0300

    0029769: Uninitialized data with BSplCLib_Cache, BSplSLib_Cache
    
    Implementation of classes BSplCLib_Cache and BSplSLib_Cache is revised:
    - Common functionality dealing with spans along one parametric direction is separated to new struct BSplCLib_CacheParams
    - Empty constructors are removed; copying is prohibited
    - Code reconsidering degree and other parameters on each call to BuildCache() is eliminated; curve parameters must be the same in constructor and all calls to BuildCache()
    - Extra call to BuildCache() from constructor is eliminated
(0076756)
abv (manager)
2018-06-14 09:36

Fix is pushed to CR29769, please review.

Jenkins tests have passed, see job CR29769-master-abv. Note that there is apparently 30-50% performance improvement on tests bugs modalg_5 bug24208_*.
(0076758)
abv (manager)
2018-06-14 09:47

It should be noted that surprisingly implementation of similar methods BuildCache() in BSplSLib and BSplCLib uses different convention for definition of parametric range of the span and parameter within the span. In BSplCLib, span is defined by start parameter and span length, while in BSplSLib, it is defined by mid-parameter and half length. Local parameter is normalized to [0, 1] and [-1, 1], respectively. This perhaps should be revised for consistency.
(0076793)
abv (manager)
2018-06-14 22:18

Note that this fix does not make OCCT safe to use with MMGT_CLEAR=0; there are other places where uninitialized memory is used in such setting.
(0077585)
azv (developer)
2018-07-13 18:10

Reviewed.
(0077661)
bugmaster (administrator)
2018-07-16 13:47

Combination -
OCCT branch : CR29769 SHA - efbfdf32a21e07a8e5d1976b4645a423d4c75d42
Products branch : master SHA - 82570c1f4b0e27eb09789f573087eef089260f59
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:
Debian70-64:
OCCT
Total CPU difference: 16883.279999999726 / 17011.039999999866 [-0.75%]
Products
Total CPU difference: 7418.390000000034 / 7441.7800000000125 [-0.31%]
Windows-64-VC10:
OCCT
Total CPU difference: 16784.007189098527 / 16821.806231398525 [-0.22%]
Products
Total CPU difference: 8202.96938279988 / 8237.071201399893 [-0.41%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0077752)
bugmaster (administrator)
2018-07-17 18:24
edited on: 2018-07-18 19:15

See attached warnings.txt for new warnings

(0077760)
git (administrator)
2018-07-17 22:04

Branch CR29769_1 has been created by abv.

SHA-1: 85180789252059b3b2dc8dede60a072d2cdf671e


Detailed log of new commits:

Author: abv
Date: Sun Jun 10 22:40:12 2018 +0300

    0029769: Uninitialized data with BSplCLib_Cache, BSplSLib_Cache
    
    Implementation of classes BSplCLib_Cache and BSplSLib_Cache is revised:
    - Common functionality dealing with spans along one parametric direction is separated to new struct BSplCLib_CacheParams
    - Empty constructors are removed; copying is prohibited
    - Code reconsidering degree and other parameters on each call to BuildCache() is eliminated; curve parameters must be the same in constructor and all calls to BuildCache()
    - Extra call to BuildCache() from constructor is eliminated
(0077784)
abv (manager)
2018-07-18 15:14

Branch CR29769_1 eliminates compiler warnings and is on master; please consider
(0077880)
git (administrator)
2018-07-21 20:02

Branch CR29769_1 has been deleted by inv.

SHA-1: 85180789252059b3b2dc8dede60a072d2cdf671e
(0077892)
git (administrator)
2018-07-21 20:02

Branch CR29769 has been deleted by inv.

SHA-1: efbfdf32a21e07a8e5d1976b4645a423d4c75d42

- Related Changesets
occt: master 0a96e0bb
Timestamp: 2018-06-10 19:40:12
Author: abv
Committer: bugmaster
Details ] Diff ]
0029769: Uninitialized data with BSplCLib_Cache, BSplSLib_Cache

Implementation of classes BSplCLib_Cache and BSplSLib_Cache is revised:
- Common functionality dealing with spans along one parametric direction is separated to new struct BSplCLib_CacheParams
- Empty constructors are removed; copying is prohibited
- Code reconsidering degree and other parameters on each call to BuildCache() is eliminated; curve parameters must be the same in constructor and all calls to BuildCache()
- Extra call to BuildCache() from constructor is eliminated
mod - src/BSplCLib/BSplCLib_Cache.cxx Diff ] File ]
mod - src/BSplCLib/BSplCLib_Cache.hxx Diff ] File ]
add - src/BSplCLib/BSplCLib_CacheParams.hxx Diff ] File ]
mod - src/BSplCLib/FILES Diff ] File ]
mod - src/BSplSLib/BSplSLib_Cache.cxx Diff ] File ]
mod - src/BSplSLib/BSplSLib_Cache.hxx Diff ] File ]
mod - src/Geom2dAdaptor/Geom2dAdaptor_Curve.cxx Diff ] File ]
mod - src/GeomAdaptor/GeomAdaptor_Curve.cxx Diff ] File ]
mod - src/GeomAdaptor/GeomAdaptor_Surface.cxx Diff ] File ]

- Issue History
Date Modified Username Field Change
2018-05-14 23:01 Aaron Michalk New Issue
2018-05-14 23:01 Aaron Michalk Assigned To => abv
2018-06-05 16:59 abv Target Version => 7.4.0*
2018-06-12 22:06 git Note Added: 0076725
2018-06-13 10:11 kgv Relationship added child of 0028203
2018-06-14 09:36 abv Note Added: 0076756
2018-06-14 09:36 abv Status new => resolved
2018-06-14 09:36 abv Assigned To abv => azv
2018-06-14 09:36 abv Relationship added related to 0024208
2018-06-14 09:37 abv Relationship added child of 0024682
2018-06-14 09:47 abv Note Added: 0076758
2018-06-14 22:18 abv Note Added: 0076793
2018-06-14 22:18 abv Steps to Reproduce Updated View Revisions
2018-07-13 18:10 azv Note Added: 0077585
2018-07-13 18:10 azv Assigned To azv => bugmaster
2018-07-13 18:10 azv Status resolved => reviewed
2018-07-16 13:47 bugmaster Note Added: 0077661
2018-07-16 13:47 bugmaster Status reviewed => tested
2018-07-16 13:51 bugmaster Test case number => Not needed
2018-07-17 18:24 bugmaster Note Added: 0077752
2018-07-17 18:24 bugmaster Assigned To bugmaster => abv
2018-07-17 18:24 bugmaster Status tested => assigned
2018-07-17 22:04 git Note Added: 0077760
2018-07-18 15:14 abv Note Added: 0077784
2018-07-18 15:14 abv Assigned To abv => bugmaster
2018-07-18 15:14 abv Status assigned => feedback
2018-07-18 19:14 bugmaster File Added: warnings.txt
2018-07-18 19:15 bugmaster Note Edited: 0077752 View Revisions
2018-07-21 18:39 bugmaster Changeset attached => occt master 0a96e0bb
2018-07-21 18:39 bugmaster Status feedback => verified
2018-07-21 18:39 bugmaster Resolution open => fixed
2018-07-21 20:02 git Note Added: 0077880
2018-07-21 20:02 git Note Added: 0077892


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker