Bug 4179

Summary: Sato shows squares instead of text
Product: [Runtime] General Runtime Reporter: Paul Eggleton <bluelightning>
Component: General RuntimeAssignee: Laurentiu Palcu <laurentiu.palcu>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: High CC: ross.burton, sgw, sstncr, tom.zanussi
Version: unspecified   
Target Milestone: 1.4 M6   
Hardware: Other   
OS: arm   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---
Bug Depends on:    
Bug Blocks: 4203    
Attachments:
Description Flags
Screenshot showing the issue
none
update_font_cache intercept script output none

Description Paul Eggleton 2013-04-03 08:48:26 UTC
Created attachment 1149 [details]
Screenshot showing the issue

Building core-image-sato partially from sstate for qemuarm with latest master, I see that instead of the text being displayed properly I see squares as if the correct font were not installed (see attached screenshot). I haven't checked yet to see if other machines are affected.
Comment 1 Paul Eggleton 2013-04-03 11:02:15 UTC
Additional info: when shutting down I can see the following warnings on the console:

(matchbox-desktop:447): Pango-WARNING **: failed to choose a font, expect ugly output. engine-type='PangoRenderFc', script='latin'
(matchbox-desktop:447): Pango-WARNING **: failed to choose a font, expect ugly output. engine-type='PangoRenderFc', script='common'

Additionally, comparing buildhistory output for a recently built image on another machine that does work, I can see that in the broken image /etc/pango/pango.modules is empty as is /etc/gtk-2.0/gtk.immodules.
Comment 2 Paul Eggleton 2013-04-03 11:06:10 UTC
Even more, from log.do_rootfs:

Running intercept scripts:
> Executing update_font_cache
WARNING: intercept script "update_font_cache" failed, falling back to running postinstalls at first boot
> Executing update_icon_cache
> Executing update_pixbuf_cache
WARNING: intercept script "update_pixbuf_cache" failed, falling back to running postinstalls at first boot
Comment 3 Paul Eggleton 2013-04-03 18:51:25 UTC
Created attachment 1155 [details]
update_font_cache intercept script output

I just did a from-scratch rebuild on the same machine; same result.

Laurentiu and I have discussed the issue and with some extra logging have found the attached errors from the intercept script that calls fc-cache which might hint at the problem; the update_pixbuf_cache script is similarly afflicted. My guess at the moment based upon the error and what a Google search turns up about it is some bad interaction between pseudo, qemu and AppArmor (I'm using Ubuntu 12.10 as a host distribution which enables AppArmor by default). However a test running the ARM ld-2.17.so binary under qemu-arm within pseudo didn't appear to cause any issues.
Comment 4 Paul Eggleton 2013-04-04 13:42:57 UTC
Upon further investigation this is nothing to do with pseudo or apparmor. Laurentiu and I have boiled the test down to an invocation outside of the build system of qemu-arm as follows:

export D=/path/to/rootfs
export PATH="$PATH:/path/to/native/sysroot"
qemu-arm $D/lib/ld-2.17.so --library-path $D/lib:$D/usr/lib $D/usr/bin/fc-cache --help

This fails with:

/path/to/usr/bin/fc-cache: error while loading shared libraries: /path/to/usr/bin/fc-cache: failed to map segment from shared object: Operation not permitted

With some experimentation it has been found that either specifying the base address to qemu-arm with -B 1048576 or setting /proc/sys/vm/mmap_min_addr to 0 fixes the problem.

Laurentiu cannot reproduce this issue on his machine and has the same default /proc/sys/vm/mmap_min_addr value (65536). His host OS is 64-bit whereas mine is 32-bit, if that makes any difference.
Comment 5 Laurentiu Palcu 2013-04-05 14:36:48 UTC
I sent a fix for this on the ML.
Comment 7 Tom Zanussi 2013-04-08 19:27:41 UTC
Still seeing this with sugarbay, as of 02ae9b357676c904721d92a9c6f74ecc6b7a4476.
Comment 8 Laurentiu Palcu 2013-04-09 09:16:07 UTC
Apparently there was another issue introduced recently, when using RPM, making run-postinsts script to not be deployed on target. So, if the postinstalls failed on host, they were not run on target either. Patch sent on the ML to fix this issue.
Comment 10 Stefan Stanacar 2013-04-10 12:13:28 UTC
On commit 1b93e2bc913af90b6a8274215ae9848ee628198b, I still have this problem but only on core-image-sato-sdk (machine qemux86-64); core-image-sato it's okay.
The postinstall scripts aren't run because it seems that sato-sdk pulls opkg which installs it's own run-postinst script.
My local.conf has PACKAGE_CLASSES ?= "package_rpm"
Comment 11 Laurentiu Palcu 2013-04-10 12:53:45 UTC
Reopening because we found another issue (happening for core-image-sato-sdk), leading to the same problem. Apparently, opkg postinstall overwrites the run-postinsts script and rpm postinstalls do not have a chance to run...
Comment 12 Laurentiu Palcu 2013-04-11 06:44:07 UTC
Sent a fix for the run-postinsts script overwriting.
Comment 13 Laurentiu Palcu 2013-04-11 11:31:07 UTC
The fix for run-postinsts overwriting has been merged. Marking the bug as fixed and, hopefully, will stay this way:

http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=8b29120a8cdd92a0429f383f4811f7f84c6c350e
Comment 14 Stefan Stanacar 2013-04-11 15:47:42 UTC
Verified in poky master:c567366d3b933d6a840e793845f81c3ecbe83585