strip won't strip non-executable files on XFS

Bug #13195 reported by Daniel Stone on 2005-02-23
6
Affects Status Importance Assigned to Milestone
linux-source-2.6.15 (Ubuntu)
Medium
Ben Collins

Bug Description

On XFS, strip(1) refuses to strip non-executable files in some situations,
leading to major bustage in the xorg build:

dh_strip \
  -Nlibdmx1-dbg \
[...]
  -Nxserver-xorg-dbg
strip: unable to copy file
'debian/xlibmesa-dri/usr/X11R6/lib/modules/dri/gamma_dri.so' reason: Permission
denied
strip: unable to copy file
'debian/xlibmesa-dri/usr/X11R6/lib/modules/dri/i915_dri.so' reason: Permission
denied
[...]
find debian/xserver-xorg/usr/X11R6/lib/modules -name "*_drv.o" | \
  xargs --no-run-if-empty \
  strip --strip-debug --remove-section=.note --remove-section=.comment
strip: unable to copy file
'debian/xserver-xorg/usr/X11R6/lib/modules/drivers/apm_drv.o' reason: Permission
denied
[...]

This occurs on i386 and amd64, and is fixed by moving to ext3. I cannot
reproduce this outside of a build environment:
daniels@brainfreeze:~/canonical/xorg/xorg-6.8.2% cp
/usr/X11R6/lib/modules/drivers/radeon_drv.o .
daniels@brainfreeze:~/canonical/xorg/xorg-6.8.2% ls -l radeon_drv.o
-rw-r--r-- 1 daniels daniels 281032 2005-02-23 14:56 radeon_drv.o
daniels@brainfreeze:~/canonical/xorg/xorg-6.8.2% strip radeon_drv.o
daniels@brainfreeze:~/canonical/xorg/xorg-6.8.2% ls -l radeon_drv.o
-rw-r--r-- 1 daniels daniels 179320 2005-02-23 14:56 radeon_drv.o

Chuck Short (zulcss) wrote :

I have opened up a bug upstream:

http://bugme.osdl.org/show_bug.cgi?id=4258

Regards
chuck

Matt Zimmerman (mdz) wrote :

I think an strace of the strip command would be in order

Daniel Stone (daniels) wrote :

I've been talking to Eric Sandeen of SGI about this, and am running through a
xorg build now to get an strace (diverted /usr/bin/strip).

Daniel Stone (daniels) wrote :

I thought fakeroot may have been causing it, but no dice:
daniels@brainfreeze:~/tmp% cp -a
~/canonical/xorg/xorg-6.8.2/build-tree/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_drv.o
radeon_drv.o.orig
daniels@brainfreeze:~/tmp% ls -lh radeon_drv.o.orig
-rw-r--r-- 1 daniels daniels 2.5M 2005-02-27 22:50 radeon_drv.o.orig
daniels@brainfreeze:~/tmp% cp -a radeon_drv.o{.orig,} && strip
--remove-section=.comment --remove-section=.note --strip-unneeded radeon_drv.o
&& ls -lh radeon_drv.o
-rw-r--r-- 1 daniels daniels 262K 2005-02-28 00:57 radeon_drv.o
daniels@brainfreeze:~/tmp% cp -a radeon_drv.o{.orig,} && fakeroot strip
--remove-section=.comment --remove-section=.note --strip-unneeded radeon_drv.o
&& ls -lh radeon_drv.o
-rw-r--r-- 1 daniels daniels 262K 2005-02-28 00:57 radeon_drv.o

strace to come in an attachment.

Daniel Stone (daniels) wrote :

Created an attachment (id=1465)
strace of failing strip

Daniel Stone (daniels) wrote :

(From update of attachment 1465)
wrong one

Daniel Stone (daniels) wrote :

Created an attachment (id=1469)
the right strace this time

Matt Zimmerman (mdz) wrote :

It appears from the strace that the file is simply read-only:

lstat("debian/xserver-xorg/usr/X11R6/lib/modules/input/wacom_drv.o",
{st_mode=S_IFREG|0444, st_size=1299451, ...}) = 0
getpid() = 19803
semop(655362, 0x131, 140737488348032) = 0
msgsnd(1179650, {0, 0x8}, 140737488348112, 0x38) = 0
msgrcv(1212419, {12314923993692930047, "\252*"}, 140737488348112, 4213414, 0x38)
= 56
semop(655362, 0, 140737488348032) = 0
open("debian/xserver-xorg/usr/X11R6/lib/modules/input/stnn8Z4z", O_RDONLY) = 3
open("debian/xserver-xorg/usr/X11R6/lib/modules/input/wacom_drv.o",
O_WRONLY|O_CREAT|O_TRUNC, 0777) = -1 EACCES (Permission denied)

Easily reproducible:

mizar:[/tmp] cp /bin/ls .
mizar:[/tmp] chmod 444 ls
mizar:[/tmp] strip ls
strip: unable to copy file 'ls' reason: Permission denied

Daniel Stone (daniels) wrote :

And yet, this only occurs on XFS for some reason ... I'm willing to bet this
isn't unrelated to Debian #296586.

dh_strip \
  -Nlibdps1-dbg \
  [...]
strip: unable to copy file
'debian/xlibmesa-dri/usr/X11R6/lib/modules/dri/ffb_dri.so' reason: Permission denied
strip: unable to copy file
'debian/xlibmesa-dri/usr/X11R6/lib/modules/dri/gamma_dri.so' reason: Permission
denied
strip: unable to copy file
'debian/xlibmesa-dri/usr/X11R6/lib/modules/dri/i810_dri.so' reason: Permission
denied
[...]

Ben Collins (ben-collins) wrote :

Does this still affect current breezy kernels?

Daniel Stone (daniels) wrote :

sorry, missed the bug mail. it does appear to still be occurring, yes.

Ben Collins (ben-collins) wrote :

This bug has been flagged because it is old and possibly inactive. It may or may
not be fixed in the latest release (Breezy Badger 5.10). It is being marked as
"NEEDSINFO". In two weeks time, if the bug is not updated back to "NEW" and
validated against Breezy, it will be closed.

This is needed in order to help manage the current bug list for the kernel. We
would like to fix all bugs, but need users to test and help with debugging.

If this change was in error for this bug, please respond and make the
appropriate change (or email <email address hidden> if you cannot make the
change).

Thanks for your help.

Ben Collins (ben-collins) wrote :

Daniel, does this still affect breezy and/or dapper?

Ben Collins (ben-collins) wrote :

Keybuk and pitti reported that they were able to strip 644 binaries on xfs
without any problems with dapper 2.6.15 kernel.

Daniel Stone (daniels) wrote :

i've always been able to strip random arbitrary files normally (even copying the
same files over and running strip on them); it's only ever been the monolithic
xfree86/xorg build that's been affected, but I'm not convinced I care enough now.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.