0

How webkit3 resolve its primary font on Linux?

(Got a segmentation fault in libwebkitgtk-3.0. Anybody has seen similar problem? Is there a way to work-around it? How to debug or fix it with minimal change to the system?)

The gdb prints:

Program received signal SIGSEGV, Segmentation fault.
0x74a1bc87 in WebCore::RenderStyle::fontMetrics() const () from /lib/libwebkitgtk-3.0.so.0

The gdb backtrace after installed debuginfo:

(gdb) bt
#0  primarySimpleFontData (...) at Source/WebCore/platform/graphics/FontGlyphs.h:123
#1  primaryFont           (...) at Source/WebCore/platform/graphics/Font.h:326
#2  fontMetrics           (...) at Source/WebCore/platform/graphics/Font.h:143
#3  WebCore::RenderStyle::fontMetrics 
                          (...) at Source/WebCore/rendering/style/RenderStyle.cpp:1335
#4  0x74a1bea3 in WebCore::RenderStyle::computedLineHeight 
                          (...) at Source/WebCore/rendering/style/RenderStyle.cpp:1376
#5  0x7488ef06 in WebCore::RenderBlock::lineHeight 
                          (...) at Source/WebCore/rendering/RenderBlock.cpp:6651

Steps lead to this:

Install pyjs.org following its readme file, set the virtualenv to pyjsroot/mypy. 
Install webkitgtk3 and pygobject3.
Source an environment setting file to set PATHONPATH to pyjsroot:/lib/python2.7/site-packages
Run in pyjsroot "mypy/bin/python examples/helloworld/Hello.py"

Edit: Added the gdb backtrace. The backtrace tells me webkit could not resolve "primary font" properly. Change title from old "segmentation in libwebkitgtk-3.0 on fedora 20 when running pyjs" to reflect this.

minghua
  • 5,981
  • 6
  • 45
  • 71
  • because the fault is in WebCore in libwebkitgtk, I'm thinking whether there is a configuration to set the font so as to fix or avoid the problem. – minghua May 19 '14 at 18:38

1 Answers1

0

Changed to Frdora 21, the segmentation fault is gone, but it does not show characters properly. Installed the following packages then everything is ok.

xorg-x11-fonts-ISO8859-1-100dpi

gnu-free-fonts-common
gnu-free-mono-fonts
gnu-free-sans-fonts
gnu-free-serif-fonts

Not sure the xorg-x11-fonts-ISO8859-1-100dpi is needed or not, but it does bring in dependencies. Among the gnu-free-*, the -common is needed, and one of the other three is needed. Without installing all the other three, the characters will just be show in whatever font is installed.

The above fonts should also solve the problem on Fedora 20.

minghua
  • 5,981
  • 6
  • 45
  • 71