[MAGNOLIA-2653] MagnoliaV2Filter emits bogus and unbalanced sv:value element - may cause StackOverflow on large imports Created: 09/Mar/09 Updated: 23/Jan/13 Resolved: 15/Jun/09 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | core |
| Affects Version/s: | 3.6.3 |
| Fix Version/s: | 4.0.2, 4.1.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Henryk Paluch | Assignee: | Fabrizio Giustina |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
JDK1.6, WIn2000 and Suse Linux |
||
| Attachments: |
|
| Template: |
|
| Patch included: |
Yes
|
| Acceptance criteria: |
Empty
|
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
| Testcase included: |
Yes
|
| Date of First Response: |
| Description |
|
MagnoliaV2Filter (user also when importing repository) data emits bogus sv:value and unbalanced sv:value tag. When importing large repositories (3GB with thousands of Documents) this may cause stack overflow due extreme element nesting: Caused by: java.lang.StackOverflowError It turned out, that this overflow is caused by MagnoliaV2Filter when replacing jcr:primary of MetataData type. Here is excerpt from input data: <sv:node sv:name="MetaData"> Which is by this filter transormed into: <sv:node sv:name="MetaData"> <sv:value>mgnl:metaData <sv:property sv:name="jcr:created" There is a clear difference - an spurious (and unclosed) <sv:value>mgnl:metaData element I'm supposed that its startElement() method is missing somehting like if (skipProperty && qName.equals("sv:value") ) { skipValue = true; return; }I shall try and send possible fix hopefully in few days. |
| Comments |
| Comment by Henryk Paluch [ 09/Mar/09 ] |
|
Test input file (simple export of Test folder form Documents - dms repository) |
| Comment by Henryk Paluch [ 09/Mar/09 ] |
|
Simple "Test" - it just calls MagnoliaV2Filter for |
| Comment by Henryk Paluch [ 09/Mar/09 ] |
|
Output from M2FilterMetaBugTest (file dms.Test.xml filtered through MagnoliaV2Filter There is clearly visible defect on MetaData nodes: ... <sv:value>mgnl:metaData <sv:property sv:name="jcr:created" |
| Comment by Henryk Paluch [ 10/Mar/09 ] |
|
Junit Test Case to reproduce MagnoliaV2Filter. The input file should be left intact (it contains no versioning elements) - however the output fails contains additional misplaced sv:value - thus this test fails on unpatches MagnoliaV2Filter NOTE: It's reverse patch - please apply with -R |
| Comment by Henryk Paluch [ 10/Mar/09 ] |
|
Magnolia 3.6.3 core Patch to fix errornous element in MagnolivaV2Filter also fixes additional whitespace after replace. After applying this patch MagnoliaV2Filter produces exactly 1:1 output for non-versioned input file. Note: It is not yet exensively tested. |
| Comment by Philipp Bärfuss [ 23/Mar/09 ] |
|
Thanks for the patch, will apply it to the next bugfix version |
| Comment by Fabrizio Giustina [ 03/Jun/09 ] |
|
Patch and tests committed in revision 25674 for magnolia 4.1, it's indeed a serious bug. |
| Comment by Magnolia International [ 03/Jun/09 ] |
|
Reverted commit - will review and reapply patch as soon as 4.1 final is out. Too close to release, sorry. |