From: Heng Yin <hyin@ece.cmu.edu>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] A strange segmentation fault
Date: Tue, 05 Dec 2006 16:47:35 -0000 [thread overview]
Message-ID: <4575A29E.3000604@ece.cmu.edu> (raw)
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
next reply other threads:[~2006-12-05 16:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-05 16:47 Heng Yin [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-12-06 16:20 [Qemu-devel] a strange segmentation fault Heng Yin
2006-12-06 16:22 ` Paul Brook
2006-12-06 16:28 ` Heng Yin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4575A29E.3000604@ece.cmu.edu \
--to=hyin@ece.cmu.edu \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.