Bug 31199 - Click on specific paragraph will freeze Writer in Linux and MacOS if the font 'cwheib.ttf' is installed
Summary: Click on specific paragraph will freeze Writer in Linux and MacOS if the font...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86 (IA32) All
: medium major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 31201 (view as bug list)
Depends on:
Blocks: Fonts
  Show dependency treegraph
 
Reported: 2010-10-28 07:40 UTC by winlin0330
Modified: 2024-01-26 12:06 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
The odt file that could reproduce the problem. (13.51 KB, application/vnd.oasis.opendocument.text)
2010-10-28 07:40 UTC, winlin0330
Details
The strace.log (606.26 KB, application/x-bzip2)
2010-10-28 07:42 UTC, winlin0330
Details
backtrace (6.23 KB, text/plain)
2010-11-24 13:13 UTC, Thorsten Behrens (allotropia)
Details
MacOS X log file created on forced quit of frozen LibreOffice 3.5.3.2 (153.86 KB, text/plain)
2012-05-07 11:29 UTC, Roman Eisele
Details
Screenshot of the text (30.07 KB, image/png)
2012-08-18 06:42 UTC, winlin0330
Details
bt on master on console trace (6.50 KB, text/plain)
2012-08-18 09:11 UTC, Julien Nabet
Details
The second file that freezed Writer. (15.72 KB, application/vnd.oasis.opendocument.text)
2012-08-24 00:14 UTC, winlin0330
Details
The third file that freezed Writer. (15.68 KB, application/vnd.oasis.opendocument.text)
2012-08-24 00:16 UTC, winlin0330
Details
gdb info (97.60 KB, text/plain)
2013-05-15 12:03 UTC, minhsien0330
Details
bt finish + console logs (11.92 KB, text/plain)
2013-05-15 19:06 UTC, Julien Nabet
Details
perf flamegraph (136.99 KB, application/x-bzip)
2020-01-12 16:28 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description winlin0330 2010-10-28 07:40:42 UTC
Created attachment 39857 [details]
The odt file that could reproduce the problem.

Hi~
I am a traditional chinese user (locale: zh-TW).
I found Writer will be freezed when I click on some location in a odt file.
Please open the attachment with Writer, scroll down to the end of file, and click the words "CLICK HERE WILL FREEZE WRITER".

ps. 
The odt file applied this chinese font.
http://cle.linux.org.tw/fonts/cwttf/center/cwheib.ttf 

Thank you.
Comment 1 winlin0330 2010-10-28 07:42:27 UTC
Created attachment 39863 [details]
The strace.log

I have uploaded a strace.log, Thanks again~
Comment 2 Cédric Bosdonnat 2010-10-28 08:32:29 UTC
*** Bug 31201 has been marked as a duplicate of this bug. ***
Comment 3 Thorsten Behrens (allotropia) 2010-11-18 16:15:12 UTC
Cedric, were you able to reproduce this? Could it be this is related to the toolbar docking crash? WinLin, do you have the table toolbar docked, or floating?
Comment 4 Thorsten Behrens (allotropia) 2010-11-24 13:13:48 UTC
Created attachment 40557 [details]
backtrace

