Bug 1030 - when add cups to task-core-lsb, rpm will segment fault when core-image-lsb-sdk do rootfs
Summary: when add cups to task-core-lsb, rpm will segment fault when core-image-lsb-s...
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: 1.0
Hardware: x86 Multiple
: High major
Target Milestone: 1.1 M2
Assignee: Qing He
QA Contact:
URL:
Whiteboard: reproduced and locally fixed, May 25
Depends on:
Blocks:
 
Reported: 2011-05-11 00:14 UTC by Kai Kang
Modified: 2011-05-31 09:27 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments
when add cups to task-core-lsb.bb, rpm will segment fault (7.20 KB, application/octet-stream)
2011-05-12 19:24 UTC, Kai Kang
no flags Details
proposed patch (552 bytes, patch)
2011-05-25 03:38 UTC, Qing He
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kai Kang 2011-05-11 00:14:55 UTC
When add cups to meta/recipes-extended/tasks/task-core-lsb.bb, then run
bitbake core-image-lsb-sdk, it will failed. There are other persons have meet 
this problem in maillist.

And the log is in attachment.
Comment 1 Saul Wold 2011-05-12 09:36:22 UTC
Please add the attachment
Comment 2 Kai Kang 2011-05-12 19:24:34 UTC
Created attachment 154 [details]
when add cups to task-core-lsb.bb, rpm will segment fault

sorry for forgetting to add the attchment
Comment 3 Saul Wold 2011-05-13 10:45:35 UTC
We received the attachment and need to review it now
Comment 4 Kai Kang 2011-05-17 23:09:29 UTC
This the gdb debug info:

# gdb /mnt/sda8/poky-neil/build/tmp/sysroots/x86_64-linux/usr/bin/rpm.real 
GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /mnt/sda8/poky-neil/build/tmp/sysroots/x86_64-linux/usr/bin/rpm.real...done.

(gdb) b rpmsmStage
Function "rpmsmStage" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (rpmsmStage) pending.
(gdb) r --dbpath /var/lib/rpm '--define=_openall_before_chroot 1' --root /mnt/sda8/poky-neil/build/tmp/work/qemux86-poky-linux/core-image-lsb-1.0-r0/rootfs --predefine '_rpmds_sysinfo_path /mnt/sda8/poky-neil/build/tmp/work/qemux86-poky-linux/core-image-lsb-1.0-r0/rootfs/etc/rpm/sysinfo' --predefine '_rpmrc_platform_path /mnt/sda8/poky-neil/build/tmp/work/qemux86-poky-linux/core-image-lsb-1.0-r0/rootfs/etc/rpm/platform' -D '_dbpath /var/lib/rpm' --noscripts --notriggers --noparentdirs --nolinktos -D '__dbi_txn create nofsync private' -Uhv /mnt/sda8/poky-neil/build/tmp/work/qemux86-poky-linux/core-image-lsb-1.0-r0/rootfs/install/install_solution.manifest
Starting program: /mnt/sda8/poky-neil/build/tmp/sysroots/x86_64-linux/usr/bin/rpm.real --dbpath /var/lib/rpm '--define=_openall_before_chroot 1' --root /mnt/sda8/poky-neil/build/tmp/work/qemux86-poky-linux/core-image-lsb-1.0-r0/rootfs --predefine '_rpmds_sysinfo_path /mnt/sda8/poky-neil/build/tmp/work/qemux86-poky-linux/core-image-lsb-1.0-r0/rootfs/etc/rpm/sysinfo' --predefine '_rpmrc_platform_path /mnt/sda8/poky-neil/build/tmp/work/qemux86-poky-linux/core-image-lsb-1.0-r0/rootfs/etc/rpm/platform' -D '_dbpath /var/lib/rpm' --noscripts --notriggers --noparentdirs --nolinktos -D '__dbi_txn create nofsync private' -Uhv /mnt/sda8/poky-neil/build/tmp/work/qemux86-poky-linux/core-image-lsb-1.0-r0/rootfs/install/install_solution.manifest
[Thread debugging using libthread_db enabled]
error: LOOP:
error: removing gettext-0.17-r5.i586 "Requires: gettext-dev >= 0.17" from tsort relations.
error: removing gettext-dev-0.17-r5.i586 "Requires: gettext = 0.17-r5" from tsort relations.
Preparing...                
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff74551ea in fpLookupSubdir (symlinks=0x15309e0, fphash=0x1530080, fpc=0xfa7760, _p=0x17477d0, filenr=876) at fprint.c:351
351         flink = fi->flinks[fx];
(gdb) bt
#0  0x00007ffff74551ea in fpLookupSubdir (symlinks=0x15309e0, fphash=0x1530080, fpc=0xfa7760, _p=0x17477d0, filenr=876) at fprint.c:351
#1  0x00007ffff773c712 in rpmtsAddFingerprints (ts=0x62c430, fileCount=32471, ht=0x1530080, fpc=0xfa7760) at transaction.c:1308
#2  0x00007ffff773cec8 in rpmtsPrepare (ts=0x62c430, sx=0x0, fileCount=32471, nrmvdp=0x7fffffffd744) at transaction.c:1525
#3  0x00007ffff773e3cf in _rpmtsRun (ts=0x62c430, okProbs=0x0, ignoreSet=48) at transaction.c:2094
#4  0x00007ffff772c01f in rpmcliInstallRun (ts=0x62c430, okProbs=0x0, ignoreSet=48) at rpminstall.c:331
#5  0x00007ffff772cf71 in rpmcliInstall (ts=0x62c430, ia=0x6075a0, argv=0x609930) at rpminstall.c:707
#6  0x0000000000404f9c in main (argc=20, argv=0x7fffffffdad8) at ./rpmqv.c:947
(gdb) p fi
$1 = (rpmfi) 0x25d1a20
(gdb) p *fi
$2 = {_item = {use = 0x25d1ba0, pool = 0x69e430, next = 0x0}, i = 1, j = 0, Type = 0x0, tagN = 19115024, h = 0x25d3140, bnl = 0x123a260, dnl = 0x123ac40, fdigests = 0x123a290, 
  fdigestalgos = 0x25d31c0, flinks = 0x0, flangs = 0x123aad0, dil = 0x100cc30, fflags = 0x26c1a90, fsizes = 0x25d1940, fmtimes = 0x0, fmodes = 0x0, frdevs = 0x0, finodes = 0x606, 
  fuser = 0x5b5, fgroup = 0x0, fstates = 0x0, fcolors = 0x0, fcaps = 0x25d24d0, fcontexts = 0x0, cdict = 0x403f00000000, ncdict = 19114928, fcdictx = 0x0, ddict = 0xffffffff00000000, 
  nddict = 0, fddictx = 0x0, fddictn = 0x0, vflags = 0x0, dc = 0, fc = 0, te = 0x0, _fnbf = 0x0, exclude = 0x0, nexclude = 0, include = 0x0, ninclude = 0, uid = 0, gid = 0, flags = 0, 
  action = 0, actions = 0x605, fps = 0x0, obnl = 0x0, odnl = 0x0, odil = 0x71, digests = 0x0, digestalgo = 0, digestlen = 0, pretrans = 0x0, pretransprog = 0x0, posttrans = 0x0, 
  posttransprog = 0x0, verifyscript = 0x0, verifyscriptprog = 0x0, fn = 0x0, fnlen = 0, astriplen = 0, striplen = 0, archivePos = 0, archiveSize = 33, dperms = 8186288, fperms = 0, 
  apath = 0x0, mapflags = 0, fmapflags = 0x21, fsm = 0x7ce9b0, color = 1, isSource = 32767, replacedSizes = 0x0, record = 33, magic = 0}
(gdb)
Comment 5 Qing He 2011-05-25 03:38:25 UTC
Created attachment 165 [details]
proposed patch

proposed patch (for rpm, not for yocto)
Comment 6 Qing He 2011-05-25 03:41:54 UTC
There is a faulty pointer handling in rpmdb/fprint.c, in short, a definition at fprint.c:336:
    struct rpmffi_s * recs;
should actually be:
    struct rpmffi_s ** recs;

The attached patch solve the issue and it's also ready for upstream submission.