Archived issue #0023086
OCC 6.5.2 DNaming bug
Description
Post from the Forum [Valeriu Catina] - http://www.opencascade.org/org/forum/thread_23075/ .
"...
in package TKDCAF, module DNaming, file DNaming_TransformationDriver.cxx, function LoadNamingDS contains code similar to:
---
TNaming_Builder* pB1;
// ... irrelevant code
if(aF) {
const TDF_Label& aFLabel = theResultLabel.FindChild(FACES_TAG, Standard_True);
TNaming_Builder aFBuilder(aFLabel);
pB1 = &aFBuilder
aF = Standard_False;
}
// ... irrelevant code
pB1->Modify(anIt.Key(), newShape);
---
pB1 takes the address of a temporary (aFBuilder in our case). As aFBuilder is destroyed at the end of the if block pB1 is invalid when pB1->Modify(anIt.Key(), newShape) is reached."
"...
in package TKDCAF, module DNaming, file DNaming_TransformationDriver.cxx, function LoadNamingDS contains code similar to:
---
TNaming_Builder* pB1;
// ... irrelevant code
if(aF) {
const TDF_Label& aFLabel = theResultLabel.FindChild(FACES_TAG, Standard_True);
TNaming_Builder aFBuilder(aFLabel);
pB1 = &aFBuilder
aF = Standard_False;
}
// ... irrelevant code
pB1->Modify(anIt.Key(), newShape);
---
pB1 takes the address of a temporary (aFBuilder in our case). As aFBuilder is destroyed at the end of the if block pB1 is invalid when pB1->Modify(anIt.Key(), newShape) is reached."
Public activity
8 archived notes
Participants are labeled by their role within this record.
Fixed in branch CR23086.
Review, please.
Review, please.
Please provide meaningful description of the change made
The changes are Ok.
Technical solution: static TNaming_Buildrer is replaced by corresponding pair [new, delete]. Dynamic management of the Builder creation/deletion is added.
Dear Commenter 1,
Workbench KAS:dev:apn-23086-occt was created from git branch CR23086
(and apn-23086-products from svn trunk) and compiled on Linux platform.
There are not regressions in apn-23086-products regarding to KAS:dev:products-20120406-opt
There are not improvements in apn-23086-products regarding to KAS:dev:products-20120406-opt
See results in /QADisk/occttests/results/KAS/dev/apn-23086-products_12042012/lin
See reference results in /QADisk/occttests/results/KAS/dev/products-20120406-opt_07042012/lin
See test cases in /QADisk/occttests/tests/ED
N.B. In order to launch testing case you can make use the following instructions
http://doc/doku.php?id=occt:certification
Workbench KAS:dev:apn-23086-occt was created from git branch CR23086
(and apn-23086-products from svn trunk) and compiled on Linux platform.
There are not regressions in apn-23086-products regarding to KAS:dev:products-20120406-opt
There are not improvements in apn-23086-products regarding to KAS:dev:products-20120406-opt
See results in /QADisk/occttests/results/KAS/dev/apn-23086-products_12042012/lin
See reference results in /QADisk/occttests/results/KAS/dev/products-20120406-opt_07042012/lin
See test cases in /QADisk/occttests/tests/ED
N.B. In order to launch testing case you can make use the following instructions
http://doc/doku.php?id=occt:certification
The alternative implementation of the fix (using Handles instead of plain C pointers) is integrated to the same-name branch CR23086; please review
Reviewed. It's Ok.
Dear Commenter 1,
Branch CR23086 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
Regression:
Not detected
Improvements:
Not detected
Testing case:
Not needed
Branch CR23086 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
Regression:
Not detected
Improvements:
Not detected
Testing case:
Not needed
Related records