[Bug 234901] Re: Please apply upstream patch for dpkg-buildsource

Steve Langasek steve.langasek at canonical.com
Wed Mar 14 00:24:34 UTC 2012


I'm not sure by what mechanism this has been fixed, but testing with
nss_wins + libsmbclient in precise, I can no longer reproduce a crash
due to -Wl,-Bsymbolic-functions.

According to the build log at
https://launchpad.net/ubuntu/+source/samba/2:3.6.3-1ubuntu1/+build/3228461/+files
/buildlog_ubuntu-precise-amd64.samba_2%3A3.6.3-1ubuntu1_BUILDING.txt.gz,
the latest samba is built with these options:

      LDFLAGS    = -pie -Wl,-z,relro -L/usr/lib/x86_64-linux-gnu -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -L./bin
      LDSHFLAGS  = -fPIC -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/x86_64-linux-gnu -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -L./bin -lc -Wl,-z,defs

Perhaps the presence of -Bsymbolic here resolves this.

** Changed in: samba (Ubuntu)
       Status: Confirmed => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to dpkg in Ubuntu.
https://bugs.launchpad.net/bugs/234901

Title:
  Please apply upstream patch for dpkg-buildsource

Status in “dpkg” package in Ubuntu:
  Won't Fix
Status in “samba” package in Ubuntu:
  Fix Released

Bug description:
  Binary package hint: dpkg

  Release: Ubuntu Hardy (8.04)
  Package: dpkg 1.14.16.6ubuntu3

  Script dpkg-buildsource includes harmful default option "-Wl
  ,-Bsymbolic-functions" for LDFLAGS.

  This affects many "pkg-config"-like mechanizm based programs, such as
  krb5-config, mysql-config, net-snmp-config, etc.  And this flag
  cascades to other packages such as cupsys, samba, etc, using such
  packages.

  Upstream of dpkg fixed this bug on this commit:
  http://git.debian.org/?p=dpkg/dpkg.git;a=commit;h=12617e848c82f2c5809fb2112170177ad9cda4e6

  But the version of the source in Ubuntu Hardy differs from it,  So I
  created patch having same meaning. (I attached to this report).

  
  Further information:

  Linker flag "-Bsymbolic(-functions)" is for library developers, not for library users.
  Unintended usage for this flag may break condition on run-time, for example, non-correct initialization.

  
  Example:

  Samba package was built with "-Wl,Bsymbolic-functions" flag unintentionally.
  (This flag was incorporated by krb5-config and cups-config.)

  If you use "wins" option for "host" in nsswitch.conf, following simple
  program built with "-lsmbclient" stops accidentally.

  #include <netdb.h>
  int main(int argc, char *argv[])
  {
      gethostbyname("non-existent hostname or NMB hostname");
      return 0;
  }

  (Mechanism: Both of libsmbclient.so and libnss_wins.so include same
  source lib/debug.c.  That file has symbol named "DEBUGLEVEL_CLASS" as
  variable, and symbol named "debug_add_class" as function.  With
  "-Bsymbolic-functions" flag, the symbol "debug_add_class" is resolved
  in each library, but the symbol "DEBUGLEVEL_CLASS" is commonly
  allocated for both of libraries.  Libnss_wins.so falsely recognizes
  DEBUGLEVEL_CLASS is already initialized.  And realloc() for
  uninitialized area fails.  This is not a samba's bug.  Unintentional
  use "-Wl,-Bsymbolic-functions" fires that bug.)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/dpkg/+bug/234901/+subscriptions




More information about the foundations-bugs mailing list