Bug 37449 - Crash when previewing the Pgtextje.ttf font in the font list
Summary: Crash when previewing the Pgtextje.ttf font in the font list
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
3.5.4 release
Hardware: x86 (IA32) Windows (All)
: high critical
Assignee: Caolán McNamara
URL:
Whiteboard: target:4.1.0 target:4.0.0.2 target:3.6.6
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-21 22:23 UTC by pierre-yves samyn
Modified: 2013-11-15 11:28 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Crash screenshot (9.17 KB, image/png)
2011-05-21 22:23 UTC, pierre-yves samyn
Details
Font Pgtextje.ttf (50.65 KB, application/x-font-ttf)
2013-01-11 16:46 UTC, pierre-yves samyn
Details
ZIP Archive of Roboto fonts. (1.17 MB, application/x-zip-compressed)
2013-01-15 05:09 UTC, Kedar Bhise
Details
Bug 37449 - WinDbg session (9.18 KB, text/plain)
2013-01-15 12:28 UTC, bfoman (inactive)
Details
Screenshot showing empty font preview (63.71 KB, image/png)
2013-01-30 07:39 UTC, Kedar Bhise
Details
Screenshot FontPreviewOk.png (5.65 KB, image/png)
2013-01-30 08:46 UTC, pierre-yves samyn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pierre-yves samyn 2011-05-21 22:23:10 UTC
Created attachment 46985 [details]
Crash screenshot

Hello

Build Date & Platform: XP 3.4RC1 Libo BuildID = 340m1 (Build: 11)

Steps to reproduce:

- Install Pgtextje.ttf font available here http://omnibuus.com/font-download/
- Open a document (writer, calc ...) (or create a new one)
- Scroll through the list of fonts to display Pgtextje

Expected result : Preview of the font
Actual result: Crash cf. attached screenshot

Additional Information: 

- It seems that this font be installed by "Band in a Box" (music software
quite common).
- Other fonts installed by this software (pgchords, pgjazz, pgmus, pgtext, pgtextj) does not pose a problem
- Police Pgtextje.ttf not crashed with previous versions of Libo

Tested on [fr-discuss]
- Reproduced on XP
- Not reproduced on Ubuntu 10.04 64-bit

May be related to: https: / / bugs.freedesktop.org / show_bug.cgi? id = 37035

Best regards
Comment 1 Rainer Bielefeld Retired 2011-05-24 13:26:32 UTC
[Reproducible] with "LibreOffice 3.4.0RC1  – WIN7  Home Premium  (64bit) German UI [OOO340m1 (Build:11)]", LibO stops responding as soon as "Pgtextje" appears in the Font selection pulldown.

EditPad Lite does not crash, also no problem with OOo 3.1.1 and 3.4-dev
Comment 2 Björn Michaelsen 2011-12-23 12:04:48 UTC
[This is an automated message.]
This bug was filed before the changes to Bugzilla on 2011-10-16. Thus it
started right out as NEW without ever being explicitly confirmed. The bug is
changed to state NEEDINFO for this reason. To move this bug from NEEDINFO back
to NEW please check if the bug still persists with the 3.5.0 beta1 or beta2 prereleases.
Details on how to test the 3.5.0 beta1 can be found at:
http://wiki.documentfoundation.org/QA/BugHunting_Session_3.5.0.-1

more detail on this bulk operation: http://nabble.documentfoundation.org/RFC-Operation-Spamzilla-tp3607474p3607474.html
Comment 3 pierre-yves samyn 2011-12-24 04:21:42 UTC
Hello

Still persists with LOdev 3.5.0beta2+Build ID: 62b9587-7ef74e0-7bf1c81
Comment 4 Sciuriware 2012-06-09 02:07:02 UTC
I hereby confirm that LibreOffice Writer 3.5.4.2 crashes when trying to edit
any document that (entirely) contains TTF fonts.
The behaviour is awkward: the crash happens on a mouse move.
It is possible to print when using Alt and some keys.
;JOOP!
Comment 5 Julien Nabet 2012-08-18 21:17:40 UTC
pierre-yves: http://omnibuus.com/font-download/ doesn't work, do you know where one can download this font?

Joop: what ttf font do you use? Could you attach the doc?
Comment 6 pierre-yves samyn 2012-08-25 15:52:24 UTC
Hello

