oprofile should not link libbfd dynamically

Bug #426614 reported by Olof Johansson
44
This bug affects 8 people
Affects Status Importance Assigned to Milestone
oprofile (Debian)
Fix Released
Unknown
oprofile (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: oprofile

Oprofile, at least current version in karmic for arm, is linked against a version of libbfd that is not included in the libbfd package.

root@karmic:/usr/bin# ldd /usr/bin/opreport
        libpopt.so.0 => /lib/libpopt.so.0 (0x40035000)
        libbfd-2.19.51.20090723.so => not found
        libz.so.1 => /lib/libz.so.1 (0x40046000)
        libdl.so.2 => /lib/vfp/libdl.so.2 (0x40064000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x4006f000)
        libm.so.6 => /lib/vfp/libm.so.6 (0x40163000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x401dc000)
        libc.so.6 => /lib/vfp/libc.so.6 (0x401f0000)
        /lib/ld-linux.so.3 (0x40000000)
root@karmic:/usr/bin# ls -l /usr/lib/libbfd*
-rw-r--r-- 1 root root 614724 2009-08-28 09:46 /usr/lib/libbfd-2.19.51.20090827.so

oprofile package info as currently installed:

root@karmic:/usr/bin# dpkg -s oprofile
Package: oprofile
Status: install ok installed
Priority: optional
Section: devel
Installed-Size: 5148
Maintainer: Ubuntu Developers <email address hidden>
Architecture: armel
Version: 0.9.4+cvs20090629-2ubuntu1
Replaces: oprofile-common
Depends: debconf | debconf-2.0, binutils, libc6 (>= 2.4), libgcc1 (>= 1:4.4.0), libpopt0 (>= 1.14), libs)
Suggests: oprofile-gui
Conflicts: oprofile-modules0.2, oprofile-modules0.3, oprofile-modules0.4, oprofile-modules0.5, oprofile-8
Description: system-wide profiler for Linux systems
[... rest of description removed]

dpkg -s for binutils on my current system:

root@gumstix:~/o# dpkg -s binutils
Package: binutils
Status: install ok installed
Priority: optional
Section: devel
Installed-Size: 8832
Maintainer: Ubuntu Core developers <email address hidden>
Architecture: armel
Version: 2.19.51.20090827-1ubuntu1
Provides: elf-binutils
Depends: libc6 (>= 2.8), libgcc1 (>= 1:4.4.0), zlib1g (>= 1:1.1.4)
Suggests: binutils-doc (>= 2.19.51.20090827-1ubuntu1)
Conflicts: elf-binutils, gas, modutils (<< 2.4.19-1)
Description: The GNU assembler, linker and binary utilities
[...]

Looks like all is needed is a rebuild of oprofile (I verified this locally), but why was it linked against a date-versioned libbfd in the first place, instead of the base library (link)?

Daniel T Chen (crimsun)
Changed in oprofile (Ubuntu):
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Matthias Klose (doko) wrote :

fixed in oprofile_0.9.4+cvs20090629-2.1ubuntu1

