Bug 114396 - Assertion failed, if I copy text to clipboard from special document
Summary: Assertion failed, if I copy text to clipboard from special document
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.1.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Michael Stahl (CIB)
URL: http://docs.oasis-open.org/office/v1....
Whiteboard: target:6.1.0 target:6.0.0.1
Keywords: haveBacktrace
Depends on:
Blocks: Crash-Assert
  Show dependency treegraph
 
Reported: 2017-12-10 22:41 UTC by Regina Henschel
Modified: 2019-08-01 15:05 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
gdb backtrace (32.75 KB, text/plain)
2017-12-10 23:10 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2017-12-10 22:41:06 UTC
I use a debug build Version: 6.1.0.0.alpha0+ (x64)
Build ID: 76349ea956c527e3a16023acd287f9d984ecfd8e
CPU threads: 8; OS: Windows 10.0; UI render: GL; 
Locale: de-DE (de_DE); Calc: CL

Open the document http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part2.odt and go some pages down below the TOC. Mark some lines and then press Ctrl+C to copy them to clipboard.

I get an assertion failed in sw/source/core/layout/atrfrm.cxx, line 2626.

There seems to be something special with this document. The bug does not occur with a simple dummy text and not with part 1 of the spec.
Comment 1 Xisco Faulí 2017-12-10 23:10:34 UTC
Created attachment 138352 [details]
gdb backtrace
Comment 2 Xisco Faulí 2017-12-10 23:10:51 UTC
Reproduced in

Version: 6.1.0.0.alpha0+
Build ID: 2392238e480ecc1d1a5e2e69789e79c10f142d6c
CPU threads: 4; OS: Linux 4.10; UI render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF-dbg, Branch:master, Time: 2017-12-05_23:58:29
Locale: ca-ES (ca_ES.UTF-8); Calc: group threaded
Comment 4 Michael Stahl (CIB) 2017-12-12 16:13:24 UTC
the styles.xml has a bunch of styles with text:anchor-type attribute:

    <style:style style:name="Frame" style:family="graphic">
      <style:graphic-properties text:anchor-type="paragraph" svg:x="0in" svg:y="0in" style:wrap="parallel" style:number-wrapped-paragraphs="no-limit" style:wrap-contour="false" style:vertical-pos="top" style:vertical-rel="paragraph-content" style:horizontal-pos="center" style:horizontal-rel="paragraph-content"/>
    </style:style>
    <style:style style:name="Graphics" style:family="graphic">
      <style:graphic-properties text:anchor-type="paragraph" svg:x="0in" svg:y="0in" style:wrap="none" style:vertical-pos="top" style:vertical-rel="paragraph" style:horizontal-pos="center" style:horizontal-rel="paragraph"/>
    </style:style>
    <style:style style:name="OLE" style:family="graphic">
      <style:graphic-properties text:anchor-type="paragraph" svg:x="0in" svg:y="0in" style:wrap="none" style:vertical-pos="top" style:vertical-rel="paragraph" style:horizontal-pos="center" style:horizontal-rel="paragraph"/>
    </style:style>
    <style:style style:name="Formula" style:family="graphic">
      <style:graphic-properties text:anchor-type="as-char" svg:y="0in" style:vertical-pos="top" style:vertical-rel="baseline"/>
    </style:style>

was this ever intentional?

document was written by OOo 3.3 but of course this would likely be round-tripped so we have no idea what version created it...
Comment 5 Michael Stahl (CIB) 2017-12-12 16:52:50 UTC
oh no, the styles are *created* like that:

    case RES_POOLFRM_GRAPHIC:
    case RES_POOLFRM_OLE:
        {
            aSet.Put( SwFormatAnchor( RndStdIds::FLY_AT_PARA ));
...
        }
        break;
    case RES_POOLFRM_FORMEL:
        {
            aSet.Put( SwFormatAnchor( RndStdIds::FLY_AS_CHAR ) );
...
        }
        break;


how did i manage to miss that before...

probably this needs to be restricted to only forbid anchor positions, not the entire RES_ANCHOR item.
Comment 6 Regina Henschel 2017-12-12 16:54:34 UTC
(In reply to Michael Stahl from comment #4)
> the styles.xml has a bunch of styles with text:anchor-type attribute:
> was this ever intentional?

That are the default styles from the "Frame" category. The anchor-settings are not available in the UI, see bug 32484; and they handling has an error, see bug 113381.
Comment 7 Commit Notification 2017-12-12 21:56:24 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1e70464c380ecc0756ea29098632c503a60aec71

tdf#114396 sw: overly strict assertions in SwFrameFormat::Modify()

It will be available in 6.1.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 8 Michael Stahl (CIB) 2017-12-12 21:56:53 UTC
okay there's a bug about that; i was thinking the missing editing of the anchor on styles implied that it shouldn't exist, but in principle there's no problem with anchor type on styles, as long as styles don't have anchor positions.

fixed on master.
Comment 9 Commit Notification 2017-12-13 08:27:45 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-6-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=0c8a30ba47c6ed64c45063a060356e61e82a789f&h=libreoffice-6-0

tdf#114396 sw: overly strict assertions in SwFrameFormat::Modify()

It will be available in 6.0.0.1.

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

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