View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0025717 | Community | OCCT:Foundation Classes | public | 2015-01-17 10:08 | 2015-05-14 15:32 |
Reporter | Roman Lygin | Assigned To | bugmaster | ||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Product Version | 6.8.0 | ||||
Target Version | 6.9.0 | Fixed in Version | 6.9.0 | ||
Summary | 0025717: Non reentrant (and hence non-thread-safe) math_RealRandom / _IntegerRandom | ||||
Description | math_*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 Reproduce | N/A | ||||
Additional information and documentation updates | _RealRandom and _IntegerRandom are going to be created as instantiation of common template class | ||||
Tags | No tags attached. | ||||
Test case number | Not needed | ||||
|
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 |
|
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. |
|
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 |
|
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. |
|
Branch CR25717_1 has been updated forcibly by aml. SHA-1: 247fbed91f08f5c78250d044d024e669c7785a82 |
|
Minor corrections has been added. Reviewed. Please test. |
|
Branch CR25717_1 has been updated forcibly by apv. SHA-1: 8f47864dfc2bc40f71dd8a6b62bec835fb1de2e4 |
|
Branch CR25717_1 has been rebased on the current master |
|
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 |
|
Branch CR25717 has been deleted by inv. SHA-1: 69dd7501d908f1872353fdf4907763bbc1476b32 |
|
Branch CR25717_1 has been deleted by inv. SHA-1: 8f47864dfc2bc40f71dd8a6b62bec835fb1de2e4 |
occt: master fd3ba7a1 2015-01-18 14:08:40
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. |
Affected Issues 0025717 |
|
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 |
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 | |
2015-01-18 21:29 |
|
Note Added: 0036179 | |
2015-01-18 21:30 | git | Note Added: 0036180 | |
2015-01-18 21:31 |
|
Note Added: 0036181 | |
2015-01-18 21:31 |
|
Assigned To | abv => aml |
2015-01-19 08:19 | git | Note Added: 0036185 | |
2015-01-19 08:22 |
|
Note Added: 0036186 | |
2015-01-19 08:22 |
|
Assigned To | aml => bugmaster |
2015-01-19 08:22 |
|
Status | resolved => reviewed |
2015-01-23 16:28 |
|
Assigned To | bugmaster => apv |
2015-01-23 19:12 | git | Note Added: 0036480 | |
2015-01-23 19:12 |
|
Note Added: 0036481 | |
2015-01-29 13:29 |
|
Test case number | => Not needed |
2015-01-29 13:30 |
|
Note Added: 0036811 | |
2015-01-29 13:30 |
|
Assigned To | apv => bugmaster |
2015-01-29 13:30 |
|
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 |
|
Status | verified => closed |
2015-05-14 15:32 |
|
Fixed in Version | => 6.9.0 |