From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGmqa-0000Ob-Qa for qemu-devel@nongnu.org; Wed, 06 Jan 2016 07:05:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aGmqX-0000ko-JH for qemu-devel@nongnu.org; Wed, 06 Jan 2016 07:05:48 -0500 Received: from indium.canonical.com ([91.189.90.7]:51314) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGmqX-0000kh-Di for qemu-devel@nongnu.org; Wed, 06 Jan 2016 07:05:45 -0500 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.76 #1 (Debian)) id 1aGmqW-000325-Qr for ; Wed, 06 Jan 2016 12:05:44 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id BD45C2E80C3 for ; Wed, 6 Jan 2016 12:05:44 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Wed, 06 Jan 2016 11:58:43 -0000 From: bananaapple Sender: bounces@canonical.com References: <20160106010526.4703.56064.malonedeb@chaenomeles.canonical.com> Message-Id: <20160106115843.11603.17374.launchpad@wampee.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 1531352] Re: QEMU_LD_PREFIX not load correct library order in the PATH Reply-To: Bug 1531352 <1531352@bugs.launchpad.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org ** Description changed: 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 - ./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=EF=BF=BD=EF=BF=BD=EF=BF=BD: =CD=80=C3=8D=EF=BF=BD: D= $(=EF=BF=BD=04$=02: 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 QE= MU_LD_PREFIX. If the system not loaded correspond with the dynamic linker, it will cras= h. Code flow: linux-user/main.c: =C2=A0=C2=A0call loader_exec linuxload.c: =C2=A0=C2=A0call load_elf_binary elfload.c: =C2=A0=C2=A0in load_elf_binary function =C2=A0=C2=A0dynamic loader will be elf_interpreter I think the problem should be here. -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1531352 Title: QEMU_LD_PREFIX not load correct library order in the PATH Status in QEMU: New 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=EF=BF=BD=EF=BF=BD=EF=BF=BD: =CD=80=C3=8D=EF=BF=BD: D= $(=EF=BF=BD=04$=02: 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 QE= MU_LD_PREFIX. If the system not loaded correspond with the dynamic linker, it will cras= h. Code flow: linux-user/main.c: =C2=A0=C2=A0call loader_exec linuxload.c: =C2=A0=C2=A0call load_elf_binary elfload.c: =C2=A0=C2=A0in load_elf_binary function =C2=A0=C2=A0dynamic loader will be elf_interpreter I think the problem should be here. To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1531352/+subscriptions