From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47725) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGjUY-0002T5-91 for qemu-devel@nongnu.org; Wed, 06 Jan 2016 03:30:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aGjUU-0004AR-7B for qemu-devel@nongnu.org; Wed, 06 Jan 2016 03:30:50 -0500 Received: from indium.canonical.com ([91.189.90.7]:49073) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGjUU-0004AB-0n for qemu-devel@nongnu.org; Wed, 06 Jan 2016 03:30:46 -0500 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.76 #1 (Debian)) id 1aGjUT-0001to-37 for ; Wed, 06 Jan 2016 08:30:45 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 1254E2E80C2 for ; Wed, 6 Jan 2016 08:30:45 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Wed, 06 Jan 2016 08:24:27 -0000 From: bananaapple Sender: bounces@canonical.com References: <20160106010526.4703.56064.malonedeb@chaenomeles.canonical.com> Message-Id: <20160106082427.27791.3600.launchpad@gac.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 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: = - call loader_exec - linuxload.c: = - call load_elf_binary - elfload.c: = - in load_elf_binary function - dynamic loader will be elf_interpreter + 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. ** Also affects: gcc-defaults (Ubuntu) Importance: Undecided Status: New ** No longer affects: gcc-defaults (Ubuntu) -- = 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 ./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