Bug 133734 - Stripping prelinked binaries produces programs that segfault
Stripping prelinked binaries produces programs that segfault
Product: Fedora
Classification: Fedora
Component: binutils (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2004-09-26 19:46 EDT by W. Michael Petullo
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version: binutils-
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-10-12 07:28:09 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Copy of ash that I stripped; causes a segfault on my iBook (115.12 KB, application/x-executable)
2004-10-01 00:48 EDT, W. Michael Petullo
no flags Details

  None (edit)
Description W. Michael Petullo 2004-09-26 19:46:54 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.7.2)
Gecko/20040809 Epiphany/1.3.8

Description of problem:
When I run strip on my iBook (32 bit PowerPC), the program generates
executable images that segfault.

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

How reproducible:

Steps to Reproduce:
[mike@imp tmp]$ cp /bin/ash .
[mike@imp tmp]$ strip ash
[mike@imp tmp]$ ./ash
Segmentation fault
[mike@imp tmp]$ /bin/ash
shopt: not found
shopt: not found
$ exit
[mike@imp tmp]$

Actual Results:  The copy of ash that I stripped caused a segfault. 
The copy of ash that was installed by the ash RPM executes properly.

Additional info:
Comment 1 Jakub Jelinek 2004-09-28 04:31:11 EDT
Can't reproduce, even the stripped ash works just fine.
md5sum /bin/ash
5898a1de8e16f89c9ad838fa578c7c5f  /bin/ash
strip actually doesn't change anything on the file and returns success.
Comment 2 W. Michael Petullo 2004-09-28 07:22:06 EDT
Did you notice that the architecture is PowerPC?

[mike@imp tmp]$ cp /bin/ash .
[mike@imp tmp]$ strip ash
[mike@imp tmp]$ diff ash /bin/ash
Binary files ash and /bin/ash differ

Another wierd thing is that /bin/ash is already stripped.
Comment 3 Jakub Jelinek 2004-09-30 06:31:11 EDT
Of course I have tested on ppc.
It is certainly not weird that (most) binaries and libraries in the
distro are stripped, that's on purpose (they are stripped into
files in *-debuginfo* packages).
You haven't mentioned what exact ash version you used.  Alternatively
please attach your /bin/ash before and after stripping.
Comment 4 W. Michael Petullo 2004-09-30 15:07:52 EDT
My statement was a little ambiguous.  I didn't mean that it was odd
that ash was already stripped, per se.  I meant that it was odd that
the stripped ash provided by the RPM did not crash but the copy I
stripped myself did.

Anyway, I'll try submit the additional information asked for when I
get a chance.
Comment 5 W. Michael Petullo 2004-10-01 00:45:27 EDT
Here are my current binutils and ash versions, along with a
demonstration that the packages' files are still legitimate:

[root@imp /]# rpm -q binutils
[root@imp /]# rpm -V binutils
[root@imp /]# rpm -q ash
[root@imp /]# rpm -V ash
Comment 6 W. Michael Petullo 2004-10-01 00:48:57 EDT
Created attachment 104615 [details]
Copy of ash that I stripped; causes a segfault on my iBook
Comment 7 Jakub Jelinek 2004-10-10 14:26:24 EDT
Ok, reproduced even on x86-64.  The important difference why I have
not been able to reproduce this was that my /bin/ash was not prelinked.
strip apparently messes up the .gnu.liblist section.
Comment 8 W. Michael Petullo 2004-10-13 11:34:46 EDT
Confirmed fixed with binutils- and prelink-0.3.2-11.

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