Bug Hunting Session
Bug 91291 - EDITING: Crash when moving rtl text with footnote with continuation onto the next page
Summary: EDITING: Crash when moving rtl text with footnote with continuation onto the...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86-64 (AMD64) All
: medium major
Assignee: Caolán McNamara
URL:
Whiteboard: target:5.2.0 target:5.1.5
Keywords:
Depends on:
Blocks: Footnote-Endnote
  Show dependency treegraph
 
Reported: 2015-05-14 16:50 UTC by Gordo
Modified: 2017-06-27 08:09 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
test document and backtrace (11.89 KB, application/zip)
2015-05-14 16:50 UTC, Gordo
Details
Common Arabic document with footnotes (73.42 KB, application/vnd.oasis.opendocument.text)
2016-01-15 22:34 UTC, Usama
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gordo 2015-05-14 16:50:55 UTC
Created attachment 115605 [details]
test document and backtrace

I am not familiar with rtl setup so I do not know if this is how it is actually used.

1. New Text Document.
2. Tools → Options → Language Settings → Languages → Default Languages for Documents → check “Complex text layout” and select “Persian” from drop-down and check “For the current document only” and OK.
3. Ctrl + Shift + D or Ctrl + Right Shift to change to Right to Left entry.
4. Format Page → Footnote tab, toggle Footnote Area to “Maximum footnote height” and 2 cm and OK.
5. Tools → Footnotes/Endnotes → Footnotes tab → Continuation Notice, type “...” in start and end and OK.
6. Enter enough paragraphs so that cursor is near the end of the page but with enough room for a footnote.
7. Type “test”.
8. Insert → Footnote/Endnote and OK default.
9. With cursor in footnote, Ctrl + Shift + D or Ctrl + Right Shift to change to Right to Left entry.
10. Type enough text so that the footnote continues onto the next page.  And give it an extra Enter for good measure.
Note:
The continuation number is shown twice on the second page which is another bug.
11. Place cursor on first page in a paragraph before “test” and Enter until “test” moves onto the next page.
Result:
Crash.

After opening LO, you may need to uncheck  Tools → Options → Language Settings → Languages → Default Languages for Documents → Complex text layout.

Windows Vista 64
Version: 4.4.3.2
Build ID: 88805f81e9fe61362df02b9941de8e38a9b5fd16
Comment 1 Gordo 2015-05-14 18:34:51 UTC
The footnote does not need to be spread over two pages for the crash to happen.  As long as there are at least two lines in the footnote and the Continuation Notice has something in it--the page does not even need to be set for "Maximum footnote height"--then LO will crash when moving the text with footnote onto the next page.
Comment 2 Buovjaga 2015-05-18 18:13:49 UTC
Reproduced with example document.
Debug message appearing with 5.0 crash:

warn:legacy.osl:3119:1:sw/source/core/text/txtftn.cxx:1100: Quo Vadis, rest of QuoVadisPortion

I daresay, that is a smashing warning message.

Ubuntu 15.04 64-bit 
Version: 5.0.0.0.alpha1+
Build ID: 51d16cc69d8ad9065f61d108ea25d6a025a2e228
TinderBox: Linux-rpm_deb-x86_64@46-TDF-dbg, Branch:master, Time: 2015-05-17_03:58:58
Locale: en-US (en_US.UTF-8)

OpenOffice.org 3.3.0
OOO330m20 (Build:9567)
Comment 3 Usama 2016-01-15 22:34:53 UTC
Created attachment 121963 [details]
Common Arabic document with footnotes

I was able to reproduce this on LO 5.1.0.1 and 4.4.6.3 Ubuntu 15.04

It's very simple to reproduce. Just keep adding text to the footnote in the sample file and it will crash.

I got a user report few hours ago about this bug with the attached file.

This bug seems to effect every RTL languages (Arabic, Persian, Urdu, and Hebrew) with their default language settings. It already comes with CTL enabled for them.
Comment 4 Waraqa 2016-01-16 10:20:32 UTC
I confirm this bug on latest master dev build 5.2 on fedora 21
Comment 5 Ali Yousuf 2016-01-21 05:48:44 UTC
Now I work on this bug ,but I need right behavior of libroffice to remove this crash.
Comment 6 Ali Yousuf 2016-01-21 06:20:35 UTC
(In reply to Beluga from comment #2)
> Reproduced with example document.
> Debug message appearing with 5.0 crash:
> 
> warn:legacy.osl:3119:1:sw/source/core/text/txtftn.cxx:1100: Quo Vadis, rest
> of QuoVadisPortion
if you look at the file :libreoffice/sw/source/core/text/porlin.cxx:250
if you comment this two line below,no crash.
250   //Height( pLast->Height() );
251   //SetAscent( pLast->GetAscent() )
;
so, The problem on the "pLast->Height()" and "pLast->GetAscent()"
> 
> I daresay, that is a smashing warning message.
> 
> Ubuntu 15.04 64-bit 
> Version: 5.0.0.0.alpha1+
> Build ID: 51d16cc69d8ad9065f61d108ea25d6a025a2e228
> TinderBox: Linux-rpm_deb-x86_64@46-TDF-dbg, Branch:master, Time:
> 2015-05-17_03:58:58
> Locale: en-US (en_US.UTF-8)
> 
> OpenOffice.org 3.3.0
> OOO330m20 (Build:9567)
Comment 7 Ali Yousuf 2016-01-26 07:14:52 UTC
please, give me right behavior of libreoffice when enter the footnote.
Comment 8 Buovjaga 2016-01-26 07:34:24 UTC
(In reply to Ali Yousuf from comment #7)
> please, give me right behavior of libreoffice when enter the footnote.

What do you mean?
Comment 9 Commit Notification 2016-03-15 21:09:37 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=367f13fd584d5b67cbc3a7787892f12655a65d6c

crashtesting: Related tdf#91291 assert on indexing into empty string

It will be available in 5.2.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 10 Caolán McNamara 2016-06-04 20:19:19 UTC
Seems my above crashtesting fix solves this. at least it crashes for me in 5.1 when I add text to Usama's example in 5-1 and if I add my fix it stops crashing.
Backport to 5-1 as https://gerrit.libreoffice.org/25897
Comment 11 Commit Notification 2016-06-06 08:34:58 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a7d4185bad915b51c23e8e5e40fbaa528852face&h=libreoffice-5-1

crashtesting: Resolves: tdf#91291 crash on inserting text into footnote

It will be available in 5.1.5.

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.