Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 72705

Summary: Segfault from prelink
Product: [Retired] Red Hat Linux Reporter: Owen Taylor <otaylor>
Component: prelinkAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: drepper
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-08-29 20:31:42 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
gnome-terminal binary reproducing the problem none

Description Owen Taylor 2002-08-26 19:26:07 UTC
If you run 

 /usr/sbin/prelink -u 

On the attached binary, prelink segfaults almost immediately.
It's before it reads any other files, so I suspect it
will be reproducable.

I'm not sure if the binary is corrupt or not; if it is
corrupt, that's another prelink bug, but I can't give
a reproduction sequence, I'm afraid. It was something
like:

 prelink -a -v
 prelink -a -u -v
 prelink /usr/bin/gnome-terminal
 [ upgrade openssl, which is indirectly pulled in by gnome-terminal ]
 prelink -a -u

With gnome-terminal and libraries mostly from the 
Milan tree.

Comment 1 Owen Taylor 2002-08-26 19:44:55 UTC
Created attachment 73164 [details]
gnome-terminal binary reproducing the problem

Comment 2 Jakub Jelinek 2002-08-27 07:18:13 UTC
The binary is in fact broken, sh_link member of .gnu.liblist Shdr has
completely bogus value. Not segfaulting on it will be trivial, will try to
look where it might come from too.

Comment 3 Jakub Jelinek 2002-08-27 14:59:13 UTC
--- exec.c~     2002-08-27 16:35:51.000000000 +0200
+++ exec.c      2002-08-27 16:35:51.000000000 +0200
@@ -793,7 +793,7 @@ prelink_exec (struct prelink_info *info)
       Elf_Data *data;

       dso->shdr[i].sh_link
-       = new_dynstr ? new[new_dynstr] : move->old_to_new[dynstrndx];
+       = new_dynstr != -1 ? new[new_dynstr] : move->old_to_new[dynstrndx];
       data = elf_getdata (dso->scn[i], NULL);
       data->d_type = ELF_T_WORD;
       data->d_size = (ndeps - 1) * sizeof (Elf32_Lib);

seems like the candidate why sh_link was garbage (new[-1]).
I've added checks so that prelink -u wouldn't segfault on bogus sh_link or
sh_info fields too.
Will be soon in prelink-0.2.0-8.

Comment 4 Bill Nottingham 2003-08-29 20:31:42 UTC
Assuming fixed in current versions.