DiscussionsIssue archiveOCCT:Application Framework

Archived issue #0023086

OCC 6.5.2 DNaming bug

CommunityOCCT:Application Frameworkclosed8 public notes

Search issues

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."

Public activity

8 archived notes

Participants are labeled by their role within this record.

01Commenter 1
Fixed in branch CR23086.
Review, please.
02Commenter 2
Please provide meaningful description of the change made
03Commenter 2
The changes are Ok.
04Commenter 4
Technical solution: static TNaming_Buildrer is replaced by corresponding pair [new, delete]. Dynamic management of the Builder creation/deletion is added.

05Commenter 5
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
06Commenter 6
The alternative implementation of the fix (using Handles instead of plain C pointers) is integrated to the same-name branch CR23086; please review
07Commenter 7
Reviewed. It's Ok.
08Commenter 3
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

Related records