ld.so.preload bad pattern substitution

Bug #993955 reported by bubu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
eglibc (Ubuntu)
New
Undecided
Unassigned

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)

Revision history for this message
bubu (bbuades) wrote :
Revision history for this message
Adam Conrad (adconrad) wrote :

On raring, $LIB is now completed to "lib/<triplet>" instead of just "<triplet>", which seems to match the pre-multiarch behaviour of just completing it to "lib", though neither matches the manpage's implication that there should be a slash prepended.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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