qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] Avoid immediate segfault of qemu-i386 on x86_64 hos


From: Pierre Palatin
Subject: [Qemu-devel] [PATCH] Avoid immediate segfault of qemu-i386 on x86_64 host
Date: Sat, 10 Mar 2007 11:31:15 +0100
User-agent: KMail/1.9.6

Hi,

I've got a systematic segfault in qemu-i386 ( 0.8.2, 0.9.0 and CVS, but not 
0.8.1) on my x86_64. The segfault happens in glibc (2.4) initialization 
phase, before main :

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x000000006004a06f in __libc_csu_init ()
#2  0x00002acb8cc1dbce in __libc_start_main (main=0x60005120 <main>, argc=1, 
ubp_av=0x7fff1e3192e8, init=0x6004a010 <__libc_csu_init>, fini=0x2acb8cf39270 
<initial+16>,
    rtld_fini=0x2acb8c799c30 <_dl_fini>, stack_end=0x7fff1e3192d8) at 
libc-start.c:190
#3  0x0000000060004b89 in _start ()

Basically, it tries to call a function through a function pointer, but this 
pointer is NULL, hence the segfault. 

The problems lies in the declaration in linux-user/main.c of 
__init_array_start variable and friends. Simply removing them do the trick 
and makes qemu-i386 work nicely. 

I don't really know why this is here; commit tells "RH9 fix - path patch" and 
code comment refers to a probable bug in ld. So I've just changed (in the 
attached patch) glibc requirement for those variable declarations from  
glibc>=2.3  to glibc == 2.3. 
I guess it would need additional tests on a more wide variety of hosts.

Pierre Palatin

Attachment: init-segfault.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]