[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] qemu/linux-user main.c
From: |
Pierre Palatin |
Subject: |
Re: [Qemu-devel] qemu/linux-user main.c |
Date: |
Mon, 19 Mar 2007 21:46:24 +0100 |
User-agent: |
KMail/1.9.6 |
On Monday 19 March 2007 21:13:12 Thiemo Seufer wrote:
> J. Mayer wrote:
> > On Mon, 2007-03-19 at 12:16 +0000, Thiemo Seufer wrote:
> > > CVSROOT: /sources/qemu
> > > Module name: qemu
> > > Changes by: Thiemo Seufer <ths> 07/03/19 12:16:29
> > >
> > > Modified files:
> > > linux-user : main.c
> > >
> > > Log message:
> > > Support -cpu selection for mips usermode emulation. Fix segfault when
> > > dispaying the -cpu list help.
> >
> > Could you tell more about the segfault ?
>
> It segfaulted for me (on ppc/linux) after printing the help list.
>
> > exit is used at many other places without any problem and furthermore I
> > did not experiment any crash while testing the PowerPC target with the
> > initial patch, so ? (I'd really like to understand...)
>
> I didn't really debug it, but I noticed the other branch in the
> conditional uses _exit() instead of exit(). With that change, the
> segfault disappeared. I figure we have an atexit/on_exit call somwhere
> which tries to use data which isn't initialized at that point.
Maybe that's related to the problem i've got (in
http://lists.gnu.org/archive/html/qemu-devel/2007-03/msg00110.html ).
There is some piece of code in main.c which mess around libc initialization &
exit and were making my qemu-i386 segfault really early. It seems it was
designed to avoid a bug in some versions of glibc.
I attach the simple patch I've made to avoid that.
It may need adjustements since I don't know enough about libc internals on
initialization to be sure that's the correct fix - I would be deeply
interested in some input/comments on this problem.
Pierre Palatin
init-segfault.patch
Description: Text Data