Received: from eggs.gnu.org ([2001:4830:134:3::10]:42509) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGj1X-0005FH-MU for qemu-devel@nongnu.org; Wed, 06 Jan 2016 03:00:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aGj1U-0006xA-F3 for qemu-devel@nongnu.org; Wed, 06 Jan 2016 03:00:51 -0500 Received: from indium.canonical.com ([91.189.90.7]:43129) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGj1U-0006x5-9P for qemu-devel@nongnu.org; Wed, 06 Jan 2016 03:00:48 -0500 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.76 #1 (Debian)) id 1aGj1T-0004IW-Mv for ; Wed, 06 Jan 2016 08:00:47 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 930FC2E80C3 for ; Wed, 6 Jan 2016 08:00:47 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Wed, 06 Jan 2016 07:55:39 -0000 From: bananaapple Sender: bounces@canonical.com References: <20160106010526.4703.56064.malonedeb@chaenomeles.canonical.com> Message-Id: <20160106075539.4703.60160.launchpad@chaenomeles.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 + 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 ./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 I think the problem should be here. To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1531352/+subscriptions