MantisBT - Community
View Issue Details
0025938Community[OCCT] OCCT:Modeling Algorithmspublic2015-03-14 20:162015-05-14 16:31
Istvan Csanady 
bugmaster 
normalminor 
closedfixed 
 
[OCCT] 6.9.0[OCCT] 6.9.0 
Not needed
0025938: BRepBuilderAPI_Transform is not thread safe
The ModifiedShape method uses a static variable to return a reference to a shape, this makes it not thread safe. The quick (and dirty) fix is to create a mutable myModified member, and use it instead of the static SM variable, but I could not figure out, how to make a member variable mutable in CDL, this is why I did not provide a patch.
Not needed
No tags attached.
Issue History
2015-03-14 20:16Istvan CsanadyNew Issue
2015-03-14 20:16Istvan CsanadyAssigned To => msv
2015-03-14 20:17Istvan CsanadyNote Added: 0038367
2015-03-14 20:37msvSummaryBRepBuilderAPI_Transform is using unnecessary static variables => BRepBuilderAPI_Transform is not thread safe
2015-03-14 21:05msvNote Added: 0038370
2015-03-14 21:05msvAssigned Tomsv => abv
2015-03-14 21:05msvStatusnew => feedback
2015-03-15 21:15abvNote Added: 0038374
2015-03-15 21:15abvAssigned Toabv => msv
2015-03-15 23:08msvNote Added: 0038376
2015-03-15 23:08msvAssigned Tomsv => abv
2015-04-10 15:43gitNote Added: 0039586
2015-04-10 15:44msvAssigned Toabv => msv
2015-04-10 15:44msvStatusfeedback => resolved
2015-04-10 15:44msvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9921#r9921
2015-04-10 15:44msvNote Added: 0039587
2015-04-10 15:44msvAssigned Tomsv => bugmaster
2015-04-10 15:44msvStatusresolved => reviewed
2015-04-10 15:50mkvAssigned Tobugmaster => apv
2015-04-10 17:23gitNote Added: 0039600
2015-04-10 17:24apvNote Added: 0039601
2015-04-13 17:29apvTest case number => Not needed
2015-04-13 17:31apvNote Added: 0039645
2015-04-13 17:31apvAssigned Toapv => bugmaster
2015-04-13 17:31apvStatusreviewed => tested
2015-04-17 15:40bugmasterChangeset attached => occt master 346cf025
2015-04-17 15:40bugmasterStatustested => verified
2015-04-17 15:40bugmasterResolutionopen => fixed
2015-05-14 15:28aivStatusverified => closed
2015-05-14 15:31aivFixed in Version => 6.9.0
2015-05-14 16:31gitNote Added: 0041031

Notes
(0038367)
Istvan Csanady   
2015-03-14 20:17   
Wrong title: it should be: BRepBuilderAPI_Transform is not thread safe.
(0038370)
msv   
2015-03-14 21:05   
It is not correct to use one shape myModified to return on each request via ModifiedShape(). It can lead to unexpected behavior for the caller, as the shape returned earlier by ModifiedShape changes after the next call to this method with another argument. Of course, this was always incorrect, but if we are to change this source code we can make it perfect.
The most safe way is to add the DataMap as the field of the class, and each time ModifiedShape is called to use this map as a cache.
Andrey, do you agree with my proposal?
(0038374)
abv   
2015-03-15 21:15   
I suggest simpler fix: make ModifiedShape() method to return shape by value, not by reference
(0038376)
msv   
2015-03-15 23:08   
I am afraid if we make the method return shape by value it may require modification a ton of code that declares a local const reference to the returned by this method shape.
(0039586)
git   
2015-04-10 15:43   
Branch CR25938 has been created by msv.

SHA-1: a6c42e4ab76c78e702e04dc2386c6da027835047


Detailed log of new commits:

Author: msv
Date: Fri Apr 10 15:43:21 2015 +0300

    0025938: BRepBuilderAPI_Transform is not thread safe
    
    ModifiedShape() method is made returning shape by value, not by reference.
(0039587)
msv   
2015-04-10 15:44   
Please test CR25938.
(0039600)
git   
2015-04-10 17:23   
Branch CR25938 has been updated forcibly by apv.

SHA-1: b6c62b2e055d02bff65ab2ba14dff30c1d0049c9
(0039601)
apv   
2015-04-10 17:24   
Branch CR25938 has been rebased on the current master
(0039645)
apv   
2015-04-13 17:31   
Dear BugMaster,

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

Number of compiler warnings:
occt component:
   Linux: 18 (18 on master)
   Windows: 0 (0 on master)
products component:
   Linux: 4 (4 on master)
   Windows: 0 (0 on master)

Regressions/Differences:
Not detected

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 94092230 / 94337269 [-0.26%]
Total CPU difference: 50763.299999999144 / 56193.089999999705 [-9.66%]

Testing on Windows:
Total MEMORY difference: 57129863 / 57127628 [+0.00%]
Total CPU difference: 16015.686663999033 / 15976.577213298899 [+0.24%]
(0041031)
git   
2015-05-14 16:31   
Branch CR25938 has been deleted by inv.

SHA-1: b6c62b2e055d02bff65ab2ba14dff30c1d0049c9