qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Heng Yin <hyin@ece.cmu.edu>
To: Qemu-devel@nongnu.org
Subject: [Qemu-devel] a strange segmentation fault
Date: Wed, 06 Dec 2006 11:20:16 -0500	[thread overview]
Message-ID: <4576EDC0.8030300@ece.cmu.edu> (raw)

Hi QEMU developers,

I'm running into a strange problem when I add some my own stuff in QEMU.
If I add a function call in the following position, QEMU will crash 
immediately after execution.

In target-i386/op.c:
void OPPROTO op_jnz_T0_label(void)
{
     helper_test(T0); //my own function
     if (T0)
         GOTO_LABEL_PARAM(1);
     FORCE_RET();
}

I define this function in target-i386/helper.c:

int helper_test(int t0)
{
     return 100+t0;
}

I try it on the two versions: 0.8.2 and 0.8.0. The problem appears no 
matter what kqemu option (-kernel-kqemu -no-kqmeu, or none) is used and 
what guest os (linux or winxp) is to launch.

I got the following message from gdb:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1212991808 (LWP 28612)]
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
(gdb)

Interestingly, if I change the function helper_test to take no 
arguments, the fault will be gone.

Can anybody give any hints of what may cause this fault and how to solve it?

Thanks,
Heng

             reply	other threads:[~2006-12-06 16:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-06 16:20 Heng Yin [this message]
2006-12-06 16:22 ` [Qemu-devel] a strange segmentation fault Paul Brook
2006-12-06 16:28   ` Heng Yin
  -- strict thread matches above, loose matches on Subject: below --
2006-12-05 16:47 [Qemu-devel] A " 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=4576EDC0.8030300@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).