qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] A strange segmentation fault


From: Heng Yin
Subject: [Qemu-devel] A strange segmentation fault
Date: Tue, 05 Dec 2006 16:47:35 -0000
User-agent: Thunderbird 1.5.0.8 (X11/20061025)

Hi Qemu developers,

I'm running into a strange problem, when I do some implementation on Qemu.

In target_i386/op.c, if I add a function call in the following function, Qemu will crash immediately after execution.

void OPPROTO op_jnz_T0_label(void)
{
    helper_test(T0); //this is the function I add
    if (T0)
        GOTO_LABEL_PARAM(1);
    FORCE_RET();
}

I define this function in target_i386/helper.c:
int helper_test(int a)
{
    return a*3;
}

However, if my function takes no arguments, qemu works well.
void OPPROTO op_jnz_T0_label(void)
{
    helper_test(); //this is the function I add
    if (T0)
        GOTO_LABEL_PARAM(1);
    FORCE_RET();
}

I define this function in target_i386/helper.c:
int helper_test()
{
    return 100+cpu_single_env;
}

I built qemu on linux, and tested it on 0.8.0 and 0.8.2, and the problem appeared on both versions. I also tried to load winxp and linux images with three different options for kqemu: -kernel-kqemu -no-kqemu (none), and nothing is changed.

Below is the message I got in gdb:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1212746048 (LWP 5587)]
0x00000001 in ?? ()
(gdb) bt
#0  0x00000001 in ?? ()
#1 0x080bac6c in cpu_x86_exec (env1=0x40) at /home/hyin/qemu-0.8.2/cpu-exec.c:772
#2  0x08050a62 in main_loop () at /home/hyin/qemu-0.8.2/vl.c:5069
#3 0x08051fe2 in main (argc=3324, argv=0x8) at /home/hyin/qemu-0.8.2/vl.c:6221

Can you guys give any idea of what may cause this problem and how to solve it?

Thanks,
Heng




reply via email to

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