[Bug 993955] [NEW] ld.so.preload bad pattern substitution

bubu 993955 at bugs.launchpad.net
Thu May 3 12:52:53 UTC 2012


Public bug reported:

On amd64 platform, as ld.so man page says, the pattern $LIB in
ld.so.preload shoud be replaced by /lib for amd64 executables and /lib32
for x86 executables:

"$LIB   The  string  $LIB  (or equivalently ${LIB}) in an rpath corresponds to the system libraries
              directory, which is /lib for the native architecture on FHS compliant GNU/Linux systems."

But in Ubuntu 12.04, $LIB is substituted by "x86_64-linux-gnu"

This is a test case:

FIRST: Set /etc/ld.so.preload content:
/$LIB/libMazingerPreload.so


SECOND: Exec strce ls -ald .

The following output shows the library that is trying to be loaded is
/x86_64-linux-gnu/libMazingerPreload.so when it should be
/lib/libMazingerPreload.so

OUTPUT:

ERROR: ld.so: object '/$LIB/libMazingerPreload.so' from /etc/ld.so.preload cannot be preloaded: ignored.
execve("/bin/ls", ["ls", "-ald", "."], [/* 47 vars */]) = 0
brk(0)                                  = 0x213c000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5f19e32000
access("/etc/ld.so.preload", R_OK)      = 0
open("/etc/ld.so.preload", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=28, ...}) = 0
mmap(NULL, 28, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0x7f5f19e31000
close(3)                                = 0
readlink("/proc/self/exe", "/bin/ls", 4096) = 7
open("/x86_64-linux-gnu/libMazingerPreload.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
writev(2, [{"ERROR: ld.so: object '", 22}, {"/$LIB/libMazingerPreload.so", 27}, {"' from ", 7}, {"/etc/ld.so.preload", 18}, {" cannot be preloaded: ignored.\n", 31}], 5ERROR: ld.so: object '/$LIB/libMazingerPreload.so' from /etc/ld.so.preload cannot be preloaded: ignored.
) = 105
munmap(0x7f5f19e31000, 28)              = 0


Best Regards


B.Buades

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: libc6 2.15-0ubuntu10
ProcVersionSignature: Ubuntu 3.2.0-24.37-generic 3.2.14
Uname: Linux 3.2.0-24-generic x86_64
ApportVersion: 2.0.1-0ubuntu7
Architecture: amd64
Date: Thu May  3 14:44:12 2012
InstallationMedia: Ubuntu 10.04.2 LTS "Lucid Lynx" - Release amd64 (20110211.1)
ProcEnviron:
 LANGUAGE=es_ES:en
 TERM=xterm
 PATH=(custom, user)
 LANG=es_ES.UTF-8
 SHELL=/bin/bash
SourcePackage: eglibc
UpgradeStatus: Upgraded to precise on 2012-05-03 (0 days ago)

** Affects: eglibc (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug precise

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

Title:
  ld.so.preload bad pattern substitution

Status in “eglibc” package in Ubuntu:
  New

Bug description:
  On amd64 platform, as ld.so man page says, the pattern $LIB in
  ld.so.preload shoud be replaced by /lib for amd64 executables and
  /lib32 for x86 executables:

  "$LIB   The  string  $LIB  (or equivalently ${LIB}) in an rpath corresponds to the system libraries
                directory, which is /lib for the native architecture on FHS compliant GNU/Linux systems."

  But in Ubuntu 12.04, $LIB is substituted by "x86_64-linux-gnu"

  This is a test case:

  FIRST: Set /etc/ld.so.preload content:
  /$LIB/libMazingerPreload.so

  
  SECOND: Exec strce ls -ald .

  The following output shows the library that is trying to be loaded is
  /x86_64-linux-gnu/libMazingerPreload.so when it should be
  /lib/libMazingerPreload.so

  OUTPUT:

  ERROR: ld.so: object '/$LIB/libMazingerPreload.so' from /etc/ld.so.preload cannot be preloaded: ignored.
  execve("/bin/ls", ["ls", "-ald", "."], [/* 47 vars */]) = 0
  brk(0)                                  = 0x213c000
  access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
  mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5f19e32000
  access("/etc/ld.so.preload", R_OK)      = 0
  open("/etc/ld.so.preload", O_RDONLY|O_CLOEXEC) = 3
  fstat(3, {st_mode=S_IFREG|0644, st_size=28, ...}) = 0
  mmap(NULL, 28, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0x7f5f19e31000
  close(3)                                = 0
  readlink("/proc/self/exe", "/bin/ls", 4096) = 7
  open("/x86_64-linux-gnu/libMazingerPreload.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
  writev(2, [{"ERROR: ld.so: object '", 22}, {"/$LIB/libMazingerPreload.so", 27}, {"' from ", 7}, {"/etc/ld.so.preload", 18}, {" cannot be preloaded: ignored.\n", 31}], 5ERROR: ld.so: object '/$LIB/libMazingerPreload.so' from /etc/ld.so.preload cannot be preloaded: ignored.
  ) = 105
  munmap(0x7f5f19e31000, 28)              = 0

  
  Best Regards


  
  B.Buades

  ProblemType: Bug
  DistroRelease: Ubuntu 12.04
  Package: libc6 2.15-0ubuntu10
  ProcVersionSignature: Ubuntu 3.2.0-24.37-generic 3.2.14
  Uname: Linux 3.2.0-24-generic x86_64
  ApportVersion: 2.0.1-0ubuntu7
  Architecture: amd64
  Date: Thu May  3 14:44:12 2012
  InstallationMedia: Ubuntu 10.04.2 LTS "Lucid Lynx" - Release amd64 (20110211.1)
  ProcEnviron:
   LANGUAGE=es_ES:en
   TERM=xterm
   PATH=(custom, user)
   LANG=es_ES.UTF-8
   SHELL=/bin/bash
  SourcePackage: eglibc
  UpgradeStatus: Upgraded to precise on 2012-05-03 (0 days ago)

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




More information about the foundations-bugs mailing list