[Webkit-unassigned] [Bug 61031] [Qt] QtWebKit based browsers on Mac crash when displaying some pages with web fonts

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Nov 14 08:03:37 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=61031





--- Comment #8 from Michał Łubiński <mlubinski at milosolutions.com>  2012-11-14 08:05:24 PST ---
Created an attachment (id=174160)
 --> (https://bugs.webkit.org/attachment.cgi?id=174160&action=review)
Qt 4.8.3, Mac OS X 10.8.2

Reproduced with Qt 4.8.3 build from sources (QtWebKit 2.2.3) on my app on Mac OS X 10.8.2 (application was tested on Windows and Linux and worked well).

Here is thing that should interest devs.

Because of the size of QtWebKit sources I didn't have debug version of this framework. Instead of that I tried to find some hints what is wrong by simple fprintf's. ;) I checked 

    4   QtGui  0x0000000100b1fd07 QCoreTextFontEngine::QCoreTextFontEngine(__CTFont const*, QFontDef const&) + 273

and found out that the line which is related with the crash is:

    cgFont = CTFontCopyGraphicsFont(font, NULL);

Because there is no CTFontCopyGraphicsFont() call on the stacktrace I concluded that there is something wrong while performing operator=. But to be absolutely sure that CTFontCopyGraphicsFont works I made change in the code:

    CTFontCopyGraphicsFont(font, NULL);
    cgFont = CTFontCopyGraphicsFont(font, NULL);

For some reason it stopped crashing. Despite the fact that the function is from QtGui I'm pretty sure that the bug is related with @font-face and font cache. My app was crashing while processing font which was downloaded in a result of using font-face. Unfortunately I can't show any snippet of the code because this is commercial project, but I'll try to explain work of the app related with this bug. 

We have two webpages A and B. Webpage A has two tabs.

After rendering of webpage A, I can switch between tabs without rendering of complete webpage (e.g. when I'm switching to the second tab, images in the background are still on the screen, only part of the content is changing). At the first load of the page, fonts from font-face, printed to the console with toString() look like that:

    http://example.com/css/SomeFont.ttf,-1,17,5,50,0,0,0,0,0

When switching between tabs, fonts printed on console look like that:

    Some Font,-1,17,5,50,0,0,0,0,0

so they're already in local cache (?). I was able to switch between tabs of webpage A for as many times as I want without any crash. But after loading webpage B (which is also using same fonts) it crashes. Font info printed on console indicates that font is loaded locally:

    Some Font,-1,17,5,50,0,0,0,0,0

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list