www.cendio.com
Bug 2989 - Find easy way of installing non-stripped binaries or debuginfo
: Find easy way of installing non-stripped binaries or debuginfo
Status: CLOSED FIXED
: ThinLinc
Other
: trunk
: PC Unknown
: P2 Normal
: 4.0.0
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2009-01-16 10:00 by
Modified: 2012-11-28 12:09 (History)
Acceptance Criteria:


Attachments


Note

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


Description From cendio 2009-01-16 10:00:31
issue7231 is one example of when it can be useful to generate core files on a
customer system. In this case, the debug information is needed. There seems to
be various ways of accomplishing this, the easiest one being to simply ship
non-stripped binaries. These are huge, however. For example, a non-stripped
Xvnc is 14 MiB, while a stripped one is 3.3 MiB. 

Another approach, adopted by Fedora, is to build special debuginfo packages.
This is described on https://fedoraproject.org/wiki/Packaging:Debuginfo. I
think this looks like a nice approach, and following the Fedora approach is
also good. The problem, however, is that our RPM version on Gorgonzola is too
old to generate debuginfo RPMs. 

We also need to verify that debuginfo packages will work on other
distributions.
------- Comment #1 From cendio 2009-01-21 13:13:06 -------
As a side note, for unknown reasons, most of our binaries shipped for Solaris
are not stripped:

bash-2.03# file * | grep stripped | grep not
Xvnc:           ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required,
dynamically linked, not stripped
dialog:         ELF 32-bit MSB executable SPARC Version 1, dynamically linked,
not stripped
openssl:        ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required,
dynamically linked, not stripped
rrdtool:        ELF 32-bit MSB executable SPARC Version 1, dynamically linked,
not stripped
ssh-keyscan:    ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required,
dynamically linked, not stripped
tl-cert-dn:     ELF 32-bit MSB executable SPARC Version 1, dynamically linked,
not stripped
tl-initgroups:  ELF 32-bit MSB executable SPARC Version 1, dynamically linked,
not stripped
xprop:          ELF 32-bit MSB executable SPARC Version 1, dynamically linked,
not stripped
bash-2.03#
bash-2.03# file * | grep stripped | grep -v not
Xdialog:        ELF 32-bit MSB executable SPARC Version 1, dynamically linked,
stripped
cyclades-ser-cli:       ELF 32-bit MSB executable SPARC Version 1, dynamically
linked, stripped
noctty:         ELF 32-bit MSB executable SPARC Version 1, dynamically linked,
stripped
rsync:          ELF 32-bit MSB executable SPARC Version 1, dynamically linked,
stripped
tl-pam-passwd:  ELF 32-bit MSB executable SPARC Version 1, dynamically linked,
stripped
------- Comment #2 From cendio 2009-01-21 16:23:34 -------
It turns out that many binaries are unstripped even on Linux:

# file /opt/thinlinc/bin/* /opt/thinlinc/sbin/* /opt/thinlinc/libexec/* | grep
-v python | grep -v script | grep "not stripped"
/opt/thinlinc/bin/vncconfig:                    ELF 32-bit LSB executable,
Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for
GNU/Linux 2.2.5, not stripped
/opt/thinlinc/sbin/encrypt-vnc-pw:              ELF 32-bit LSB executable,
Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for
GNU/Linux 2.2.5, not stripped
/opt/thinlinc/sbin/lsh-pam-checkpw:             ELF 32-bit LSB executable,
Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for
GNU/Linux 2.2.5, not stripped
/opt/thinlinc/libexec/dialog:                   ELF 32-bit LSB executable,
Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for
GNU/Linux 2.2.5, not stripped
/opt/thinlinc/libexec/openssl:                  ELF 32-bit LSB executable,
Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for
GNU/Linux 2.2.5, not stripped
/opt/thinlinc/libexec/rrdtool:                  ELF 32-bit LSB executable,
Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for
GNU/Linux 2.2.5, not stripped
/opt/thinlinc/libexec/ssh-keyscan:              ELF 32-bit LSB executable,
Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for
GNU/Linux 2.2.5, not stripped
/opt/thinlinc/libexec/tl-cert-dn:               ELF 32-bit LSB executable,
Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for
GNU/Linux 2.2.5, not stripped
/opt/thinlinc/libexec/tl-initgroups:            ELF 32-bit LSB executable,
Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for
GNU/Linux 2.2.5, not stripped
/opt/thinlinc/libexec/xprop:                    ELF 32-bit LSB executable,
Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for
GNU/Linux 2.2.5, not stripped
------- Comment #3 From cendio 2012-03-15 10:39:26 -------
rpm needs elfutils to be able to produce debuginfo packages. spent a little
time here and there and have now added elfutils to cenbuild.

