Bug 2936

Summary: rpm-native: db3New: Assertion `dbOpts != ((void *)0) && *dbOpts != '\0'' failed.
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Saul Wold <sgw>
Component: devtools / tool chainAssignee: Paul Eggleton <bluelightning>
Status: VERIFIED FIXED QA Contact:
Severity: critical    
Priority: High CC: bluelightning, david.c.stewart, liang.li2, mark.hatle, meta.mr.watcher, meta.watcher, richard.purdie, song.liu, zhenfeng.zhao
Version: 1.3   
Target Milestone: 1.3 M3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---
Attachments:
Description Flags
log.do_rootfs from nightly-mips LSB Build none

Description Saul Wold 2012-08-12 11:25:17 UTC
This failure has appeared a number of times in conjuntion with rpmreslove-native in the 1.3_m3 builds, it's critical that we address this issue.


| ERROR: Function failed: do_rootfs (see /srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-non-gpl3/build/build/tmp/work/qemux86-poky-linux/core-image-basic-1.0-r0/temp/log.do_rootfs.512 for further information)
NOTE: package core-image-basic-1.0-r0: task do_rootfs: Failed
ERROR: Task 22 (/srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-non-gpl3/build/meta/recipes-extended/images/core-image-basic.bb, do_rootfs) failed with exit code '1'
ERROR: Function failed: do_rootfs (see /srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-non-gpl3/build/build/tmp/work/qemux86-poky-linux/core-image-minimal-1.0-r0/temp/log.do_rootfs.515 for further information)
ERROR: Logfile of failure stored in: /srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-non-gpl3/build/build/tmp/work/qemux86-poky-linux/core-image-minimal-1.0-r0/temp/log.do_rootfs.515
Log data follows:
| DEBUG: Executing shell function do_rootfs
| Generating solve db for /srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-non-gpl3/build/build/tmp/deploy/rpm/qemux86...
| Generating solve db for /srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-non-gpl3/build/build/tmp/deploy/rpm/i586...
| Generating solve db for /srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-non-gpl3/build/build/tmp/deploy/rpm/all...
| Generating solve db for /srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-non-gpl3/build/build/tmp/deploy/rpm/all...
| Processing task-core-boot...
| rpmresolve: dbconfig.c:493: db3New: Assertion `dbOpts != ((void *)0) && *dbOpts != '\0'' failed.
| /srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-non-gpl3/build/build/tmp/work/qemux86-poky-linux/core-image-minimal-1.0-r0/temp/run.do_rootfs.515: line 946:   623 Aborted                 rpmresolve $extraopt ${confbase}-base_archs.conf ${target_rootfs}/install/base_archs.pkglist >> ${target_rootfs}/install/${manifestpfx}.manifest
| ERROR: Function failed: do_rootfs (see /srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-non-gpl3/build/build/tmp/work/qemux86-poky-linux/core-image-minimal-1.0-r0/temp/log.do_rootfs.515 for further information)

db3New: Assertion `dbOpts != ((void *)0) && *dbOpts != '\0'' failed.
Comment 1 Robert Yang 2012-08-13 03:04:49 UTC
I'm trying to reproduce it, I will do more investigation on the code if can't reproduce it. It would be great if you can tell me which host did this problem find.
Comment 2 Saul Wold 2012-08-13 04:06:40 UTC
It occurred on a Debian machine and an OpenSuse machine.

Details:
swold@autobuilder06:~$ lsb-release -a
LSB Version:	n/a
Distributor ID:	SUSE LINUX
Description:	openSUSE 11.4 (x86_64)
Release:	11.4
Codename:	Celadon
swold@autobuilder06:~$ uname -a
Linux autobuilder06 2.6.37.6-0.20-default #1 SMP 2011-12-19 23:39:38 +0100 x86_64 x86_64 x86_64 GNU/Linux


swold@ab02:~$ lsb_release -a ; uname -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 6.0.5 (squeeze)
Release:	6.0.5
Codename:	squeeze
Linux ab02.i.yoctoproject.org 2.6.32-5-amd64 #1 SMP Sun May 6 04:00:17 UTC 2012 x86_64 GNU/Linux
Comment 3 Saul Wold 2012-08-13 08:29:42 UTC
Created attachment 686 [details]
log.do_rootfs from nightly-mips LSB Build
Comment 4 Paul Eggleton 2012-08-13 16:10:48 UTC
Some possible hints here in a reply on the rpm-devel list:

http://marc.info/?l=rpm-devel&m=134487316427630&w=2

One possible way for us to get further info would be to wrap the call to rpmresolve with strace (using -o to put the output somewhere sensible) so we could see if it failed to open the macros file. This would mean we would need strace available to us on the autobuilders of course.
Comment 5 Paul Eggleton 2012-08-13 16:34:57 UTC
I've now been able to reproduce this externally on ab06 - it is a shared state relocation issue. rpm has the path to find the macro files baked into it. I'm working on a fix.
Comment 6 Richard Purdie 2012-08-14 06:25:40 UTC
I noticed the problem reoccured in the build last night. I think the fix was correct but we don't call the necessary rpm init functions within rpmresolve. I suspect we either need to call:

    setRuntimeRelocPaths();

which is not exported or something like:

    rpmcliInit(argc, argv, NULL);

so ensure the macros get set from the environment and don't just take their default values.
Comment 7 Paul Eggleton 2012-08-15 09:52:39 UTC
Fixed by the following revisions in poky master:

61addcc8536caef8cd8a2bf7ed3c6c34ce6a7f83
8b8748c8f963900b83dc0fdd7757556f917fe4fd
Comment 8 liang li 2012-09-11 06:29:21 UTC
discribed in Comment 11 and Comment 12 of bug 2753,verified.
git info: af847d36375aa53f0c1ee2a00c97ba9f38837d1b  
git branch: poky/master