backtrace of layout loop.
Comment 5 Thorsten Behrens (allotropia) 2010-11-24 13:14:36 UTC
Cedric: confirmed. put cursor into first paragraph of second page. Could you have a look please?
Comment 6 winlin0330 2010-11-25 23:23:53 UTC
(In reply to comment #3)
> Cedric, were you able to reproduce this? Could it be this is related to the
> toolbar docking crash? WinLin, do you have the table toolbar docked, or
> floating?

 I have the table toolbar floating.
Here is the screenshot :
https://bugs.freedesktop.org/attachment.cgi?id=39874

My friend found this problem happened only when using the following chinese truetype font:
http://cle.linux.org.tw/fonts/cwttf/center/cwheib.ttf 

If clicking on the yellow area did not freeze writer, type something on there might make it. 

Thank you.
Comment 7 winlin0330 2011-05-13 06:11:54 UTC Comment hidden (no-value)
Comment 8 winlin0330 2012-04-26 21:46:36 UTC
I package the font and odt into a 7-zip file:
https://bugs.freedesktop.org/attachment.cgi?id=60648

This bug is annoying to me for 2+ years, I lost lots of data again and again,
please help me.

I found the download link of the truetype font was broken, so I  package the
font and odt into a 7-zip file. (Don't worry, the font is licensed with GPL.)
If you need any information about this bug, please let me know, I will do my
best to test it. Thank you~
Comment 9 Roman Eisele 2012-05-03 04:18:07 UTC
This is a Writer bug, right?! Therefore changed 'Component'.
Comment 10 winlin0330 2012-05-03 20:34:43 UTC Comment hidden (obsolete)
Comment 11 Roman Eisele 2012-05-07 11:13:36 UTC
@winlin0330:
> I also change the version to 3.5.3, because I found
> Writer of version 3.5.3 still crashed due to this bug.
Thank you for your help. But I'm afraid to say that the version field should contain the number of the FIRST version which is known to contain the bug, not the last one. So, could you please change the version field to the first version in which you found that bug? Is it 3.3.0 release? Thank you very much!

First idea:
I wanted to check first if the bug has something to do with some corruption of the font file ('cwheib.ttf'). But Apple's FontBook did not find any errors in this font, and FontLab 5.0.4 opens the font file without any problems. So the font seems OK.
Comment 12 Roman Eisele 2012-05-07 11:26:14 UTC
REPROCUBILE with LibreOffice 3.5.3.2 (Build-ID: 235ab8a-3802056-4a8fed3-2d66ea8-e241b80), German UI installed, on MacOS X 10.6.8. I will attach the MacOS X log file.

Reproducible also on MacOS -> changed Platform to 'All'.

Observations:

1) There is no influcene of the Table toolbar status to the freeze -- the freeze occurs both when the toolbar is floating and when it is docked.

2) But I can reproduce the freeze ONLY when and if the font 'cwheib.ttf' is installed. If I de-install it again, NO freeze occurs, I can even edit the yellow text 'CLICK HERE WILL FREEZE WRITER'.

Therefore, although the font file is not damaged, corrupted, invalid etc. (see my comment #11), this font definitely has some influcene on the problem.
Comment 13 Roman Eisele 2012-05-07 11:29:47 UTC
Created attachment 61166 [details]
MacOS X log file created on forced quit of frozen LibreOffice 3.5.3.2

Note: in my previous comment, I wanted to type [REPRODUCIBLE]; please forgive the strange typo ;-)
Comment 14 winlin0330 2012-05-07 18:14:53 UTC
Dear Roman Eisele:

Version before 3.4.6 is not available to download, but I can reproduce this bug on OpenOffice.org 3.3.0, I think this bug may be inherited from OpenOffice.org. Should I test any earlier version of OpenOffice.org?
A difference should be noted, in OpenOffice 3.3.0., click " CLICK HERE WILL FREEZE WRITER " won't freeze Writer, but typing any character in that yellow area still freeze Writer.

Additionally, using other chinese truetype font sometimes meet this bug, it occurs while inserting some chinese words in page one. But it's hard to find the way to reproduce so far. 
Roughly, I think this problem involved:
(1) a table splits across pages;
(2) a table cell contains chinese characters, some paragraphs in the table cell go across pages.

