[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#462456: lintian: Please consider testing if files in -dbg packages retain Dynamic Section entries



Package: lintian
Version: 1.23.42
Severity: wishlist

See #462007 - I have come across a non-obvious problem in the use of
-dbg packages using dh_strip where, if a .install file exists for the
-dbg package, dh_install copies the unstripped object into the -dbg
build directory. When dh_strip --dbg-package=libfoo-dbg is then called,
it silently omits the file from the call to objcopy --only-keep-debug
(to prevent an objcopy error), resulting in an unstripped object file
being retained in the -dbg package that has a complete (and fully
functional) copy of the library embedded inside - as shown by the
presence of a full Dynamic Section under objdump -p. Without the
.install file, dh_strip takes care of copying the debug symbols into
place directly - no .install command is actually needed.

The solution is to simply remove the debian/libfoo-dbg.install file.

However, the error goes undetected because dh_strip outputs no warnings,
lintian does not check for it (yet) and there is no particular sign of a
problem except the larger size of the files in the -dbg package. With a
new library package (or the addition of a new -dbg package to an
existing library source), this could easily be missed because all
debugging operations using the -dbg package are unaffected.

With the .install file present:
$ ll /usr/lib/debug/usr/lib/libqof*.so.*.*
-rw-r--r-- 1 root root  155585 2007-12-19 21:49
/usr/lib/debug/usr/lib/libqof-backend-qsf.so.0.0.7
-rw-r--r-- 1 root root   78554 2007-12-19 21:49
/usr/lib/debug/usr/lib/libqof-backend-sqlite.so.0.0.2
-rw-r--r-- 1 root root 1029686 2007-12-19 21:49
/usr/lib/debug/usr/lib/libqof.so.1.0.9

With the .install file removed:
$ debc | tail
drwxr-xr-x root/root         0 2008-01-24 22:53 ./usr/lib/debug/usr/lib/
-rw-r--r-- root/root    728646 2008-01-24 22:53
./usr/lib/debug/usr/lib/libqof.so.1.0.9
-rw-r--r-- root/root    103217 2008-01-24 22:53
./usr/lib/debug/usr/lib/libqof-backend-qsf.so.0.0.7
-rw-r--r-- root/root     47930 2008-01-24 22:53
./usr/lib/debug/usr/lib/libqof-backend-sqlite.so.0.0.2

It should be relatively simple for lintian to check for entries in the
Dynamic Section under objdump -p - the 'Dynamic Section' will be present
but a listing in that section should, IMHO, be a lintian warning.

"dbg-package-with-dynamic-section-entries"
"The ${name} debug package may contain an embedded copy of the unstripped
library ${name} instead of only the debugging symbols. Please check that
you have not tried to install the ${name} library into the -dbg package,
either manually or via a debian/${name}-dbg.install file. There is no
need to install ${filename} into the -dbg package as 
dh_strip --dbg-package=${name}-dbg will do it for you."

How does that sound?


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.22-2-amd64 (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages lintian depends on:
ii  binutils            2.18.1~cvs20080103-1 The GNU assembler, linker and bina
ii  diffstat            1.45-2               produces graph of changes introduc
ii  dpkg-dev            1.14.16.4            package building tools for Debian
ii  file                4.23-1               Determines file type using "magic"
ii  gettext             0.17-2               GNU Internationalization utilities
ii  intltool-debian     0.35.0+20060710.1    Help i18n of RFC822 compliant conf
ii  libparse-debianchan 1.1.1-2              parse Debian changelogs and output
ii  liburi-perl         1.35.dfsg.1-1        Manipulates and accesses URI strin
ii  man-db              2.5.0-4              on-line manual pager
ii  perl [libdigest-md5 5.8.8-12             Larry Wall's Practical Extraction 

lintian recommends no packages.

-- no debconf information



Reply to: