Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1694341 - ls still have debugging symbols
Summary: ls still have debugging symbols
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 29
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-30 15:54 UTC by Robert Marcano
Modified: 2019-04-02 07:13 UTC (History)
17 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-04-02 07:13:04 UTC


Attachments (Terms of Use)

Description Robert Marcano 2019-03-30 15:54:00 UTC
Description of problem:

/usr/bin/ls is shipped with debug symbols


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

coreutils-8.30-6.fc29.x86_64


How reproducible:

always


Steps to Reproduce:
1. cp /usr/bin/ls /tmp
2. strip -g /tmp/ls
3. ls -l /usr/bin/ls /tmp/ls


Actual results:

-rwxr-xr-x. 1 robert robert 150008 Mar 30 11:48 /tmp/ls
-rwxr-xr-x. 1 root   root   161896 Nov  7 11:14 /usr/bin/ls

Expected results:

strip -g should not reduce the file size

Additional info:

I was investigating why an RPM I was building was not being stripped properly, investigating rpm strip scriplets, I noticed some of them search for executable permission, I was setting permissions on the %files section and that is processed after the strip scriplets are run. Not sure if this is the problem here, but could help. Of all binaries on my machine the only binary on /usr/bin that size was not reduced with "strip -g" was ls, so this looks package specific

Comment 1 Kamil Dudka 2019-04-01 14:12:34 UTC
I do not think there is any problem in the coreutils package itself.  The difference you can observe is caused by rpm-build using `eu-strip --remove-comment` instead of `strip -g` in some cases -- see the related code in /usr/lib/rpm/find-debuginfo.sh:

strip_to_debug()
{
  local g=
  local r=
  $strip_r && r=--reloc-debug-sections
  $strip_g && case "$(file -bi "$2")" in
  application/x-sharedlib*) g=-g ;;
  application/x-executable*) g=-g ;;
  application/x-pie-executable*) g=-g ;;
  esac
  eu-strip --remove-comment $r $g ${keep_remove_args} -f "$1" "$2" || exit
  chmod 444 "$1" || exit
}


By the way, the output of file(1) is not really suitable to base such decisions on.  I already suggested rpm developers not to use it:

    bug #1608549 comment #22

Comment 2 Kamil Dudka 2019-04-01 14:40:21 UTC
Actually /usr/lib/rpm/find-debuginfo.sh always uses `eu-strip --remove-comment`.  It does not use `strip -g`.

Comment 3 Panu Matilainen 2019-04-02 07:13:04 UTC
The debugging symbols that are there in final builds is known as minidebuginfo, see https://fedoraproject.org/wiki/Features/MiniDebugInfo

No bug here.


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