|Anonymous | Login||2019-08-20 16:58 MSK|
|My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0024931||Community||[OCCT] OCCT:Foundation Classes||public||2014-05-15 20:25||2015-02-07 08:42|
|Target Version||[OCCT] 6.8.0||Fixed in Version||[OCCT] 6.8.0|
|Summary||0024931: Stack overflow when writing large shapes to XML|
|Description||LDOM_OSStream runs into stack overflow when writing large shape sections in XML documents (e.g. in XML persistence).|
The root-cause is recursive destruction of siblings holding memory chunks. With a memory chunk hard-coded at 1KB large documents require >50K chunks. So the destructor, recursively called, leads to stack overflow.
The fix includes refactoring of the code and use of NCollection_IncAllocator.
This allowed to avoid need of destructor and improve performance.
Additionally the chunk is increased to 16K to reduce need for extra allocations/deallocations, what also should improve performance.
|Steps To Reproduce||See enclosed test case.|
|Tags||No tags attached.|
|Test case number||bugs fclasses bug24931|
|Attached Files||OCCXDETestLib_OCC_excerpt.zip (974 bytes) 2014-05-15 20:28|
Roman Lygin (developer)
|The fix pushed into git.|
Reviewed, can be tested.
One minor remark: it would be logical to make the field myAlloc in LDOM_OSStream having the type NCollection_IncAllocator, and add appropriate comment to the field declaration, to make it more explicit that incallocation is essential here.
And one more point: could you provide result of performance increase measured due to that change?
Roman Lygin (developer)
Thanks for the review. Yeah, I initially thought of exposing IncAllocator into the header but then pulled back to make the header to only depend on the base class header file (NCollection_BaseAllocator.hxx). The field is private, so no subclass or callers can adversely influence that, and the comment was put into the .cxx file instead.
Regarding performance I did not make intensive measurements but quick tests on the test file exhibited single digit differences - 3%-7% difference AFAIR. No big deal of course - apparently the greater performance loss happens somewhere else.
Branch CR24931 (and products from GIT master) was compiled on Linux, Windows and MacOS platforms and tested.
Number of compiler warnings:
occt component :
Linux: 17 (17 on master)
Windows: 0 (0 on master)
MacOS: 202 (205 on master)
products component :
Linux: 11 (11 on master)
Windows: 2 (2 on master)
bugs fclasses bug24931 - OK
Testing on Linux:
Total MEMORY difference: 359574056 / 359742796
Total CPU difference: 52411.48999999997 / 51526.670000000115
Testing on Windows:
Total MEMORY difference: 381754716 / 382610904
Total CPU difference: 38105.40625 / 37430.125
There are no differences in images found by testdiff.
Roman Lygin (developer)
|Verified as fixed in 6.8.0 beta.|
occt: master 70167e69
Timestamp: 2014-05-29 12:08:40
Author: Roman Lygin
|0024931: Stack overflow when writing large shapes to XML
Added QA command OCC24931 and test case bugs/fclasses/bug24931
|mod - src/LDOM/LDOM_OSStream.cxx|
|mod - src/LDOM/LDOM_OSStream.hxx|
|mod - src/QABugs/QABugs_19.cxx|
|mod - src/XmlMNaming/XmlMNaming_NamedShapeDriver.cxx|
|add - tests/bugs/fclasses/bug24931|
|2014-05-15 20:25||Roman Lygin||New Issue|
|2014-05-15 20:25||Roman Lygin||Assigned To||=> abv|
|2014-05-15 20:28||Roman Lygin||File Added: OCCXDETestLib_OCC_excerpt.zip|
|2014-05-15 21:10||Roman Lygin||Note Added: 0029362|
|2014-05-15 21:10||Roman Lygin||Status||new => resolved|
|2014-05-20 18:10||abv||Note Added: 0029417|
|2014-05-20 18:10||abv||Assigned To||abv => bugmaster|
|2014-05-20 18:10||abv||Status||resolved => reviewed|
|2014-05-20 19:49||Roman Lygin||Note Added: 0029419|
|2014-05-22 11:07||bugmaster||Target Version||=> 6.8.0|
|2014-05-22 11:07||bugmaster||Description Updated||View Revisions|
|2014-05-27 13:20||apn||Assigned To||bugmaster => apn|
|2014-05-28 15:44||apn||Note Added: 0029575|
|2014-05-28 15:45||apn||Test case number||=> bugs fclasses bug24931|
|2014-05-28 15:45||apn||Assigned To||apn => bugmaster|
|2014-05-28 15:45||apn||Status||reviewed => tested|
|2014-05-30 12:59||apn||Changeset attached||=> occt master 70167e69|
|2014-05-30 12:59||apn||Assigned To||bugmaster => apn|
|2014-05-30 12:59||apn||Status||tested => verified|
|2014-05-30 12:59||apn||Resolution||open => fixed|
|2014-10-15 15:16||Roman Lygin||Note Added: 0033136|
|2014-11-11 12:44||aiv||Fixed in Version||=> 6.8.0|
|2014-11-11 12:59||aiv||Status||verified => closed|
|2015-02-07 08:42||abv||Relationship added||related to 0025803|
|Copyright © 2000 - 2019 MantisBT Team|