Changed in oprofile (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Anders Kaseorg (andersk) wrote :

Same problem again on karmic amd64:

$ opreport
opreport: error while loading shared libraries: libbfd-2.19.91.20090910.so: cannot open shared object file: No such file or directory
$ ls /usr/lib/libbfd*
/usr/lib/libbfd-2.19.91.20090923.so /usr/lib/libbfd.a /usr/lib/libbfd.so
$ dpkg-query -W oprofile binutils
binutils 2.19.91.20090923-0ubuntu1
oprofile 0.9.4+cvs20090629-2.1ubuntu1

Changed in oprofile (Ubuntu):
status: Fix Released → New
Revision history for this message
Laurent Bonnaud (laurent-bonnaud) wrote :

Same problem with this version:

Package: oprofile
Architecture: i386
Version: 0.9.4+cvs20090629-2.1ubuntu1

$ opreport
opreport: error while loading shared libraries: libbfd-2.19.91.20090910.so: cannot open shared object file: No such file or directory

Changed in oprofile (Ubuntu):
status: New → Confirmed
Revision history for this message
Al Dimond (businessmanprogrammersteve) wrote :

I don't know a lot about this, but everything I've read in the last 15 minutes suggests that nothing should be linked dynamically toe libbfd (it's stated in the package info for binutils-dev, for example), but that it's rather easy to wind up with this on accident: http://<email address hidden>/msg631508.html . So, I guess... make sure the build procedures are in order.

Revision history for this message
Anders Kaseorg (andersk) wrote :

Indeed. Ubuntu actually has a patch that isn’t in Debian to link libbfd dynamically. Let’s get rid of that.

Anders Kaseorg (andersk)
tags: added: regression-potential
summary: - oprofile is linked against non-shipping version of libbfd
+ oprofile does not run in karmic (linked against non-shipping version of
+ libbfd)
Changed in oprofile (Debian):
status: Unknown → New
Changed in oprofile (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Fabrice Coutadeur (fabricesp) wrote : Re: oprofile does not run in karmic (linked against non-shipping version of libbfd)

Hi,

I don't think this is the right way to fix the problem with oprofile: the problem comes from an update of binutils, that has not been taken into account in oprofile because the package was FTBFS.

It's not the case anymore, so this can be simply fixed by recompiling the package.
Right now, it's not possible because of a bug in binutils, but as soon as it get fixed, I'll recompile it.

I'll unsubscribe u-u-s for the moment, and subscribe myself

Fabrice

Matthias Klose (doko)
Changed in oprofile (Ubuntu):
milestone: none → ubuntu-9.10
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package oprofile - 0.9.4+cvs20090629-2.1ubuntu2

---------------
oprofile (0.9.4+cvs20090629-2.1ubuntu2) karmic; urgency=low

  * Rebuild using binutils-dev 2.20. LP: #426614.

 -- Matthias Klose <email address hidden> Sat, 17 Oct 2009 12:26:17 +0200

Changed in oprofile (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Martin Olsson (mnemo) wrote :

Thanks a billion for jumping in like fuckin' MacGyver and fixing this bug right before release! That's just priceless.

Revision history for this message
Martin Olsson (mnemo) wrote :

I got the updates now and tested it, works beautifully. Again, thanks a lot!!

Revision history for this message
Anders Kaseorg (andersk) wrote :

Thanks for the rebuild. However, the root of this problem is that binutils-dev should never be linked dynamically. It says so in the package description: “Note that building Debian packages which depend on the shared libbfd is Not Allowed.” The Ubuntu-specific patch that causes oprofile to link libbfd dynamically is incorrect and should be removed.

Changed in oprofile (Ubuntu):
status: Fix Released → New
summary: - oprofile does not run in karmic (linked against non-shipping version of
- libbfd)
+ oprofile should not link libbfd dynamically
Changed in oprofile (Debian):
status: New → Fix Committed
Changed in oprofile (Debian):
status: Fix Committed → New
Revision history for this message
Evan Broder (broder) wrote :

Fabrice: Why do you think that oprofile should link libbfd dynamically?

 - The binutils-dev description is clear that you shouldn't do link dynamically
 - Linking dynamically is an Ubuntu-specific patch (that lacks any helpful explanation of why it's there)
 - This package has now broken repeatedly due to libbfd upgrades

From my perspective, all signs are pointing towards linking statically, and I can't come up with any justification for why we should be linking dynamically.

Revision history for this message
Evan Broder (broder) wrote :

I'm going to go ahead and upload this, since nobody else seems to have suggested any reason that libbfd shouldn't be linked statically.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package oprofile - 0.9.4+cvs20090629-2.1ubuntu3

---------------
oprofile (0.9.4+cvs20090629-2.1ubuntu3) lucid; urgency=low

  * Remove debian/patches/unstatic_libbfd.patch. It caused oprofile to
    break on every binutils upgrade because the libbfd soname changes
    frequently. Presumably for this reason, the package description for
    binutils-dev says “Note that building Debian packages which depend on
    the shared libbfd is Not Allowed.” (LP: #426614)
  * Don’t build-depend autoconf (just to keep the Debian diff smaller;
    this actually has no effect since automake1.10 already depends
    autoconf).
  * Undo the change in -2.1ubuntu2 to the versioned build-dependency on
    binutils-dev.
 -- Anders Kaseorg <email address hidden> Sun, 18 Oct 2009 14:40:37 -0400

Changed in oprofile (Ubuntu):
status: New → Fix Released
Changed in oprofile (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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