Bug 129805 - Crash when copying the content of a complex DOCX
Summary: Crash when copying the content of a complex DOCX
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.4.0.1 rc
Hardware: All All
: medium normal
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: target:6.5.0 target:6.4.0 target:7.0.0
Keywords: bibisected, regression
Depends on:
Blocks: DOCX Cut-Copy
  Show dependency treegraph
 
Reported: 2020-01-05 10:32 UTC by Aron Budea
Modified: 2020-05-20 08:20 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Backtrace (21.74 KB, text/plain)
2020-01-05 10:32 UTC, Aron Budea
Details
bt with debug symbols (9.43 KB, text/plain)
2020-01-05 11:35 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2020-01-05 10:32:30 UTC
Created attachment 156938 [details]
Backtrace

The following are the first steps from bug 124738.

- Open attachment 94362 [details] from bug 75208,
- Select all,
- Copy.

=> Crash.
Attaching backtrace.

Observed using LO 6.5.0.0.alpha0+ (b9e86836d79039a28661dfb6195df0a4dc1e7572), 6.4.0.1 / Ubuntu & Windows.
No crash in LO 6.3.0.4.
=> regression

Bibisected to the following range using repo bibisect-linux-64-6.4. Adding CC: to Michael Stahl.
https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=e511a0ca5dde6d731bb126bbfe21768867890102..d9030ad6298e2f49ee63489d6158ea6ad23c0111
Comment 1 Julien Nabet 2020-01-05 11:35:04 UTC
Created attachment 156939 [details]
bt with debug symbols

On pc Debian x86-64 with master sources updated yesterday, I could reproduce this.
Comment 2 Julien Nabet 2020-01-05 12:28:20 UTC
Some gdb debug:
584	
585	        if ((eType == MarkType::TEXT_FIELDMARK || eType == MarkType::DATE_FIELDMARK)
586	            && (rPaM.GetPoint()->nNode.GetNode().StartOfSectionNode() != rPaM.GetMark()->nNode.GetNode().StartOfSectionNode()
587	                || (pSepPos && rPaM.GetPoint()->nNode.GetNode().StartOfSectionNode() != pSepPos->nNode.GetNode().StartOfSectionNode())))
588	        {
589	            SAL_WARN("sw.core", "MarkManager::makeMark(..)"
590	                " - invalid range on fieldmark, different nodes array sections");
591	            return nullptr;
592	        }
593	
(gdb) p eType
$1 = IDocumentMarkAccess::MarkType::TEXT_FIELDMARK
(gdb) p rPaM.GetPoint()->nNode.GetNode().StartOfSectionNode()
$2 = (SwStartNode *) 0x55555ed2d1b0
(gdb) p rPaM.GetMark()->nNode.GetNode().StartOfSectionNode()
$3 = (SwStartNode *) 0x55555edb38f0
(gdb) p *(rPaM.GetMark()->nNode.GetNode().StartOfSectionNode())
$4 = {<SwNode> = {<BigPtrEntry> = {_vptr.BigPtrEntry = 0x7fffdb326d30 <vtable for SwSectionNode+16>, m_pBlock = 0x55555e81af60, m_nOffset = 615}, m_nNodeType = SwNodeType::Section, m_nAFormatNumLvl = 0 '\000', 
    m_bIgnoreDontExpand = false, m_eMerge = SwNode::Merge::None, static s_nSerial = 5085, m_nSerial = 3368, 
    m_pAnchoredFlys = std::unique_ptr<std::__debug::vector<SwFrameFormat*, std::allocator<SwFrameFormat*> >> = {get() = 0x0}, m_pStartOfSection = 0x55555ed9fe10}, m_pEndOfSection = 0x55555edb0ad0, 
  m_eStartNodeType = SwNormalStartNode}
(gdb) p *(rPaM.GetPoint()->nNode.GetNode().StartOfSectionNode())
$5 = {<SwNode> = {<BigPtrEntry> = {_vptr.BigPtrEntry = 0x7fffdb326d30 <vtable for SwSectionNode+16>, m_pBlock = 0x55555e81af60, m_nOffset = 442}, m_nNodeType = SwNodeType::Section, m_nAFormatNumLvl = 0 '\000', 
    m_bIgnoreDontExpand = false, m_eMerge = SwNode::Merge::None, static s_nSerial = 5085, m_nSerial = 3191, 
    m_pAnchoredFlys = std::unique_ptr<std::__debug::vector<SwFrameFormat*, std::allocator<SwFrameFormat*> >> = {get() = 0x0}, m_pStartOfSection = 0x55555b0e4210}, m_pEndOfSection = 0x55555ed2b320, 
  m_eStartNodeType = SwNormalStartNode}
(gdb) p pSepPos
$6 = (const SwPosition * const) 0x0
Comment 3 Commit Notification 2020-01-14 17:57:49 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/cf226535f9903a048b1c105b180ae3a50a776e68

tdf#129805 writerfilter: fix import of nested generic field

It will be available in 6.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Michael Stahl (allotropia) 2020-01-14 18:07:02 UTC
fixed on master
Comment 5 Xisco Faulí 2020-01-14 20:20:19 UTC
Verified in

Version: 6.5.0.0.alpha0+
Build ID: a504edb024bb2cbe07e98a0df42efdb2f1a2135b
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded

@Michael, thanks for fixing this issue!!
Comment 6 Commit Notification 2020-01-14 20:22:19 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-6-4":

https://git.libreoffice.org/core/commit/d8dc16940b71acb0f4d3eda0a716dd4c37f00d37

tdf#129805 writerfilter: fix import of nested generic field

It will be available in 6.4.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2020-01-16 09:22:48 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-6-4-0":

https://git.libreoffice.org/core/commit/a290d025339ef92b93ba6d287658ba784a818220

tdf#129805 writerfilter: fix import of nested generic field

It will be available in 6.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2020-04-23 07:25:32 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2fe1ecae8a7937adffdf8f5e3bd9fe6f8b7de1e3

tdf#129805: sw: Add unittest

It will be available in 7.0.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.