Thank you.
Comment 15 Roman Eisele 2012-05-08 00:12:24 UTC
(In reply to comment #14)
> ... I can reproduce this bug on OpenOffice.org 3.3.0,
> I think this bug may be inherited from OpenOffice.org.

Thank you very much for testing!

> Should I test any earlier version of OpenOffice.org?

No, for now it is sufficicent to know that this bug is present since 3.3.0 and may be interited from OOo. -> We set the Version field to the oldest available version (3.3.0b2) to indicate this.

> A difference should be noted, in OpenOffice 3.3.0., click " CLICK HERE WILL
> FREEZE WRITER " won't freeze Writer, but typing any character in that yellow
> area still freeze Writer.

This difference may be important, thank you for poiting to it!

> Additionally, using other chinese truetype font sometimes meet this bug, it
> occurs while inserting some chinese words in page one. But it's hard to find
> the way to reproduce so far. 
> Roughly, I think this problem involved:
> (1) a table splits across pages;
> (2) a table cell contains chinese characters, some paragraphs in the
> table cell go across pages.

This sounds very reasonable to me.
Comment 16 Julien Nabet 2012-08-17 22:33:16 UTC
On pc Debian x86-64 with 3.5 sources updated some days ago I don't reproduce the pb.

(I installed the font by following these steps in root mode:
- cp <download directory>/cwheib.ttf /usr/local/share/fonts
- fc-cache -r
)
Did I miss anything during font install?
Then I:
- clicked on the catchphrase
- double clicked on a word then several words of this catchphrase
- type something inside it
nothing special, no specific logs on console.
Anyone to retest on newer LO version (3.5.5 or 3.6.0)?
Comment 17 winlin0330 2012-08-18 06:42:06 UTC
Created attachment 65725 [details]
Screenshot of the text
Comment 18 winlin0330 2012-08-18 06:45:08 UTC
Hi~Julien Nabet:

I am happy to hear that this bug is possible solved.
But when I tried 3.6.0(downloaded from official site of Libreoffice), Writer was still freezed when I scrolled down and clicked the yellow area.

Would you check cwheib.ttf is successfully installed?
If cwheib.ttf is installed:
(1) you will find "cwTeX粗黑體" in the fonts list of Writer, and 
(2) you can see  "cwTeX 粗黑體" after you execute command " fc-list | grep cw" in terminal.
(3) you will see the odt file is looked like this:
https://bugs.freedesktop.org/attachment.cgi?id=65725

Note:
Would you try to install the cwheib.ttf to ~/.fonts and restart Libreoffice to try it again?
If you are using Libreoffice that come from Debian repository, remember to close the quickstarter for ensuring Libreoffice is "really" restarted.

Thanks for your testing~
Comment 19 Julien Nabet 2012-08-18 07:50:23 UTC
Thank you for your feedback winlin.
Sorry for my mistake, I reproduced the problem with master sources.

In fact the link http://cle.linux.org.tw/fonts/cwttf/center/cwheib.ttf is broken.
I installed the Debian package fonts-cwtex-heib

and runned fc-list,
# fc-list | grep cw
/usr/share/fonts/truetype/cwtex/cwheib.ttf: cwTeX 粗黑體,cwTeXHeiBold:style=Medium

Noticed on console, this log repeated endlessly:
warn:legacy.osl:11193:1:/home/julien/compile-libreoffice/libo/sw/source/core/text/frmform.cxx:298: SwTxtFrm::CalcFollow: cheesy follow
Comment 20 Roman Eisele 2012-08-18 07:58:52 UTC
Also still REPRODUCIBLE with MacOS X:
LibreOffice 3.6.1.1 (Build ID: 4db6344), German langpack installed, on MacOS X 10.6.8 (Intel), still freezes when I click the words "CLICK HERE WILL FREEZE WRITER", if and only if the font 'cwheib.ttf' is installed.
Comment 21 Roman Eisele 2012-08-18 08:02:21 UTC
@Caolán:

This long-standing issue seems related to font handling: I can reproduce the freeze only if the font 'cwheib.ttf' is installed. I insert you into the CC list because you have fixed many font-related bugs. Maybe you could take a look at this issue? This would be very much appreciated!

Thank you very much in advance!
Comment 22 Julien Nabet 2012-08-18 09:11:41 UTC
Created attachment 65727 [details]
bt on master on console trace

If it can help, I attached bt from console trace.
Comment 23 Julien Nabet 2012-08-18 12:23:48 UTC
From bt, I tried to compare the paths used, so I put a break frmform.cxx:576 (SwTxtFrm::FormatAdjust) and click each time just in front of "C", the first letter of catchphrase to be in exactly the same conditions.

When the font isn't used:
it never enter in this if:

    208     if( !pMyFollow->GetOfst() || pMyFollow->GetOfst() != nTxtOfst ||
    209         bFollowFld || pMyFollow->IsFieldFollow() ||
    210         ( pMyFollow->IsVertical() && !pMyFollow->Prt().Width() ) ||
    211         ( ! pMyFollow->IsVertical() && !pMyFollow->Prt().Height() ) )

pMyFollow->GetOfst() = 88 and nTxtOfst = 88 and all the cond are false so we don't enter in the if and so SwTxtFrm::CalcFollow isn't called

When the font is used:
it enters in the if as soon as first time
pMyFollow->GetOfst() = 0
nTxtOfst = 137

I'll try to dig more but I must recognize I don't know the meaning of all that.
Comment 24 winlin0330 2012-08-24 00:14:45 UTC
Created attachment 66038 [details]
The second file that freezed Writer.

Dear all:

I uploaded the second and third file (freeze2.odt and freeze3.odt) that would freeze Writer.

In freeze2.odt, delete the red area and click the yellow area, you will see a  freezed Writer.
Please take a look at the Paragraph 7 on page 3. There is only one line in table on page 3 after you deleted the red area of Paragraph 6, the "only one line in table on page 3" may make Writer get into the loop of creating and deleting a new page for the large table. I guess this is why Writer freezed.

On the other hand, the file freeze3.odt show us a different example.
The freeze3.odt had no page3, but if you add any character in Paragraph 6 or Paragraph 7 to make a new line for pushing Writer to creat page 3, Writer will freeze.

In freeze2.odt and freeze3.odt, we all see the "only one line in table on page 3" make Writer freeze. So I guess this maybe a problem of table behavior. But I think this may involve something wrong about chinese (or CJK) paragraph dealing mechanism in table, because I only meet this problem when I typing Chinese characters in a very long table ( and this table must goes across many pages).

Thanks a lot~
Comment 25 winlin0330 2012-08-24 00:16:05 UTC
Created attachment 66039 [details]
The third file that freezed Writer.
Comment 26 Julien Nabet 2013-05-11 18:41:32 UTC
On pc Debian x86-64 with master sources updated today, I gave a try to first file, we still have the same.
Comment 27 Michael Meeks 2013-05-15 09:52:45 UTC
Hi Julien:

Thanks so much for helping to debug this; I guess it's a layout loop - but ... ;-) anyhow - the best way to find where something is hanging in gdb is (after breaking) to type:

'finish'

repeatedly until it hangs - then you know it hung in that method.

Then break it again, and go up to that method and get the states of all the variables you can find in that loop.

Thanks anyhow ! :-)
Comment 28 minhsien0330 2013-05-15 12:03:26 UTC
Created attachment 79341 [details]
gdb info

