From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I2MeF-0007SL-8E for qemu-devel@nongnu.org; Sun, 24 Jun 2007 03:36:39 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I2MeE-0007S9-P6 for qemu-devel@nongnu.org; Sun, 24 Jun 2007 03:36:38 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I2MeE-0007S6-LJ for qemu-devel@nongnu.org; Sun, 24 Jun 2007 03:36:38 -0400 Received: from static-71-162-243-5.phlapa.fios.verizon.net ([71.162.243.5] helo=grelber.thyrsus.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I2MeE-0002WS-DG for qemu-devel@nongnu.org; Sun, 24 Jun 2007 03:36:38 -0400 From: Rob Landley Subject: Re: [Qemu-devel] [PATCH] qemu-i386 segfaults running "hello world". Date: Sun, 24 Jun 2007 03:36:36 -0400 References: <200706221715.16729.rob@landley.net> <200706221831.20531.rob@landley.net> <467D0027.6040503@mail.berlios.de> In-Reply-To: <467D0027.6040503@mail.berlios.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200706240336.36647.rob@landley.net> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Saturday 23 June 2007 07:12:39 Stefan Weil wrote: > Rob Landley schrieb: > > Ok, it's a more fundamental problem: > > > > landley@triolith:/sys$ qemu-i386 > > Segmentation fault (core dumped) > > > > Nothing to do with the program it's trying to run, it segfaults with no > > arguments. > > > > Is anybody else seeing this? > > > > Rob > > Yes, I see this on Debian Linux since several months (libc update?). Ubuntu 7.04 is using glibc-2.5. > The crash is caused by libc startup code which calls a null pointer. > QEMU provides this null pointer with the __init_array_start > workaround in linux-user/main.c. What exactly is this working around, anyway? There are comments in the code that it's doing something fancy (being both a shared library and an executable, I think) but I'm not sure why... > This can be fixed with some kind of code hack - see my patch > (which is not really a solution, but one more workaround). I applied your patch and still got the segfault. > Nevertheless user mode emulations remains unusable even > with this patch because of TLS problems. That I know how to work around. Set the environment variable LD_ASSUME_KERNEL=2.4.1 and glibc won't try to use TLS. > Regards, > Stefan Rob -- "One of my most productive days was throwing away 1000 lines of code." - Ken Thompson.