MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0025717Community[OCCT] OCCT:Foundation Classespublic2015-01-17 10:082015-05-14 15:32
ReporterRoman Lygin 
Assigned Tobugmaster 
PrioritynormalSeverityminor 
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version[OCCT] 6.8.0 
Target Version[OCCT] 6.9.0Fixed in Version[OCCT] 6.9.0 
Summary0025717: Non reentrant (and hence non-thread-safe) math_RealRandom / _IntegerRandom
Descriptionmath_*Random uses a function Random2() declared in math_Recipes.hxx. Random2 uses static array and index into that array.

math_RealRandom is used by BRepClass3d_SClassifier which is used by Shape Healing and reinitializes the static arrays over and over again.

The fix will move the above array into a member field.
Steps To ReproduceN/A
Additional information
and documentation updates
_RealRandom and _IntegerRandom are going to be created as instantiation of common template class
TagsNo tags attached.
Test case numberNot needed
Attached Files

- Relationships

-  Notes
(0036176)
git (administrator)
2015-01-17 18:11

Branch CR25717 has been created by Roman Lygin.

SHA-1: 69dd7501d908f1872353fdf4907763bbc1476b32


Detailed log of new commits:

Author: Roman Lygin
Date: Sat Jan 17 18:10:18 2015 +0400

    0025717: Non reentrant (and hence non-thread-safe) math_RealRandom / _IntegerRandom
(0036179)
abv (manager)
2015-01-18 21:29

Class IntegerRandom is never used in OCCT thus I believe it can be safely removed, then there is no need in template and we could keep single class RealRandom to contain all the code. Furthermore, RealRandom is used in single place in OCCT, BRepClass3d_SClassifier, and this place supposedly does not require high-quality random numbers (it is just probing points on faces). Hence we can use simple random generator here, such as class added recently in math package, BullardGenerator. In applications requiring high-quality randoms, it is better to use STL generators provided by <random> in C++11, such as mt19937.
(0036180)
git (administrator)
2015-01-18 21:30

Branch CR25717_1 has been created by abv.

SHA-1: 291ff23ab58076e885a17adbcc1f87982fb2c744


Detailed log of new commits:

Author: abv
Date: Sun Jan 18 17:08:40 2015 +0300

    0025717: Non reentrant (and hence non-thread-safe) math_RealRandom / _IntegerRandom
    
    Classes math_IntegerRandom and math_RealRandom, and method Random2 in math_Recipes, removed. Class math_BullardGenerator is used instead
(0036181)
abv (manager)
2015-01-18 21:31

I propose alternative patch in branch CR25717_1, where old random generator from math_Recipes is removed and math_BullardGenerator is used instead of it in BRepClass3d_SClassifier. Please review.
(0036185)
git (administrator)
2015-01-19 08:19

Branch CR25717_1 has been updated forcibly by aml.

SHA-1: 247fbed91f08f5c78250d044d024e669c7785a82
(0036186)
aml (developer)
2015-01-19 08:22

Minor corrections has been added.

Reviewed. Please test.
(0036480)
git (administrator)
2015-01-23 19:12

Branch CR25717_1 has been updated forcibly by apv.

SHA-1: 8f47864dfc2bc40f71dd8a6b62bec835fb1de2e4
(0036481)
apv (tester)
2015-01-23 19:12

Branch CR25717_1 has been rebased on the current master
(0036811)
apv (tester)
2015-01-29 13:30

Dear BugMaster,

Branch CR25717_1 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
SHA-1: 8f47864dfc2bc40f71dd8a6b62bec835fb1de2e4

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:
Not detected

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 369400184 / 370114884
Total CPU difference: 53026.35000000031 / 51750.710000000094

Testing on Windows:
Total MEMORY difference: 275891060 / 275769192
Total CPU difference: 34125.078125 / 38148.296875
(0038561)
git (administrator)
2015-03-18 13:36

Branch CR25717 has been deleted by inv.

SHA-1: 69dd7501d908f1872353fdf4907763bbc1476b32
(0038562)
git (administrator)
2015-03-18 13:36

Branch CR25717_1 has been deleted by inv.

SHA-1: 8f47864dfc2bc40f71dd8a6b62bec835fb1de2e4

- Related Changesets
occt: master fd3ba7a1
Timestamp: 2015-01-18 14:08:40
Author: abv
Committer: bugmaster
Details ] Diff ]
0025717: Non reentrant (and hence non-thread-safe) math_RealRandom / _IntegerRandom

Classes math_IntegerRandom and math_RealRandom, and method Random2 in math_Recipes, removed. Class math_BullardGenerator is used instead.
mod - src/BRepClass3d/BRepClass3d_SClassifier.cxx Diff ] File ]
mod - src/math/math.cdl Diff ] File ]
rm - src/math/math_IntegerRandom.cdl Diff ] File ]
rm - src/math/math_IntegerRandom.cxx Diff ] File ]
rm - src/math/math_RealRandom.cdl Diff ] File ]
rm - src/math/math_RealRandom.cxx Diff ] File ]
mod - src/math/math_Recipes.cxx Diff ] File ]
mod - src/math/math_Recipes.hxx Diff ] File ]

- Issue History
Date Modified Username Field Change
2015-01-17 10:08 Roman Lygin New Issue
2015-01-17 10:08 Roman Lygin Assigned To => abv
2015-01-17 18:11 git Note Added: 0036176
2015-01-17 18:11 Roman Lygin Status new => resolved
2015-01-17 18:11 Roman Lygin Steps to Reproduce Updated View Revisions
2015-01-18 21:29 abv Note Added: 0036179
2015-01-18 21:30 git Note Added: 0036180
2015-01-18 21:31 abv Note Added: 0036181
2015-01-18 21:31 abv Assigned To abv => aml
2015-01-19 08:19 git Note Added: 0036185
2015-01-19 08:22 aml Note Added: 0036186
2015-01-19 08:22 aml Assigned To aml => bugmaster
2015-01-19 08:22 aml Status resolved => reviewed
2015-01-23 16:28 apv Assigned To bugmaster => apv
2015-01-23 19:12 git Note Added: 0036480
2015-01-23 19:12 apv Note Added: 0036481
2015-01-29 13:29 apv Test case number => Not needed
2015-01-29 13:30 apv Note Added: 0036811
2015-01-29 13:30 apv Assigned To apv => bugmaster
2015-01-29 13:30 apv Status reviewed => tested
2015-01-30 14:00 bugmaster Changeset attached => occt master fd3ba7a1
2015-01-30 14:00 bugmaster Status tested => verified
2015-01-30 14:00 bugmaster Resolution open => fixed
2015-03-18 13:36 git Note Added: 0038561
2015-03-18 13:36 git Note Added: 0038562
2015-05-14 15:29 user533 Status verified => closed
2015-05-14 15:32 user533 Fixed in Version => 6.9.0


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker