Bug 190488 - assertion failure when opening glibc RPM
assertion failure when opening glibc RPM
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Paul Nasrat
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-05-02 16:45 EDT by Dennis Gregorovic
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-05-04 13:26:19 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Simple reproducer (635 bytes, text/plain)
2006-05-03 16:03 EDT, Paul Nasrat
no flags Details

  None (edit)
Description Dennis Gregorovic 2006-05-02 16:45:31 EDT
# rpm --test -Uvh glibc-2.4.90-4.i686.rpm glibc-common-2.4.90-4.i386.rpm
rpm: rpmte.c:589: rpmteColorDS: Assertion `ix < Count' failed.
Aborted
# rpm -q rpm
rpm-4.4.2-15.2

Same result with rpm-4.3.3-13_nonptl
Comment 1 Paul Nasrat 2006-05-02 16:48:44 EDT
gdb /usr/lib/rpm/rpmi
break rpmte.c:589
cond 1 ix >= Count

(gdb) p rpmfiN(fi)
No symbol "rpmfiN" in current context.
(gdb) p rpmfiBN(fi)
$64 = 0x9d3704c "libpthread.so.0"
(gdb) p rpmfiDN(fi)
$65 = 0x9d37f89 "/lib/i686/nosegneg/"
(gdb) p rpmfiFDepends(fi, &ddict)
$66 = 1
(gdb) p *ddict
$67 = 1375731727
Comment 2 Paul Nasrat 2006-05-02 16:53:29 EDT
(gdb) p ix
$68 = 15
(gdb) p Count
$69 = 8

) p *te->requires
$73 = {
  Type = 0x64e494 "Requires",
  DNEVR = 0x9d335a8 "R rpmlib(CompressedFileNames) <= 3.0.4-1",
  h = 0x0,
  N = 0xa225c50,
  EVR = 0xa225d70,
  Flags = 0xa225c28,
  Color = 0xa225db8,
  Refs = 0xa225de0,
  BT = 1146474172,
  tagN = RPMTAG_REQUIRENAME,
  Nt = RPM_STRING_ARRAY_TYPE,
  EVRt = RPM_STRING_ARRAY_TYPE,
  Ft = RPM_INT32_TYPE,
  Count = 8,
  i = -1,
  l = 0,
  u = 0,
  nopromote = 1,
  nrefs = 1
}

Comment 3 Paul Nasrat 2006-05-02 16:54:51 EDT
Code around assertion:
   
 /* Calculate dependency color and reference count. */
    fi = rpmfiInit(fi, 0);
    if (fi != NULL)
    while (rpmfiNext(fi) >= 0) {
	val = rpmfiFColor(fi);
	ddict = NULL;
	ndx = rpmfiFDepends(fi, &ddict);
	if (ddict != NULL)
	while (ndx-- > 0) {
	    ix = *ddict++;
	    mydt = ((ix >> 24) & 0xff);
	    if (mydt != deptype)
		/*@innercontinue@*/ continue;
	    ix &= 0x00ffffff;
assert (ix < Count);
	    colors[ix] |= val;
	    refs[ix]++;
	}
    }
Comment 4 Jeff Johnson 2006-05-02 18:36:12 EDT
Were these pkgs built with rpm-4.4.2-21? If so, there's your answer ...
Comment 5 Dennis Gregorovic 2006-05-02 18:48:12 EDT
Yes, that is the version of rpm that was in the buildroot.
Comment 6 Jeff Johnson 2006-05-02 19:23:36 EDT
Rip the last patch applied will fix. I am building from cvs now to verify ...
Comment 7 Jeff Johnson 2006-05-03 07:25:25 EDT
glibc-1.4.90-4 packages built without the (bogus and demonstrably broken imho)
    rpm-4.4.2-devel-autodep.patch
do not trigger the assertion failure.
Comment 8 Jeff Johnson 2006-05-03 07:25:51 EDT
glibc-2.4.90-4 packages built without the (bogus and demonstrably broken imho)
    rpm-4.4.2-devel-autodep.patch
do not trigger the assertion failure.
Comment 9 Paul Nasrat 2006-05-03 16:03:19 EDT
Created attachment 128563 [details]
Simple reproducer

I've managed to hit without the patch, I think we're doing it incorrectly in
other places.  We find three interpreters and set the indexes on the files, but
we're not populating the requires array so it is Count 2, when we get index 3
from our third file we hit the assert.

Requires(rpmlib): rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(CompressedFileNames) <= 3.0.4-1
===================================== final: files 7 cdict[5] 71% ddictx[3]
  0 /var/tmp/dummy-1.0-root/opt/dummy	directory
  1 /var/tmp/dummy-1.0-root/opt/dummy/bin	directory
  2 /var/tmp/dummy-1.0-root/opt/dummy/bin/dummy Bourne shell script text
executable
	R /bin/sh
  3 /var/tmp/dummy-1.0-root/opt/dummy/bin/dummy.pl	perl script text
executable
	R /usr/bin/perl
  4 /var/tmp/dummy-1.0-root/opt/dummy/bin/dummy.py	a /usr/bin/python
script text executable
	R /usr/bin/python
  5 /var/tmp/dummy-1.0-root/opt/dummy/bin/dummy.pyc
  6 /var/tmp/dummy-1.0-root/opt/dummy/bin/dummy.pyo

[root@dhcp88 SPECS]# rpm --test -ivh ../RPMS/x86_64/dummy-1.0-1.x86_64.rpm
rpm: rpmte.c:589: rpmteColorDS: Assertion `ix < Count' failed.
Aborted
Comment 10 Jeff Johnson 2006-05-04 13:26:19 EDT
You've hit a different problem with an identical failure mode.

Use of
    AutoReq: false
is ancient history. E.g. it is impossible to build a multilib ready package
without attaching dependencies to files.

You have the following choices:
    1) Add any dependency to the package.
    2) turn off internal depdendency generation
         %define _use_internal_dependency_generator     0

AFAIAC, the fix is to rip out AutoReq: et al entirely. Use a tar-ball if you don't want dependencies.


Note You need to log in before you can comment on or make changes to this bug.