View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0024007 | Community | OCCT:Data Exchange | public | 2013-06-02 11:41 | 2013-12-19 13:58 |
Reporter | Roman Lygin | Assigned To | Roman Lygin | ||
Priority | normal | Severity | major | ||
Status | closed | Resolution | fixed | ||
Platform | A | OS | L | ||
Product Version | 6.6.0 | ||||
Target Version | 6.7.0 | Fixed in Version | 6.7.0 | ||
Summary | 0024007: [Regression] Sporadic crashes when working with XDE documents | ||||
Description | The fix 0023523 has changed the order of destroying the document contents: destructors of the attributes are now called with null Label(). This invalidates the fix 0023593 and resurrects the problem. The current fix removes a global map and thus eliminates a risk of orphan labels. | ||||
Steps To Reproduce | Apparently the problem is not captured by OCC automatic tests due to different memory allocator - as the problem shows up when there is a clash of the addresses - when a root label gets the same address as already destroyed one. No new test case is required. | ||||
Tags | No tags attached. | ||||
Test case number | Not needed | ||||
related to | 0023523 | closed | Open CASCADE | In session DRAW it is impossible to close document having name already once closed document. | |
related to | 0023593 | closed | Roman Lygin | Community | XCAFDoc_DocumentTool label must be removed from internal map upon closing the XDE document |
related to | 0024047 | closed | Open CASCADE | Exception in TPrsStd_AISPresentation during destruction of TDocStd_Document | |
related to | 0024164 | closed | bugmaster | Open CASCADE | Optimization of OCAF document closing |
|
The fix has been pushed to the git repository. |
|
See more details in http://opencascade.blogspot.com/2013/06/significant-side-effects-in-ocafxde-660.html |
|
Hello Roman, as stated in 0023554 since then I've dealt with some occasional crashes upon XDE document destruction I was not able to identify. Mostly freeing labels with XCAFDoc_ColorTool caused the problem but neither was I able to reproduce nor to isolate it. I'll test your fix tomorrow and hope I can give positive feedback. Thank you! |
|
Thanks Pawel. Yes, please confirm if this helps your case. FYI - OCC tests "testgrid xcaf" do pass. So do proprietary CAD Exchanger's. |
|
Hello Roman, I have applied this fix and followed your advice to store the handle to the AIS_InteractiveContext outside the document. It seems to help in most cases... However, I still have one XDE file (unfortunately cutomer data) that does crash upon closing the document. As described above, the problem is XCAFDoc_ColorTool attribute. Do you think there might be a similar issue with XCAFDoc_*Tool attributes as the one corrected by you? |
|
Hi Pawel, can you post a stack trace ? |
|
crash_DocumentClosing.png (15,936 bytes) |
|
Hi Roman, I attached a picture to clarify. The crash occurs when 'forgetting' a XCAFDoc_ColorTool sub-label (0x000000000a00b818). Precisely, when forgetting TDataStd_TreeNode attribute. TDF_Label::ForgetFromNode crashes in line 601: if (fromNode->Data()->NotUndoMode()) { Below stack trace. If you have any questions please let me know. Unfortunately, lots of internal OCCT mechanisms are beyond my understanding so I'm very happy about any help on the issue. Thanks! TKLCAF.dll!TDF_Label::ForgetFromNode(TDF_LabelNode * const & fromNode=0x000000000a00b818, const Handle_TDF_Attribute & anAttribute={...}) Line 601 TKLCAF.dll!TDF_Label::ForgetAllAttributes(const unsigned int clearChildren=1) Line 500 + 0x1a Bytes TKLCAF.dll!TDF_Label::ForgetAllAttributes(const unsigned int clearChildren=1) Line 508 + 0x1b Bytes TKLCAF.dll!TDF_Label::ForgetAllAttributes(const unsigned int clearChildren=1) Line 508 + 0x1b Bytes TKLCAF.dll!TDF_Label::ForgetAllAttributes(const unsigned int clearChildren=1) Line 508 + 0x1b Bytes TKLCAF.dll!TDocStd_Document::Destroy() Line 81 TKLCAF.dll!TDocStd_Document::~TDocStd_Document() Line 224 + 0xa Bytes TKLCAF.dll!TDocStd_Document::`scalar deleting destructor'() + 0x17 Bytes TKernel.dll!Standard_Transient::Delete() Line 82 + 0x30 Bytes TKernel.dll!Handle_Standard_Transient::EndScope() Line 58 |
|
Thanks. Is this XCAFDoc_Color or _ColorTool ? The latter does not have a TreeNode attached to the same label, while the former - does. Anyway, I briefly looked at the TDataStd_TreeNode::BeforeForget() and TDataStd_TreeNode::Remove(). They seem to be safe enough, and given that the trees can be directed in any direction, the changed behavior should not cause a side-effect (in theory). There is however IsBackuped() check in ::BeforeForget() and perhaps another control flow causes different behavior. I guess the only feasible way would be to have a C++ reproducer. DRAW seems to be too non-representative - there are multiple global objects (variables, AIS_IC, application, ...) holding handles to objects |
|
Sorry for lacking precision ;) I meant the TDF_Label (0x000000000a00b818) containing the XCAFDoc_Color attribute. Unfortunately, I was not able to create a reproducer... |
|
For the record: the problem with crash when deleting labels with XCAFDoc_Color attribute resulted from "damaged" XDE structure (cyclic dependency of TDataStd_TreeNode) and has nothing to do with the issue reported/corrected by Roman here. |
|
Branch CR24007 is ready to be tested. |
|
Dear BugMaster, Branch CR24007 (and products from GIT master) was compiled on Linux and Windows platforms and tested. SHA-1: aa66e3b27d03a38213974173f43b18e46d032af5 Number of compiler warnings: occt component : Linux: 2 (2 on master) Windows: 7 (7 on master) products component : Linux: 0 (0 on master) Windows: 63 (63 on master) Regressions: No regressions Improvements: No improvements Testing cases: Not needed Testing on Linux: Total MEMORY difference: 366342436 / 366203376 Total CPU difference: 44579.97000000128 / 43388.71000000102 Testing on Windows: Total MEMORY difference: 422133272 / 424066896 Total CPU difference: 32228.75 / 44233.921875 There are not differences in images found by testdiff. |
Date Modified | Username | Field | Change |
---|---|---|---|
2013-06-02 11:41 | Roman Lygin | New Issue | |
2013-06-02 11:41 | Roman Lygin | Assigned To | => gka |
2013-06-02 11:46 | Roman Lygin | Note Added: 0024590 | |
2013-06-02 11:46 | Roman Lygin | Status | new => resolved |
2013-06-02 12:05 | Roman Lygin | Note Added: 0024591 | |
2013-06-02 12:18 | Roman Lygin | Relationship added | related to 0023523 |
2013-06-02 12:18 | Roman Lygin | Relationship added | related to 0023593 |
2013-06-02 15:10 | Pawel | Note Added: 0024593 | |
2013-06-02 15:58 | Roman Lygin | Note Added: 0024594 | |
2013-06-03 13:22 | Pawel | Note Added: 0024602 | |
2013-06-03 13:28 | Roman Lygin | Note Added: 0024603 | |
2013-06-03 14:16 | Pawel | File Added: crash_DocumentClosing.png | |
2013-06-03 14:21 | Pawel | Note Added: 0024604 | |
2013-06-03 14:45 | Roman Lygin | Note Added: 0024607 | |
2013-06-03 14:46 | Roman Lygin | Note Edited: 0024607 | |
2013-06-03 15:01 | Pawel | Note Added: 0024611 | |
2013-06-05 17:54 | Pawel | Note Added: 0024641 | |
2013-06-26 12:19 |
|
Relationship added | related to 0024047 |
2013-07-01 12:13 |
|
Note Added: 0024925 | |
2013-07-01 12:13 |
|
Status | resolved => reviewed |
2013-07-01 13:12 |
|
Assigned To | gka => mkv |
2013-07-03 11:43 |
|
Note Added: 0024952 | |
2013-07-03 11:43 |
|
Test case number | => Not needed |
2013-07-03 11:43 |
|
Assigned To | mkv => bugmaster |
2013-07-03 11:43 |
|
Status | reviewed => tested |
2013-07-03 11:44 | apn | Target Version | => 6.7.0 |
2013-07-05 11:57 | Roman Lygin | Changeset attached | => occt master 388fc344 |
2013-07-05 11:57 | Roman Lygin | Assigned To | bugmaster => Roman Lygin |
2013-07-05 11:57 | Roman Lygin | Status | tested => verified |
2013-07-05 11:57 | Roman Lygin | Resolution | open => fixed |
2013-10-02 15:52 |
|
Relationship added | related to 0024164 |
2013-12-19 13:52 | bugmaster | Status | verified => closed |
2013-12-19 13:58 | bugmaster | Fixed in Version | => 6.7.0 |