Bug 8447

Summary: Host contamination in glibc-locales
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Ross Burton <ross.burton>
Component: coreAssignee: Juro Bystricky <juro.bystricky>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: Medium CC: joshuagloe, juro.bystricky, li.zhou, meta.mr.watcher, meta.watcher, randy.macleod, seebs
Version: 1.9   
Target Milestone: 2.3   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Ross Burton 2015-10-06 11:01:14 UTC
WARNING: QA Issue: glibc-locale: /glibc-binary-localedata-da-dk.iso-8859-1/usr/lib/locale/da_DK.ISO-8859-1/LC_PAPER is owned by uid 1000, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated]
Comment 1 Ross Burton 2016-02-11 14:27:31 UTC
This was likely caused by a bug in pseudo, which is now fixed in oe-core 4bd658f7dae76ae8790fd1dfdd89fa58a456a0a4.
Comment 2 Ross Burton 2016-06-13 21:53:38 UTC
Replicated with current master (poky a1a0ce1a0064e29159555011ebd667192132e0ce) with a clean tmp and no sstate.
Comment 3 Ross Burton 2016-06-13 21:57:06 UTC
Considering this is random and doesn't always hit, I'd still consider pseudo to be a suspect here.  Peter, what's a good way to start investigating this from the pseudo side?  Inspect the log or sqlite database for clues?
Comment 4 Ross Burton 2016-06-14 13:37:44 UTC
More data:

WARNING: glibc-locale-2.24-r0 do_package_qa: QA Issue: glibc-locale: /glibc-binary-localedata-fr-lu/usr/lib/locale/fr_LU/LC_MEASUREMENT is owned by uid 1000, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated]

$ dpkg -c glibc-binary-localedata-fr-lu_*
drwxrwxrwx root/root         0 2016-06-14 14:26 ./
drwxr-xr-x root/root         0 2016-06-14 14:23 ./usr/
drwxr-xr-x root/root         0 2016-06-14 14:23 ./usr/lib/
drwxr-xr-x root/root         0 2016-06-14 14:23 ./usr/lib/locale/
drwxr-xr-x root/root         0 2016-06-14 14:23 ./usr/lib/locale/fr_LU/
drwxr-xr-x root/root         0 2016-06-14 14:23 ./usr/lib/locale/fr_LU/LC_MESSAGES/
-rw-r--r-- root/root        60 2016-06-14 14:22 ./usr/lib/locale/fr_LU/LC_MESSAGES/SYS_LC_MESSAGES
-rw-r--r-- root/root   1243766 2016-06-14 14:22 ./usr/lib/locale/fr_LU/LC_COLLATE
-rw-r--r-- root/root      2354 2016-06-14 14:22 ./usr/lib/locale/fr_LU/LC_TIME
-rw-r--r-- root/root       156 2016-06-14 14:22 ./usr/lib/locale/fr_LU/LC_ADDRESS
-rw-r--r-- root/root        62 2016-06-14 14:22 ./usr/lib/locale/fr_LU/LC_NAME
-rw-r--r-- root/root        50 2016-06-14 14:22 ./usr/lib/locale/fr_LU/LC_TELEPHONE
-rw-r--r-- root/root       348 2016-06-14 14:22 ./usr/lib/locale/fr_LU/LC_IDENTIFICATION
-rw-r--r-- root/root        34 2016-06-14 14:22 ./usr/lib/locale/fr_LU/LC_PAPER
-rw-r--r-- root/root        54 2016-06-14 14:22 ./usr/lib/locale/fr_LU/LC_NUMERIC
-rw-r--r-- 1000/pulse       23 2016-06-14 14:22 ./usr/lib/locale/fr_LU/LC_MEASUREMENT
-rw-r--r-- root/root    317872 2016-06-14 14:22 ./usr/lib/locale/fr_LU/LC_CTYPE
-rw-r--r-- root/root       294 2016-06-14 14:22 ./usr/lib/locale/fr_LU/LC_MONETARY
Comment 5 Ross Burton 2016-06-16 15:16:12 UTC
Peter, the file that gets the wrong ownership appears to change randomly so I'm fairly convinced that this is due to pseudo losing track of files somehow.
Comment 6 li.zhou 2016-08-15 09:51:32 UTC
I met such issue occasionally too, and hard to reproduce. I notice there is pseudo upgrade recently. Does it work on this issue? Thanks.
Comment 7 Seebs 2016-08-15 16:00:59 UTC
This could be related to the hardlinking behavior previously discussed. Are any of these files hard links to files that aren't tracked in pseudo?
Comment 8 li.zhou 2016-08-16 02:49:56 UTC
@Seebs:
    Thanks for your answer. Is there any link to the discussion you mentioned? Per my understanding to your answer, those files shouldn't be hard links. The files that have been recorded are listed as below:
/glibc-binary-localedata-es-es/usr/lib64/locale/es_ES/LC_MEASUREMENT
/glibc-binary-localedata-pap-aw/usr/lib/locale/pap_AW/LC_TIME
/glibc-binary-localedata-pa-pk/usr/lib64/locale/pa_PK/LC_MESSAGES/SYS_LC_MESSAGES
/glibc-binary-localedata-ar-kw/usr/lib64/locale/ar_KW/LC_CTYPE
They are quite similar with this original issue </glibc-binary-localedata-da-dk.iso-8859-1/usr/lib/locale/da_DK.ISO-8859-1/LC_PAPER>. 

I think there are many similar locale files in those locale packages. And we just occasionally get the wrong uid with a very low frequency (each time with a different file).
Comment 9 li.zhou 2016-11-22 02:33:08 UTC
After we integrate http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/meta?id=577ff4e3dd4efe3b129a10eabedf620cfb7a2fa8 , the frequency of this issue has certainly decreased from 5-10 times/ month to < 1 time / month. Since the commit was just in our code from mid September, we only have done limit observation.  We'll continue to watch for additional errors in the next month.
Comment 10 Randy MacLeod 2016-12-19 15:51:12 UTC
And after a month of running 100s of builds/day, we still have NOT seen another failure so this defect can be closes @seebs.
Comment 11 Juro Bystricky 2017-05-11 15:16:23 UTC
(In reply to comment #10)
> And after a month of running 100s of builds/day, we still have NOT seen
> another failure so this defect can be closes @seebs.

This was observed again, I actually filed a new bug report, unaware of this one.
https://bugzilla.yoctoproject.org/show_bug.cgi?id=11299

So I close this one as a duplicate.

*** This bug has been marked as a duplicate of bug 11299 ***