MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0025938Community[OCCT] OCCT:Modeling Algorithmspublic2015-03-14 20:162015-05-14 16:31
ReporterIstvan Csanady 
Assigned Tobugmaster 
PrioritynormalSeverityminor 
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Version[OCCT] 6.9.0Fixed in Version[OCCT] 6.9.0 
Summary0025938: BRepBuilderAPI_Transform is not thread safe
DescriptionThe 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.
Steps To ReproduceNot needed
TagsNo tags attached.
Test case numberNot needed
Attached Files

- Relationships

-  Notes
(0038367)
Istvan Csanady (developer)
2015-03-14 20:17

Wrong title: it should be: BRepBuilderAPI_Transform is not thread safe.
(0038370)
msv (developer)
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 (manager)
2015-03-15 21:15

I suggest simpler fix: make ModifiedShape() method to return shape by value, not by reference
(0038376)
msv (developer)
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 (administrator)
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 (developer)
2015-04-10 15:44

Please test CR25938.
(0039600)
git (administrator)
2015-04-10 17:23

Branch CR25938 has been updated forcibly by apv.

SHA-1: b6c62b2e055d02bff65ab2ba14dff30c1d0049c9
(0039601)
apv (tester)
2015-04-10 17:24

Branch CR25938 has been rebased on the current master
(0039645)
apv (tester)
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 (administrator)
2015-05-14 16:31

Branch CR25938 has been deleted by inv.

SHA-1: b6c62b2e055d02bff65ab2ba14dff30c1d0049c9

- Related Changesets
occt: master 346cf025
Timestamp: 2015-04-10 12:43:21
Author: msv
Committer: bugmaster
Details ] Diff ]
0025938: BRepBuilderAPI_Transform is not thread safe

ModifiedShape() method is made returning shape by value, not by reference.
mod - src/BRepBuilderAPI/BRepBuilderAPI_GTransform.cdl Diff ] File ]
mod - src/BRepBuilderAPI/BRepBuilderAPI_GTransform.cxx Diff ] File ]
mod - src/BRepBuilderAPI/BRepBuilderAPI_ModifyShape.cdl Diff ] File ]
mod - src/BRepBuilderAPI/BRepBuilderAPI_ModifyShape.cxx Diff ] File ]
mod - src/BRepBuilderAPI/BRepBuilderAPI_Transform.cdl Diff ] File ]
mod - src/BRepBuilderAPI/BRepBuilderAPI_Transform.cxx Diff ] File ]
mod - src/QABugs/QABugs_19.cxx Diff ] File ]
mod - src/TNaming/TNaming.cxx Diff ] File ]

- Issue History
Date Modified Username Field Change
2015-03-14 20:16 Istvan Csanady New Issue
2015-03-14 20:16 Istvan Csanady Assigned To => msv
2015-03-14 20:17 Istvan Csanady Note Added: 0038367
2015-03-14 20:37 msv Summary BRepBuilderAPI_Transform is using unnecessary static variables => BRepBuilderAPI_Transform is not thread safe
2015-03-14 21:05 msv Note Added: 0038370
2015-03-14 21:05 msv Assigned To msv => abv
2015-03-14 21:05 msv Status new => feedback
2015-03-15 21:15 abv Note Added: 0038374
2015-03-15 21:15 abv Assigned To abv => msv
2015-03-15 23:08 msv Note Added: 0038376
2015-03-15 23:08 msv Assigned To msv => abv
2015-04-10 15:43 git Note Added: 0039586
2015-04-10 15:44 msv Assigned To abv => msv
2015-04-10 15:44 msv Status feedback => resolved
2015-04-10 15:44 msv Steps to Reproduce Updated View Revisions
2015-04-10 15:44 msv Note Added: 0039587
2015-04-10 15:44 msv Assigned To msv => bugmaster
2015-04-10 15:44 msv Status resolved => reviewed
2015-04-10 15:50 mkv Assigned To bugmaster => apv
2015-04-10 17:23 git Note Added: 0039600
2015-04-10 17:24 apv Note Added: 0039601
2015-04-13 17:29 apv Test case number => Not needed
2015-04-13 17:31 apv Note Added: 0039645
2015-04-13 17:31 apv Assigned To apv => bugmaster
2015-04-13 17:31 apv Status reviewed => tested
2015-04-17 15:40 bugmaster Changeset attached => occt master 346cf025
2015-04-17 15:40 bugmaster Status tested => verified
2015-04-17 15:40 bugmaster Resolution open => fixed
2015-05-14 15:28 user533 Status verified => closed
2015-05-14 15:31 user533 Fixed in Version => 6.9.0
2015-05-14 16:31 git Note Added: 0041031


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker