Bug 129356
Summary: | ppc64 -fPIE compiled, -pie linked stripped executables get corrupt stacks | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 3 | Reporter: | Jason Vas Dias <jvdias> |
Component: | binutils | Assignee: | Jakub Jelinek <jakub> |
Status: | CLOSED WORKSFORME | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 3.0 | ||
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | powerpc | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2004-10-08 08:41:59 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: |
Description
Jason Vas Dias
2004-08-06 20:06:46 UTC
FYI, I'm able to replicate this on pseries.lab.boston.redhat.com running 2.4.21-20.EL and binutils-2.14.90.0.4-35. Jason did some really good legwork which shows that the problem is with binaries compiled with -fPIE, linked with -pie, and then stripped. Is there any good way to determine if there are other binaries in the U3 distro which might exhibit this issue so that we can work around them as was done with samba? I really can't reproduce this. #!/bin/sh cat > test_mount.c <<EOF #include <sys/types.h> #include <unistd.h> #include <sys/mount.h> int main(int argc, char **argv, char **envp) { char mnt_opts[1024]="\0"; return mount( "//bogus/none", ".", "smbfs", MS_NOSUID|MS_NODEV|0xc0ed0000, &mnt_opts ); } EOF gcc -fPIE -c test_mount.c for i in not_stripped stripped eu-stripped; do gcc -pie -o test_mount.$i test_mount.o; done strip test_mount.stripped eu-strip -f test_mount.debug test_mount.eu-stripped for i in not_stripped stripped eu-stripped; do ./test_mount.$i; echo $?; done md5sum test_mount.{not_stripped,stripped,eu-stripped,debug} rpm -q gcc binutils glibc 255 255 255 7e37b7477dd72077858b1285b030e340 test_mount.not_stripped 6f184ecf01439aefb6036dc43f2a9503 test_mount.stripped 7f5720c205a3ef71b2ba9b1f735be8de test_mount.eu-stripped ae1fc8f5791bb68626a9d22a5b6e4228 test_mount.debug gcc-3.2.3-46 binutils-2.14.90.0.4-35 glibc-2.3.2-95.28 Yes, it looks like the latest versions of binutils / gcc / glibc fixed this problem: First, I reproduced it with these versions: $ rpm -q gcc glibc binutils gcc-3.2.3-20 glibc-2.3.2-95.2 glibc-2.3.2-95.2 binutils-2.14.90.0.4-25 $ gcc -fPIE -c test_mount.c $ gcc -pie -o test_mount test_mount.o $ strip ./test_mount $ ./test_mount Bus error Then, I upgraded to these versions: $ rpm -q gcc glibc binutils gcc-3.2.3-46 glibc-2.3.2-95.2 glibc-2.3.2-95.28 binutils-2.14.90.0.4-35 $ gcc -fPIE -c test_mount.c $ gcc -pie -o test_mount test_mount.o $ strip ./test_mount $ ./test_mount $ NO BUS ERROR! |