MantisBT - Community
View Issue Details
0023920Community[OCCT] OCCT:Foundation Classespublic2013-04-21 09:252015-09-05 16:34
Roman Lygin 
Roman Lygin 
normalminor 
closedfixed 
ALL
[OCCT] 6.6.0 
[OCCT] 6.7.0[OCCT] 6.7.0 
Not needed
0023920: Change use of static variables in Message package to prevent data races in Shape Healing
Message_MsgFile.cxx uses static variables to create messages for undefined keywords. When running Shape Healing concurrently this leads to data races when the message files have not been loaded upfront (e.g. due to failure to set environment variables CSF_SHMessage in end-user environment).

To minimize risk of data races when running Shape Healing concurrently, the fix suggests setting the static variables for error messages only once. This gives a possibility to enforce calling the method Message_MsgFile::Msg() upfront to initialize these variables and only read-access them afterwards.
1. Do not set CSF_SHMessage env var upfront
2. Invoke concurrently Shape Healing on any shape that generates messages (see ShapeFix_*.cxx)
3. Check for data races (e.g. using Intel Inspector XE)
No tags attached.
has duplicate 0022546closed jgv Community Improving thread-safety 
related to 0025057closed bugmaster Open CASCADE Message_Algorithm fails to find messages defined for base class 
Issue History
2013-04-21 09:25Roman LyginNew Issue
2013-04-21 09:25Roman LyginAssigned To => abv
2013-04-21 09:30Roman LyginNote Added: 0024230
2013-04-21 09:30Roman LyginStatusnew => resolved
2013-04-22 08:51abvNote Added: 0024235
2013-04-22 08:51abvAssigned Toabv => bugmaster
2013-04-22 08:51abvStatusresolved => reviewed
2013-04-26 16:43mkvNote Added: 0024293
2013-04-26 16:43mkvTest case number => Not needed
2013-04-26 16:43mkvStatusreviewed => tested
2013-05-20 10:56Roman LyginChangeset attached => occt master fa523cdd
2013-05-20 10:56Roman LyginAssigned Tobugmaster => Roman Lygin
2013-05-20 10:56Roman LyginStatustested => verified
2013-05-20 10:56Roman LyginResolutionopen => fixed
2013-05-20 16:50bugmasterTarget Version => 6.7.0
2013-12-19 13:53bugmasterStatusverified => closed
2013-12-19 13:55bugmasterFixed in Version => 6.7.0
2014-07-08 15:46abvRelationship addedrelated to 0025057
2015-09-05 16:34abvRelationship addedhas duplicate 0022546

Notes
(0024230)
Roman Lygin   
2013-04-21 09:30   
Fix pushed into git repository
(0024235)
abv   
2013-04-22 08:51   
No remarks, please test
(0024293)
mkv   
2013-04-26 16:43   
Dear BugMaster,

Branch CR23920 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
SHA-1: 24c0eb5c4e637a99852fbc0013717464dd486a61

Number of compiler warnings:

occt component :
Linux: 2 (2 on master)
Windows: 11 (11 on master)

products component :
Linux: 0 (0 on master)
Windows: 64 (64 on master)

Regressions:
No regressions

Improvements:
No improvements

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 366251492 / 366591592
Total CPU difference: 42577.76000000097 / 54394.90000000041

Testing on Windows:
Total MEMORY difference: 419777708 / 419806404
Total CPU difference: 30655.59375 / 34616.171875

There are not serious differences in images found by testdiff.