What remains to be able to have debuginfo packages:
- Stop stripping stuff
- Make a zip of the debuginfo packages produced in a build
------- Comment #4 From cendio 2012-09-28 16:46:44 -------
More things are needed to get it working. Complete list should be:

 - Stop stripping. Doing "make install STRIP=/bin/true" should be sufficient in
most cases.

 - Turn on debug symbols. I.e. make sure "-g" is included everywhere.

 - Turn on debuginfo creation by getting "%{debug_package}" into our spec
files. We can put it directly in the files, or modify rpm in cenbuild to always
include it.

 - Make sure rpm uses the correct strip. It uses /usr/bin/strip by default. For
Solaris we need to change it. This code generally works:

    %if %{solaris}
    %define __strip /usr/bin/${CB_host}-strip
    %endif

 - Make a zip of the resulting debug packages

Possible extra steps required:

 - Stop using ".." in paths given to rpm. It seems to confuse the debuginfo
generation.

 - Make sure the binaries have build ids. Our binutils is new enough, but our
gcc needs to be patched to give --build-id to ld by default. We might also need
to fix this bug:

    https://bugzilla.redhat.com/show_bug.cgi?id=472152

 - Make sure all cenbuild packages also have debuginfo. We link a lot of stuff
statically, so we might not get full debug support unless we also have cenbuild
packages.
------- Comment #5 From cendio 2012-09-29 11:43:03 -------
(In reply to comment #4)
> More things are needed to get it working. Complete list should be:
> 
>  - Stop stripping.
> 
>  - Turn on debuginfo creation
> 
>  - Make sure rpm uses the correct strip.

r25933.

> 
>  - Stop using ".." in paths given to rpm. It seems to confuse the debuginfo
> generation.
> 

r25931.
------- Comment #6 From cendio 2012-10-01 14:36:34 -------
(In reply to comment #4)
> 
>  - Turn on debug symbols. I.e. make sure "-g" is included everywhere.
> 

r25937.
------- Comment #7 From cendio 2012-10-01 14:50:55 -------
(In reply to comment #4)
> 
>  - Make sure the binaries have build ids.
> 

Bug 4410.
------- Comment #8 From cendio 2012-10-02 14:36:13 -------
(In reply to comment #4)
>  - Make a zip of the resulting debug packages
> 

r25942.
------- Comment #9 From cendio 2012-10-02 14:37:49 -------
(In reply to comment #4)
> 
>  - Make sure all cenbuild packages also have debuginfo.

Bug 4414.
------- Comment #10 From cendio 2012-10-02 14:39:15 -------
All done. Tester should make sure that relevant binaries seem to include the
proper debug information.
------- Comment #11 From cendio 2012-10-15 12:09:54 -------
Using latest server build 3680:

find /opt/thinlinc/ -executable -type f -exec file {} \;  | grep -i elf | grep
"not stripped"

Does not match any file, so all our binaries are stripped as the should be.
------- Comment #12 From cendio 2012-10-15 13:35:11 -------
for file in $(find /opt/thinlinc/ -executable -type f -exec file {} \;  | grep
-i elf | awk -F:  '{print($1);}'); do eu-unstrip -n -e $file; done

Shows that our binaries are built without buildid , which seems to be the 
truth due to bug #4410.
------- Comment #13 From cendio 2012-10-15 14:40:29 -------
After installing all debug packages on my ubuntu test setup build 3680,
and running:

 for file in $(find /opt/thinlinc/ -executable -type f -exec file {} \;  | grep
-i elf | awk -F:  '{print($1);}'); do eu-unstrip -n -e $file; done

The following list shows what binaries that have debug info symbols

0x400000+0x201278 - /opt/thinlinc/sbin/lsh-pam-checkpw
/usr/lib/debug/opt/thinlinc/sbin/lsh-pam-checkpw.debug 
0x400000+0x203a80 - /opt/thinlinc/sbin/encrypt-vnc-pw
/usr/lib/debug/opt/thinlinc/sbin/encrypt-vnc-pw.debug 
0+0x29c0 - /opt/thinlinc/lib/libhomecreatefilter.so - 
0+0x8e18 - /opt/thinlinc/lib/libpcsctun.so - 
0+0x3794 - /opt/thinlinc/lib/libcyclades-ser-cli.so - 
0x400000+0x23afc8 - /opt/thinlinc/bin/vncconfig
/usr/lib/debug/opt/thinlinc/bin/vncconfig.debug 
0x400000+0x8d9c48 - /opt/thinlinc/bin/rdesktop
/usr/lib/debug/opt/thinlinc/bin/rdesktop.debug 
0x400000+0x200dc8 - /opt/thinlinc/bin/tl-vdi-tool
/usr/lib/debug/opt/thinlinc/bin/tl-vdi-tool.debug 
0x400000+0x2013f8 - /opt/thinlinc/bin/tl-while-x11
/usr/lib/debug/opt/thinlinc/bin/tl-while-x11.debug 
0x400000+0x255e90 - /opt/thinlinc/bin/xkbcomp
/usr/lib/debug/opt/thinlinc/bin/xkbcomp.debug 
0+0x4bdbe0 - /opt/thinlinc/lib64/swrast_dri.so
/usr/lib/debug/opt/thinlinc/lib64/swrast_dri.so.debug 
0+0x201fd0 - /opt/thinlinc/lib64/libhomecreatefilter.so - 
0+0x2096b0 - /opt/thinlinc/lib64/libpcsctun.so
/usr/lib/debug/opt/thinlinc/lib64/libpcsctun.so.debug 
0+0x202df8 - /opt/thinlinc/lib64/libcyclades-ser-cli.so
/usr/lib/debug/opt/thinlinc/lib64/libcyclades-ser-cli.so.debug 
0x400000+0x201288 - /opt/thinlinc/libexec/tl-pam-passwd
/usr/lib/debug/opt/thinlinc/libexec/tl-pam-passwd.debug 
0x400000+0x221e08 - /opt/thinlinc/libexec/tl-crltool
/usr/lib/debug/opt/thinlinc/libexec/tl-crltool.debug 
0x400000+0x24ef08 - /opt/thinlinc/libexec/rrdtool
/usr/lib/debug/opt/thinlinc/libexec/rrdtool.debug 
0x400000+0x205c18 - /opt/thinlinc/libexec/xset
/usr/lib/debug/opt/thinlinc/libexec/xset.debug 
0x400000+0x2034e8 - /opt/thinlinc/libexec/xdpyinfo
/usr/lib/debug/opt/thinlinc/libexec/xdpyinfo.debug 
0x400000+0x21dff8 - /opt/thinlinc/libexec/cyclades-ser-cli
/usr/lib/debug/opt/thinlinc/libexec/cyclades-ser-cli.debug 
0x400000+0x613878 - /opt/thinlinc/libexec/Xvnc
/usr/lib/debug/opt/thinlinc/libexec/Xvnc.debug 
0x400000+0x2023a8 - /opt/thinlinc/libexec/tl-umount-personal
/usr/lib/debug/opt/thinlinc/libexec/tl-umount-personal.debug 
0x400000+0x200b58 - /opt/thinlinc/libexec/noctty
/usr/lib/debug/opt/thinlinc/libexec/noctty.debug 
0x400000+0x20efc8 - /opt/thinlinc/libexec/xprop
/usr/lib/debug/opt/thinlinc/libexec/xprop.debug 
0x400000+0x24cc38 - /opt/thinlinc/libexec/rsync
/usr/lib/debug/opt/thinlinc/libexec/rsync.debug 
0x400000+0x221ee8 - /opt/thinlinc/libexec/tl-certtool
/usr/lib/debug/opt/thinlinc/libexec/tl-certtool.debug 
0x400000+0x206450 - /opt/thinlinc/libexec/tl-xinit
/usr/lib/debug/opt/thinlinc/libexec/tl-xinit.debug 
0x400000+0x203b20 - /opt/thinlinc/libexec/tl-session
/usr/lib/debug/opt/thinlinc/libexec/tl-session.debug 
0x400000+0x202398 - /opt/thinlinc/libexec/tl-mount-personal
/usr/lib/debug/opt/thinlinc/libexec/tl-mount-personal.debug 
0x400000+0x3407e8 - /opt/thinlinc/libexec/ssh-keyscan
/usr/lib/debug/opt/thinlinc/libexec/ssh-keyscan.debug 
0x400000+0x308cc8 - /opt/thinlinc/libexec/tlstunnel
/usr/lib/debug/opt/thinlinc/libexec/tlstunnel.debug
------- Comment #14 From cendio 2012-10-15 14:42:11 -------
When attaching to a running Xvnc i can see that debug symbols are loaded
except with this particular issue:

Reading symbols from /opt/thinlinc/lib64/swrast_dri.so...Reading symbols from
/usr/lib/debug/opt/thinlinc/lib64/swrast_dri.so.debug...(no debugging symbols
found)...done.

Is this a problem ?
------- Comment #15 From cendio 2012-10-17 10:05:22 -------
(In reply to comment #14)
> When attaching to a running Xvnc i can see that debug symbols are loaded
> except with this particular issue:
> 
> Reading symbols from /opt/thinlinc/lib64/swrast_dri.so...Reading symbols from
> /usr/lib/debug/opt/thinlinc/lib64/swrast_dri.so.debug...(no debugging symbols
> found)...done.
> 
> Is this a problem ?

r26015.
------- Comment #16 From cendio 2012-10-18 08:47:18 -------
Tested latest build and swrast_dri does now have debugs symbols,
running the mentioned eu-unstrip mentioned about reveals that
the following libraries not have debug symbols:

/opt/thinlinc/lib/libhomecreatefilter.so
/opt/thinlinc/lib/libpcsctun.so
/opt/thinlinc/lib/libcyclades-ser-cli.so

/opt/thinlinc/lib64/libhomecreatefilter.so

Something we probably should add for completion.
------- Comment #17 From cendio 2012-10-18 12:57:34 -------
(In reply to comment #16)
> Tested latest build and swrast_dri does now have debugs symbols,
> running the mentioned eu-unstrip mentioned about reveals that
> the following libraries not have debug symbols:
> 
> /opt/thinlinc/lib/libhomecreatefilter.so
> /opt/thinlinc/lib/libpcsctun.so
> /opt/thinlinc/lib/libcyclades-ser-cli.so
> 

User error. The 32-bit stuff has its debug symbols in the 32-bit package.

> /opt/thinlinc/lib64/libhomecreatefilter.so
> 

r26037.

> Something we probably should add for completion.
------- Comment #18 From cendio 2012-10-18 13:46:43 -------
(In reply to comment #17)
> (In reply to comment #16)
> > Tested latest build and swrast_dri does now have debugs symbols,
> > running the mentioned eu-unstrip mentioned about reveals that
> > the following libraries not have debug symbols:
> > 
> > /opt/thinlinc/lib/libhomecreatefilter.so
> > /opt/thinlinc/lib/libpcsctun.so
> > /opt/thinlinc/lib/libcyclades-ser-cli.so
> > 
> 
> User error. The 32-bit stuff has its debug symbols in the 32-bit package.
>

Not entirely, if we have packages with mixed arch binaries, the debug packages
should reflect that ? :)

> > /opt/thinlinc/lib64/libhomecreatefilter.so
> > 
> 
> r26037.
> 
> > Something we probably should add for completion.
------- Comment #19 From cendio 2012-10-18 14:04:18 -------
(In reply to comment #18)
> (In reply to comment #17)
> > (In reply to comment #16)
> > > Tested latest build and swrast_dri does now have debugs symbols,
> > > running the mentioned eu-unstrip mentioned about reveals that
> > > the following libraries not have debug symbols:
> > > 
> > > /opt/thinlinc/lib/libhomecreatefilter.so
> > > /opt/thinlinc/lib/libpcsctun.so
> > > /opt/thinlinc/lib/libcyclades-ser-cli.so
> > > 
> > 
> > User error. The 32-bit stuff has its debug symbols in the 32-bit package.
> >
> 
> Not entirely, if we have packages with mixed arch binaries, the debug packages
> should reflect that ? :)
> 

ubuntu problem, deb packages are name as amd64 even if it contains 32bit
binaries..

> > > /opt/thinlinc/lib64/libhomecreatefilter.so
> > > 
> > 
> > r26037.
> > 
> > > Something we probably should add for completion.
------- Comment #20 From cendio 2012-10-18 14:04:55 -------
I'm all good with this, closing this bug.