Bug 115925

Summary: prelink 0.3.0-20 gives assertion failure on PowerPC
Product: [Fedora] Fedora Reporter: W. Michael Petullo <redhat>
Component: prelinkAssignee: Jakub Jelinek <jakub>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: powerpc   
OS: Linux   
Whiteboard:
Fixed In Version: 0.3.1-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-03-05 21:44:52 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
/usr/bin/refer, the binary that causes a prelink assertion to fail
none
.tar.bz2 containing the libraries refer depends on (1 of 2)
none
.tar.bz2 containing the libraries refer depends on (2 of 2)
none
Binary that causes prelink to fail.
none
.tar.bz2 containing the additional libraries showq depends on (1 of 2)
none
.tar.bz2 containing the additional libraries showq depends on (2 of 2) none

Description W. Michael Petullo 2004-02-17 04:03:54 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.6)
Gecko/20040115 Epiphany/1.0.7

Description of problem:
The prelink program encounters failed assertions when prelinking
select binaries on the PowerPC platform.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
prelink -avvv

Actual Results:  The prelink program runs successfully for a while and
then terminates:

[...]
Prelinking /usr/bin/refer
prelink: exec.c:517: prelink_exec: Assertion `data->d_size ==
dso->shdr[j].sh_size' failed.
Aborted

Additional info:

I will attach my refer binary and its libraries to this bug.  Note
that this is on the PowerPC architecture.

Comment 1 W. Michael Petullo 2004-02-17 04:07:18 UTC
Created attachment 97723 [details]
/usr/bin/refer, the binary that causes a prelink assertion to fail

Comment 2 W. Michael Petullo 2004-02-17 04:41:28 UTC
Created attachment 97724 [details]
.tar.bz2 containing the libraries refer depends on (1 of 2)

Comment 3 W. Michael Petullo 2004-02-17 04:46:55 UTC
Created attachment 97725 [details]
.tar.bz2 containing the libraries refer depends on (2 of 2)

Comment 4 Jakub Jelinek 2004-02-18 09:12:09 UTC
Thanks for the testcase.  It is just too anal assert.
Following patch cures this for me:
--- exec.c~     2004-02-18 11:12:37.412082272 +0100
+++ exec.c      2004-02-18 11:12:37.412082272 +0100
@@ -515,7 +515,8 @@ prelink_exec (struct prelink_info *info)
              {
                Elf_Data *data = elf_getdata (dso->scn[j], NULL);

-               assert (data->d_size == dso->shdr[j].sh_size);
+               assert (data->d_size == dso->shdr[j].sh_size
+                       || j == new_sdynbss + 1);
                if (data->d_size)
                  {
                    data->d_buf = realloc (data->d_buf, data->d_size);

Comment 5 W. Michael Petullo 2004-02-18 15:04:38 UTC
The patch proposed in comment #4 does fix the problem with
/usr/bin/refer.  However, now prelink is encountering another trouble
binary, /usr/libexec/postfix/showq.

Here is what prelink -av says:

Assigned virtual address space slots for libraries:
/lib/ld.so.1                         0ffd0000-0fff1a24           
/lib/tls/libc.so.6                   0fe70000-0ffc76f4
/lib/libcrypto.so.4                  0f080000-0f1a0084
/lib/tls/libdb-4.2.so                005a0000-0068f9a0
/usr/lib/libkrb5.so.3                0f270000-0f2e9710
/usr/lib/libldap.so.2                004c0000-00505c28
/lib/libssl.so.4                     0f030000-0f076958
/lib/libcrypt.so.1                   0e9a0000-0e9d8218
/usr/lib/libk5crypto.so.3            0f230000-0f2621e0
/usr/lib/libgssapi_krb5.so.2         0f1d0000-0f1f3f78
/lib/libnsl.so.1                     00220000-002440dc
/lib/libpcre.so.0                    00490000-004aede8
/usr/lib/libsasl2.so.2               00400000-00426cec
/usr/lib/libz.so.1                   0fc50000-0fc71740
/lib/libcom_err.so.2                 0f2f0000-0f3028e8
/lib/libdl.so.2                      0fdc0000-0fdd1220
/usr/lib/liblber.so.2                00510000-0052df70
/lib/tls/libpthread.so.0             0fac0000-0fad3524
/lib/libresolv.so.2                  0f380000-0f393e24
/usr/lib/libstdc++.so.5.0.5          0e830000-0e906ea0
/lib/tls/libm-2.3                    0fde0000-0fe63694
/lib/libgcc_s-3.3.2-20040120.so.1    0ed90000-0edac9fc
Prelinking /usr/libexec/postfix/showq
prelink: exec.c:519: prelink_exec: Assertion `data->d_size ==
dso->shdr[j].sh_size || j == new_sdynbss + 1' failed.
Aborted

Comment 6 W. Michael Petullo 2004-02-18 15:07:49 UTC
Created attachment 97789 [details]
Binary that causes prelink to fail.

This binary causes prelink to fail.  It has a lot of library dependencies, so I
will not attach them unless asked.

[mike@imp mike]$ ldd /usr/libexec/postfix/showq
	libldap.so.2 => /usr/lib/libldap.so.2 (0x004c0000)
	liblber.so.2 => /usr/lib/liblber.so.2 (0x00510000)
	libpcre.so.0 => /lib/libpcre.so.0 (0x00490000)
	libsasl2.so.2 => /usr/lib/libsasl2.so.2 (0x00400000)
	libssl.so.4 => /lib/libssl.so.4 (0x0f030000)
	libcrypto.so.4 => /lib/libcrypto.so.4 (0x0f080000)
	libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x0f1d0000)
	libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x0f270000)
	libcom_err.so.2 => /lib/libcom_err.so.2 (0x0f2f0000)
	libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x0f230000)
	libresolv.so.2 => /lib/libresolv.so.2 (0x0f380000)
	libdl.so.2 => /lib/libdl.so.2 (0x0fdc0000)
	libz.so.1 => /usr/lib/libz.so.1 (0x0fc50000)
	libdb-4.2.so => /lib/tls/libdb-4.2.so (0x005a0000)
	libnsl.so.1 => /lib/libnsl.so.1 (0x00220000)
	libc.so.6 => /lib/tls/libc.so.6 (0x0fe70000)
	libcrypt.so.1 => /lib/libcrypt.so.1 (0x0e9a0000)
	/lib/ld.so.1 => /lib/ld.so.1 (0x0ffd0000)
	libpthread.so.0 => /lib/tls/libpthread.so.0 (0x0fac0000)

Comment 7 Jakub Jelinek 2004-02-18 15:09:16 UTC
Ok, can you attach please showq (and its dependencies if they are
not already in the libs.[12].tar.bz2)?
I don't want to remove that assert without knowing what exactly
is going on.

Comment 8 W. Michael Petullo 2004-02-18 15:49:24 UTC
Created attachment 97799 [details]
.tar.bz2 containing the additional libraries showq depends on (1 of 2)

/usr/libexec/postfix/showq requires the two sets of libraries that refer
required.  In addition, showq requires an additional two sets.	This is the
first tarball of these additional 2.

I have to break these libraries across multiple tarballs because of the 1000KB
limit imposed by bugzilla on attachments.

Comment 9 W. Michael Petullo 2004-02-18 15:53:39 UTC
Created attachment 97800 [details]
.tar.bz2 containing the additional libraries showq depends on (2 of 2)

Comment 10 Jakub Jelinek 2004-03-04 17:36:31 UTC
Can you try prelink-0.3.1-1 in rawhide (should show up there worst case
tomorrow)?

Comment 11 W. Michael Petullo 2004-03-05 21:44:52 UTC
Version 0.3.1-1 seems to fix things.

Comment 12 Jay Turner 2004-09-02 05:19:46 UTC
An errata has been issued which should help the problem 
described in this bug report. This report is therefore being 
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, 
please follow the link below. You may reopen this bug report 
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2004-386.html