Dear Julien and Michael Meeks:
I run gdb and got some output information(attachment: gdb.txt).
But I am not sure it will help or not.
Thanks.
Comment 29 Julien Nabet 2013-05-15 19:06:26 UTC
Created attachment 79359 [details]
bt finish + console logs

Michael: Hope you'll find something interesting in this.
Comment 30 Cédric Bosdonnat 2014-01-20 08:57:43 UTC
Restricted my LibreOffice hacking area
Comment 31 QA Administrators 2014-10-23 17:32:10 UTC Comment hidden (obsolete)
Comment 32 minhsien0330 2014-10-24 23:57:03 UTC Comment hidden (obsolete)
Comment 33 tommy27 2015-07-02 03:33:27 UTC
I see no freeze under Win8.1x64 using LibO 4.3.4 and 4.4.3
maybe a Linux specific issue? would you please retest with LibO 4.4.x (the .4 release is available)
Comment 34 minhsien0330 2015-07-03 12:02:33 UTC
I tested this two versions below, the bug was still there.

Version: 4.4.1.2 (Linux)
Build ID: 45e2de17089c24a1fa810c8f975a7171ba4cd432
Locale: zh_TW

Version: 4.4.3.2
Build ID: 88805f81e9fe61362df02b9941de8e38a9b5fd16
Locale: zh_TW (Linux)

My OS is Debian, I did not test Windows version yet.
Comment 35 Rodolfo 2016-05-08 20:47:34 UTC
Not reproducible with LibreOffice 5.1.3.1 Build ID: 1:5.1.3~rc1-1 Locale: pt-BR (pt_BR.utf8) Debian Testing.
Comment 36 minhsien0330 2016-05-11 13:51:26 UTC Comment hidden (obsolete)
Comment 37 minhsien0330 2016-06-05 00:59:28 UTC
LO  5.1.3.2 still has this bug.
(Debian testing 32bit)

Version: 5.1.3.2
Build ID: 644e4637d1d8544fd9f56425bd6cec110e49301b
CPU Threads: 2; OS Version: Linux 3.16; UI Render: default; 
Locale: zh-TW (zh_TW.UTF-8)

Thanks
Comment 38 Timur 2017-05-04 16:00:57 UTC
I change the title from too general to somewhat specific. Please test with new versions 5.3 and master 5.4. 
You may use Bash Script from http://pastebin.com/L6SFSYFR (just run /bin/LO-extract.sh) to Extract Parallel LO (no installation) from downloaded and unzipped LO folder with DEBS.
Comment 39 Julien Nabet 2017-05-13 17:53:25 UTC
On pc Debian x86-64 with master sources updated today, I still reproduce this.

