Bug 75951 - [Qt] DRT crashes with Qt 5
Summary: [Qt] DRT crashes with Qt 5
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Hausmann
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-10 03:51 PST by Simon Hausmann
Modified: 2012-01-10 04:12 PST (History)
3 users (show)

See Also:


Attachments
Patch (1.50 KB, patch)
2012-01-10 03:54 PST, Simon Hausmann
ossy: review+
hausmann: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Hausmann 2012-01-10 03:51:48 PST
Various layout tests crash with the DRT and Qt 5 due to a subtle font-config issue. The backtraces indicate that an empty
font-family causes crashes with atomic string. The root cause is the fact that the default font family returned by Qt is
an empty string, which is not a valid situation.

In Qt 4.8 the default font / family was "Helvetica". In Qt 5 the default is queried from font-config by doing the programmatic
equivalent of running "fc-match" on the commandline, in src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp.
You can verify this by calling 'ltrace fc-match' and comparing the font-config commands to what's being done in QFontconfigDatabase::resolveFontFamilyAlias.

In a normal "Linux" system the default is defined through a rule like this (from /etc/fonts/conf.d/49-sansserif.conf) :


<!--
  If the font still has no generic name, add sans-serif
 -->
       <match target="pattern">
              <test qual="all" name="family" compare="not_eq">
                     <string>sans-serif</string>
              </test>
              <test qual="all" name="family" compare="not_eq">
                     <string>serif</string>
              </test>
              <test qual="all" name="family" compare="not_eq">
                     <string>monospace</string>
              </test>
              <edit name="family" mode="append_last">
                     <string>sans-serif</string>
              </edit>
       </match>


This ensures the "last resort fallback", and indeed this is missing in _our_ fonts.conf in Tools/DumpRenderTree/qt/fonts.conf.
Comment 1 Simon Hausmann 2012-01-10 03:54:57 PST
Created attachment 121825 [details]
Patch
Comment 2 Csaba Osztrogonác 2012-01-10 04:02:36 PST
Comment on attachment 121825 [details]
Patch

LGTM,r=me.
Comment 3 Simon Hausmann 2012-01-10 04:12:04 PST
Committed r104551: <http://trac.webkit.org/changeset/104551>
Comment 4 Simon Hausmann 2012-01-10 04:12:43 PST
Comment on attachment 121825 [details]
Patch

oops, landed manually