(In reply to comment #5)
> pierre-yves: http://omnibuus.com/font-download/ doesn't work, do you know where
> one can download this font?
> 

Indeed, the link is no longer active ... Unfortunately I did not find other (the font is installed with the software and is therefore perhaps not free ...).

However, the bug persists of course with Version 3.6.1.2 (Build ID: e29a214)

Regards
Pierre-Yves
Comment 7 Julien Nabet 2012-08-28 21:46:27 UTC
Pierre-Yves Samyn: Thank you for your feedback, put it at NEW.
Comment 8 Julien Nabet 2013-01-09 22:03:29 UTC
pierre-yves samyn: I don't know if it's still relevant with last LO version (3.6.4) but if it's the case, would it be possible you attach the font?
The goal is to test and retrieve a bt
Comment 9 pierre-yves samyn 2013-01-11 16:46:47 UTC
Created attachment 72868 [details]
Font Pgtextje.ttf
Comment 10 pierre-yves samyn 2013-01-11 16:48:10 UTC
(In reply to comment #8)
> pierre-yves samyn: I don't know if it's still relevant with last LO version
> (3.6.4) but if it's the case, would it be possible you attach the font?
> The goal is to test and retrieve a bt

Done...
Still occurs with Version 4.0.0.0.beta1+ (Build ID: 546faa79bf3b1e4b222f182d43a9839106a398d)

Regards
Pierre-Yves
Comment 11 Julien Nabet 2013-01-11 21:12:12 UTC
On pc Debian x86-64 with master sources and 4.0, both updated today, I don't reproduce this.
I don't reproduce this too with 3.6 sources updated some days ago and Debian package 3.5.4.

However I had a crash with 3.6.4.3 on Win7 so put it at NEW
Pierre-Yves: thank you for you feedback.

bfoman: would it be possible to have a bt of this one?
Comment 12 Kedar Bhise 2013-01-15 05:05:34 UTC
I also see this behaviour on Version 3.6.4.3 (Build ID: 2ef5aff), Win XP, SP3.

I have just installed a new font called Roboto. I am attaching the relevant zip file separately.

I am able to scroll through the font list till I reach "R". At which point, LO crashes. Crash happens even if I type "R" in the font combo box.

Is this a duplicate of 44595?
Comment 13 Kedar Bhise 2013-01-15 05:09:31 UTC
Created attachment 73045 [details]
ZIP Archive of Roboto fonts.
Comment 14 Kedar Bhise 2013-01-15 09:55:10 UTC
Did some research on this issue. Led me to this page:

http://ask.libreoffice.org/en/question/9085/scrolling-through-fonts-causes-crash/

Tried both workarounds mentioned in the page:

1. Disable Font preview via:
Menu Tools → Options → LibreOffice → View →
Font Lists
☐ Show preview of fonts (disabled).

This option works. My LO no longer crashes when scrolling through Fonts combo box.

2. Have you try resetting the user profile? Sometimes solve strange issues. http://wiki.documentfoundation.org/UserProfile

Created a fresh user profile as suggested in the wiki. This does not work. LO using the fresh profile also crashes when scrolling through Fonts combo box.

Hope this is useful.
Comment 15 bfoman (inactive) 2013-01-15 12:28:18 UTC
Created attachment 73078 [details]
Bug 37449 - WinDbg session

(In reply to comment #11)
> bfoman: would it be possible to have a bt of this one?

Confirmed with:
LO 3.5.6.2 
Build ID: own W7 debug build
Windows 7 Professional SP1 64 bit

Attached full WinDbg session with mini dump file loaded generated by procdump soffice.bin -h.

Checked with:
LO 4.0.0.1
Build ID: own W7 debug build
Windows 7 Professional SP1 64 bit

Could not reproduce.
Comment 16 Julien Nabet 2013-01-15 12:40:24 UTC
bfoman: thank you for your bt very useful!

Caolán: one for you?
Comment 17 Julien Nabet 2013-01-15 12:58:15 UTC
I noticed that in svtools/source/misc/sampletext.cxx, function rtl::OUString makeShortRepresentativeTextForSelectedFont(OutputDevice &rDevice), 
"maUnicodeRange"  from "aFontCapabilities" is initialized

l1163 :aFontCapabilities maUnicodeRange &= getCommonLatnSubsetMask();

but nothing for maCodePageRange, perhaps missed it? (didn't find an equivalent function to getCommonLatnSubsetMask for maCodePageRange)

So obviously these lines can't work:
   1076             boost::dynamic_bitset<sal_uInt32> aMaskedCodePage =
   1077                 rFontCapabilities.maCodePageRange & aCJKCodePageMask;
   1078             //fold Korean
   1079             if (aMaskedCodePage[vcl::CodePageCoverage::CP1361])

(now why does it work for non Windows env?)
Comment 18 Caolán McNamara 2013-01-15 16:00:40 UTC
re: "I noticed that in svtools/source/misc/sampletext.cxx, function rtl::OUString makeShortRepresentativeTextForSelectedFont(OutputDevice &rDevice), 
"maUnicodeRange"  from "aFontCapabilities" is initialized

1163 :aFontCapabilities maUnicodeRange &= getCommonLatnSubsetMask();"

actually maUnicodeRange and maCodePageRange are initialized in the earlier call at line 1153 to GetFontCapabilities, its just that we remove the common the "latin/common" bits from the maUnicodeRange as typically all fonts support those are we want to remove them to see if the font is particularly tuned for some specific script.
Comment 19 Caolán McNamara 2013-01-15 16:13:39 UTC
on the other hand that getfontcapabilities will return ok if there is unicode range info, but no codepage info, so it can indeed be empty there now that you point it out :-)
Comment 20 Not Assigned 2013-01-15 16:37:31 UTC
Caolan McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5cd7c8906150b94c224ab9bc9f850684198c7f04

Resolves: fdo#37449 apparent access into empty codepage bitset



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 21 Caolán McNamara 2013-01-15 16:47:09 UTC
I can't locally reproduce this, but from the bt the above commit very likely fixes this. Proposed for 3-6 and 4-0 now as a fix. There won't be another 3-5, so marking as resolved.

If someone is able to test this, e.g. tomorrows windows dailies so confirm that this works/fails I'd much appreciate that
Comment 22 Not Assigned 2013-01-16 11:10:19 UTC
Caolan McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-4-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=3d35098b33d08e0105f8093898d833ec367e3949&h=libreoffice-4-0

Resolves: fdo#37449 apparent access into empty codepage bitset


It will be available in LibreOffice 4.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 23 Not Assigned 2013-01-17 08:18:24 UTC
Caolan McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-3-6":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1c43325d953a409ec9566c318e62a01a1523ad77&h=libreoffice-3-6

Resolves: fdo#37449 apparent access into empty codepage bitset


It will be available in LibreOffice 3.6.6.

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 24 Kedar Bhise 2013-01-30 07:35:32 UTC
(In reply to comment #21)
> I can't locally reproduce this, but from the bt the above commit very likely
> fixes this. Proposed for 3-6 and 4-0 now as a fix. There won't be another
> 3-5, so marking as resolved.
> 
> If someone is able to test this, e.g. tomorrows windows dailies so confirm
> that this works/fails I'd much appreciate that

Tried with Version 4.0.0.2 (Build ID: 5991f37846fc3763493029c4958b57282c2597e)

The Crash problem seems to have been fixed. I can scroll through the font list completely. However, font previews are no longer visible.

Confirmed that Font preview is enabled via:
Menu Tools → Options → LibreOffice → View →
Font Lists
☐ Show preview of fonts (enabled)
Comment 25 Kedar Bhise 2013-01-30 07:39:02 UTC
Created attachment 73907 [details]
Screenshot showing empty font preview

The font list is scrollable but all the font previews are missing. Only visible preview is that for "Symbol".
Comment 26 pierre-yves samyn 2013-01-30 08:45:35 UTC
Hello

No more crash with Version 4.0.0.2 (Build ID: 5991f37846fc3763493029c4958b57282c2597e) & Windows XP Pro

Tested with Tools → Options → LibreOffice → View → Font Lists → Show preview of fonts enabled and disabled.

Preview seems ok (see FontPreviewOk.png screenshot)

Thank you

Regards
Pierre-Yves
Comment 27 pierre-yves samyn 2013-01-30 08:46:17 UTC
Created attachment 73910 [details]
Screenshot FontPreviewOk.png
Comment 28 Caolán McNamara 2013-01-30 12:54:54 UTC
caolanm->kedarbhise: there is another bug open somewhere about "missing font previews under windows", which appears unrelated to this specific crash
Comment 29 Kedar Bhise 2013-01-30 13:14:39 UTC
(In reply to comment #28)
> caolanm->kedarbhise: there is another bug open somewhere about "missing font
> previews under windows", which appears unrelated to this specific crash

Caolán,

Thanks for the fix.

After a system restart, LO was able to display font previews correctly. So, no complaints on that front.

However, the crash problem is recurring, albeit for a specific font. I have now uninstalled that font from my system as a workaround.

Let me know if I should reopen this one and attach that specific font or file a new bug.
Comment 30 Caolán McNamara 2013-01-30 15:09:39 UTC
If you've got another font that crashes LibreOffice, file a new bug for it and put me on cc and mention where the font is available. Attach it only if its the font is allowed to be redistributed.
Comment 31 Kedar Bhise 2013-01-31 06:08:31 UTC
(In reply to comment #30)
> If you've got another font that crashes LibreOffice, file a new bug for it
> and put me on cc and mention where the font is available. Attach it only if
> its the font is allowed to be redistributed.

Thanks!

Filed new bug 60102 as per suggestion above.