Bug 8028 - Garbage in SDK manifest file
Summary: Garbage in SDK manifest file
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 1.8
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 2.0.3
Assignee: Armin Kuster
QA Contact: Bogdan Alexandru Voiculescu
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-07-17 15:05 UTC by Paul Eggleton
Modified: 2016-10-03 19:48 UTC (History)
7 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
Selftest for manifest files (1.71 KB, patch)
2015-08-24 17:09 UTC, Mariano Lopez
no flags Details | Diff
oeqa.selftest.manifest.VerifyManifest tests log (1.28 KB, text/plain)
2015-09-03 04:26 UTC, Benjamin Esquivel
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Eggleton 2015-07-17 15:05:58 UTC
I just build an SDK (bitbake -c populate_sdk core-image-minimal) and both the host and target manifests seem to be prefixed with some log output that shouldn't be there (presumably from berkeleydb, I'm using RPM packaging):

------------- snip -------------
BDB2053 Freeing read
BDB2053 Freeing read
BDB2053 Freeing read
BDB2053 Freeing read
BDB2053 Freeing read
binutils-cross-canadian-x86-64 x86_64-nativesdk 2.25
gcc-cross-canadian-x86-64 x86_64-nativesdk 4.9.3
...
------------- snip -------------
Comment 1 Mariano Lopez 2015-07-29 22:17:24 UTC
I'm not able to reproduce the bug. I have found these tracebacks are because something crashes while reading the rpmdb or exists without cleaning. I would like to reproduce it in order to start working on this. Are you using a RPM based distro? Can you reproduce this error easily? Can you explain more the steps to reproduce it?
Comment 2 Mariano Lopez 2015-08-17 21:36:53 UTC
Tried to reproduce it on a Fedora system without any luck. Also tried to reproduce in a Fedora system with three simultaneous builds but couldn't regenerate the issue.
Comment 3 Mariano Lopez 2015-08-24 17:09:06 UTC
Created attachment 2678 [details]
Selftest for manifest files
Comment 4 Mariano Lopez 2015-08-24 17:11:05 UTC
I'm not able to reproduce the bug yet, nevertheless Paul can reproduce it very easily. The last comment contains a patch for a new selftest to check the manifest files against pkgdata. It needs some work but it's a start
Comment 5 Benjamin Esquivel 2015-08-25 22:53:29 UTC
Mariano, would you send your patch to the list? I would like to send another one on top of yours.
Comment 6 Benjamin Esquivel 2015-08-26 20:08:20 UTC
Paul, I'm a little confused with your manifests you're reporting here, when I build SDK (bitbake -c populate_sdk core-image-minimal) like you mention in the first comment, I get no manifests created in the DEPLOY_DIR_IMAGE.

Is this the dir where you're seeing it?
Comment 7 Benjamin Esquivel 2015-08-26 21:18:32 UTC
A test for checking that all the lines of a manifest correspond to a package was proposed in:

http://lists.openembedded.org/pipermail/openembedded-core/2015-August/109472.html
Comment 8 Benjamin Esquivel 2015-08-26 21:18:56 UTC
Waiting on Paul's comments
Comment 9 Paul Eggleton 2015-08-26 22:07:51 UTC
${SDK_DEPLOY} is where you should see the manifests for built SDKs (along with the SDK itself) i.e. tmp/deploy/sdk.
Comment 10 Benjamin Esquivel 2015-08-27 22:44:51 UTC
Thanks Paul, I checked ${SDK_DEPLOY} for the error you mention and I did not obtain it though. I will proceed to create the test for the manifest of the SDK as well, I expect to send the patch tomorrow.

In the meantime, any other pointer as to why you are able to obtain those error messages so easily?
Comment 11 Benjamin Esquivel 2015-08-28 22:12:06 UTC
Paul, under which context can SDK_DEPLOY be found? I believe oe self-tests execute bitbake -p and -e to get the variables but the get_bb_var('SDK_DEPLOY') fails to get it.
Comment 12 Paul Eggleton 2015-08-29 11:32:18 UTC
You'll need to be querying it for an image (e.g. the one you've built the SDK for) i.e. get_bb_var('SDK_DEPLOY', 'core-image-minimal')
Comment 13 Benjamin Esquivel 2015-09-03 04:26:00 UTC
Created attachment 2702 [details]
oeqa.selftest.manifest.VerifyManifest tests log
Comment 14 Benjamin Esquivel 2015-09-03 04:26:55 UTC
a patch V2 was sent to the list

http://lists.openembedded.org/pipermail/openembedded-core/2015-September/109907.html
Comment 15 Benjamin Esquivel 2015-09-21 16:32:11 UTC
A patch V3 will be required for modifying the test to ignore old manifests in the dir and avoid false negatives
Comment 16 Benjamin Esquivel 2015-09-22 22:38:01 UTC
A pointer to look in the  meta/classes/testimage.bbclass, specifically the following line:

manifest = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True), d.getVar("IMAGE_LINK_NAME", True) + ".manifest")
Comment 18 Paul Eggleton 2015-10-29 10:10:22 UTC
So, FYI this is still happening on my setup; also Benjamin's test does fail here as a result (as it should).
Comment 19 Benjamin Esquivel 2015-10-29 15:02:06 UTC
I wish I knew why your setup seems to have this failure reproduced often. Also, is there a way to check how many times this test has failed in the autobuilders and if so, access the logs?

we never got to see this issue in a number of machines in GDC including autobuilders.
Comment 20 Paul Eggleton 2015-11-09 14:48:56 UTC
Setting back to IN PROGRESS IMPLEMENTATION since it's been punted back to me to investigate.
Comment 21 Mariano Lopez 2015-12-17 17:47:17 UTC
I was able to reproduce this error today using openSuse. I just build a core-image-sato after core-image-full-cmdline. It seems the problem is that the rpm database is dirty after using _list_pkg_deps() from class RpmPkgsList in file package_manager.py.

_list_pkg_deps() calls rpmresolve and it seems this command leaves the locks in the database. The actual output of the rpm command is:

BDB2053 Freeing read locks for locker 0x98: 19853/140035173365568
BDB2053 Freeing read locks for locker 0x99: 19853/140035173365568
BDB2053 Freeing read locks for locker 0x9a: 19853/140035173365568
BDB2053 Freeing read locks for locker 0x9b: 19853/140035173365568
BDB2053 Freeing read locks for locker 0x9c: 19853/140035173365568
packagegroup-base-usbgadget genericx86_64 1.0 /path/to/tmp/deploy/rpm/genericx86_64/packagegroup-base-usbgadget-1.0-r83.genericx86_64.rpm
shadow-securetty genericx86_64 4.2.1 /path/to/tmp/deploy/rpm/genericx86_64/shadow-securetty-4.2.1-r3.genericx86_64.rpm
glibc-binary-localedata-en-gb core2_64 2.22 /path/to/tmp/deploy/rpm/core2_64/glibc-binary-localedata-en-gb-2.22-r0.core2_64.rpm                                       
linux-firmware-iwlwifi-license all 0.0+git0+bbe4917c05 /path/to/tmp/deploy/rpm/all/linux-firmware-iwlwifi-license-0.0+git0+bbe4917c05-r0.all.rpm
Comment 22 Mariano Lopez 2015-12-17 18:03:07 UTC
I created a different manifest after calling _list_pkg_deps() and every time I got the dirty output.
Comment 23 Mariano Lopez 2015-12-29 18:03:52 UTC
The issue is in rpmresolve program, there are some rpmmi pointers never freed when a package have null as requirement. This keeps the database opened after the program terminates.
Comment 24 Mariano Lopez 2015-12-29 18:31:34 UTC
Sent patch to the mailing list

http://lists.openembedded.org/pipermail/openembedded-core/2015-December/114688.html
Comment 25 Mariano Lopez 2016-01-14 17:12:01 UTC
Paul, patch has been integrated in master, can you confirm this solves the problem?
Comment 26 Mariano Lopez 2016-01-25 14:49:05 UTC
This has been solved in master with commit:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=eda3947cf06252346dfd89f626b2560092219242

I'll backport the patch to jethro and fido
Comment 27 Mariano Lopez 2016-02-09 00:34:59 UTC
This has been integrated into jethro waiting for fido and dizzy

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=jethro&id=d632a923dcd4646de827d1d2725d6699730f7feb
Comment 28 Mariano Lopez 2016-02-19 22:36:48 UTC
This has been integrated in fido:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=fido&id=c94eb07d53c6bc26692dfb30aa7b006129f79d66

Waiting for dizzy
Comment 29 Mariano Lopez 2016-03-08 14:44:33 UTC
Already talked with Armin, he said he will integrate the patch in the new pull request for dizzy
Comment 30 Ross Burton 2016-07-13 22:50:20 UTC
This isn't yet integrated into Dizzy.  Armin: will you do that, or should we close this as resolved?
Comment 31 Ross Burton 2016-07-13 23:30:27 UTC
Patch sent for dizzy.
Comment 32 Armin Kuster 2016-10-03 19:41:43 UTC
I am not planning on fixing this issue. Marking as wontfix.

There are several Yocto member's who provide commercial support and may be able to provide assistances on this issue.

https://www.yoctoproject.org/ecosystem/member-organizations.
Comment 33 Paul Eggleton 2016-10-03 19:48:22 UTC
I'm re-marking this as fixed and changed the target milestone, since it was fixed in master and the newer stable branches.