On console, I still got this in loop:
warn:sw.core:20617:1:sw/source/core/text/porlay.cxx:405: SwLineLayout::CalcLine: bad ascent or height
warn:sw.core:20617:1:sw/source/core/text/porlay.cxx:405: SwLineLayout::CalcLine: bad ascent or height
warn:sw.core:20617:1:sw/source/core/text/porlay.cxx:405: SwLineLayout::CalcLine: bad ascent or height
warn:sw.core:20617:1:sw/source/core/text/porlay.cxx:405: SwLineLayout::CalcLine: bad ascent or height
warn:sw.core:20617:1:sw/source/core/text/porlay.cxx:405: SwLineLayout::CalcLine: bad ascent or height
warn:sw.core:20617:1:sw/source/core/text/porlay.cxx:405: SwLineLayout::CalcLine: bad ascent or height
warn:legacy.osl:20617:1:sw/source/core/text/frmform.cxx:284: SwTextFrame::CalcFollow: cheesy follow

Since the link of cwheib.ttf (which is mandatory to reproduce this) is broken, I installed this font from apt like last time (see https://bugs.documentfoundation.org/show_bug.cgi?id=31199#c19)

Michael: thought you might be interested in this one.
Comment 40 QA Administrators 2018-06-02 03:10:10 UTC Comment hidden (obsolete)
Comment 41 Julien Nabet 2020-01-12 16:17:12 UTC
On pc Debian x86-64 with master sources updated today, I could reproduce this partly.
Indeed, it does't freeze forever but for some second each time I click in yellow area.
Each time the following block appears 6 times:
warn:legacy.osl:201354:201354:sw/source/core/text/frmform.cxx:281: SwTextFrame::CalcFollow: cheesy follow
warn:legacy.osl:201354:201354:sw/source/core/text/frmform.cxx:281: SwTextFrame::CalcFollow: cheesy follow
warn:legacy.osl:201354:201354:sw/source/core/text/frmform.cxx:281: SwTextFrame::CalcFollow: cheesy follow
warn:legacy.osl:201354:201354:sw/source/core/text/frmform.cxx:281: SwTextFrame::CalcFollow: cheesy follow
warn:legacy.osl:201354:201354:sw/source/core/text/frmform.cxx:281: SwTextFrame::CalcFollow: cheesy follow
warn:legacy.osl:201354:201354:sw/source/core/text/frmform.cxx:281: SwTextFrame::CalcFollow: cheesy follow
warn:legacy.osl:201354:201354:sw/source/core/text/frmform.cxx:281: SwTextFrame::CalcFollow: cheesy follow
warn:legacy.osl:201354:201354:sw/source/core/text/frmform.cxx:281: SwTextFrame::CalcFollow: cheesy follow
warn:legacy.osl:201354:201354:sw/source/core/text/frmform.cxx:281: SwTextFrame::CalcFollow: cheesy follow
warn:legacy.osl:201354:201354:sw/source/core/layout/calcmove.cxx:1526: debug assertion: <SwContentFrame::MakeAll()> - format of text frame suppressed by fix b6448963

If needed, I can provide a bt from specific location or a Flamegraph.
Comment 42 Julien Nabet 2020-01-12 16:28:00 UTC
Created attachment 157086 [details]
perf flamegraph

Here's a Flamegraph retrieved on pc Debian x86-64 with master sources updated today.
With a non debug build, I see no freeze.
Comment 43 QA Administrators 2022-01-12 03:41:58 UTC Comment hidden (obsolete)
Comment 44 winlin0330 2022-01-25 10:59:20 UTC
I confirmed that LO 7.2.5.2(LINUX 64 bit deb) still has this bug.
This bug is inherited from OO.o.
Comment 45 QA Administrators 2024-01-26 03:14:27 UTC Comment hidden (obsolete)
Comment 46 winlin0330 2024-01-26 12:06:56 UTC
This bug has been around for a long time, and it hasn't been fixed in the past 14 years. I have already come up with alternative ways to work around it. Since it hasn't been addressed, I believe there is no need to invest more effort in fixing it. I suggest closing this bug report directly. Thanks.