QEMU_LD_PREFIX not load correct library order in the PATH

Bug #1531352 reported by bananaappletw
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Expired
Undecided
Unassigned

Bug Description

run qemu with QEMU_LD_PREFIX argument will not load correct library order in the PATH.
How to reproduce this bug:
These command will download the library of other architectures
wget https://raw.githubusercontent.com/BinaryAnalysisPlatform/qira/master/fetchlibs.sh
bash fetchlibs.sh
This is 32bit binary file,
wget http://train.cs.nctu.edu.tw/files/magic
chmod +x ./magic
qemu-i386 -L /home/apple/libs/i386 /home/apple/magic
This is work fine.
But after you install gcc-multilib, it failed.
sudo apt-get install gcc-multilib
qemu-i386 -L /home/apple/libs/i386 /home/apple/magic
The following is the error message
/home/apple/magic: 0���: ̀Í�: D$(�$: Error 18446744073549536926
Because the order of dynamic linker search the shared library is wrong.
When your system has /lib32 directory, its priority is higher than the QEMU_LD_PREFIX.
If the system not loaded correspond with the dynamic linker, it will crash.
Code flow:
linux-user/main.c:
  call loader_exec
linuxload.c:
  call load_elf_binary
elfload.c:
  in load_elf_binary function
  dynamic loader will be elf_interpreter
I think the problem should be here.

description: updated
summary: - QEMU_LD_PREFIX PATH not work on loading library
+ QEMU_LD_PREFIX PATH loading library is not in the correct order
description: updated
summary: - QEMU_LD_PREFIX PATH loading library is not in the correct order
+ QEMU_LD_PREFIX not load correct library order in the PATH
description: updated
description: updated
description: updated
description: updated
description: updated
description: updated
description: updated
description: updated
description: updated
description: updated
no longer affects: gcc-defaults (Ubuntu)
description: updated
Revision history for this message
Thomas Huth (th-huth) wrote :

The QEMU project is currently considering to move its bug tracking to another system. For this we need to know which bugs are still valid and which could be closed already. Thus we are setting older bugs to "Incomplete" now.
If you still think this bug report here is valid, then please switch the state back to "New" within the next 60 days, otherwise this report will be marked as "Expired". Or mark it as "Fix Released" if the problem has been solved with a newer version of QEMU already. Thank you and sorry for the inconvenience.

Changed in qemu:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for QEMU because there has been no activity for 60 days.]

Changed in qemu:
status: Incomplete → Expired
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.