qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Blue Swirl" <blauwirbel@gmail.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Crash due to invalid env->current_tb
Date: Tue, 29 Apr 2008 20:09:00 +0300	[thread overview]
Message-ID: <f43fc5580804291009s4dea4233y472c9823f42d021c@mail.gmail.com> (raw)
In-Reply-To: <20080429115614.GA15524@os.inf.tu-dresden.de>

[-- Attachment #1: Type: text/plain, Size: 1126 bytes --]

On 4/29/08, Adam Lackorzynski <adam@os.inf.tu-dresden.de> wrote:
> Hi,
>
>  I've been experiencing crashes of latest svn Qemu, host ia32 and target
>  arm, host gcc is 'gcc version 3.4.6 (Debian 3.4.6-7)'.
>  The segfault happens because of an invalid env->current_tb which seems
>  to be caused by generated code. The following code in cpu_exec
>
>    tc_ptr = tb->tc_ptr;
>    env->current_tb = tb;
>    gen_func = (void *)tc_ptr;
>    T0 = gen_func();
>    env->current_tb = NULL;
>
>  is being compiled to the following
>
>    mov    0x14(%ecx),%eax
>    mov    %ecx,0x56c(%ebp)
>    xor    %edi,%edi
>    call   *%eax
>    mov    %edi,0x56c(%ebp)
>
>  After the call edi isn't 0 anymore and gets the bogus value. As edi is
>  callee saved the code itself seems ok.
>  When I add a barrier before "env->current_tb = NULL" the xor is placed
>  after the call and everything works fine. So might the problem be that
>  generated code isn't preserving edi/registers?

Right. How did you make the barrier? My version (attached) just
crashes, I'm not fluent on i386 assembly. Maybe your version could
serve as a temporary fix.

[-- Attachment #2: fix_i386.diff --]
[-- Type: plain/text, Size: 586 bytes --]

  reply	other threads:[~2008-04-29 17:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-29 11:56 [Qemu-devel] Crash due to invalid env->current_tb Adam Lackorzynski
2008-04-29 17:09 ` Blue Swirl [this message]
2008-04-29 18:40   ` Adam Lackorzynski
2008-04-30  9:08     ` Alexander Graf
2008-04-30 15:11       ` Adam Lackorzynski
2008-04-30 15:21         ` Adam Lackorzynski
2008-04-30 17:09           ` Blue Swirl
2008-04-30 17:30           ` Alexander Graf
2008-04-30 18:21             ` Blue Swirl
2008-05-01 12:02               ` Adam Lackorzynski
2008-05-01 15:02                 ` Blue Swirl
2008-05-01 16:04                   ` Paul Brook
2008-05-01 16:15                     ` Blue Swirl
2008-05-01 16:31                       ` Paul Brook
2008-05-02 15:41                   ` Adam Lackorzynski
2008-05-03 18:00                     ` Blue Swirl
2008-05-03 22:02                       ` Paul Brook
2008-04-30 15:28         ` Laurent Vivier
2008-04-30 20:36           ` Adam Lackorzynski
2008-05-02  1:39             ` Bernhard Kauer

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=f43fc5580804291009s4dea4233y472c9823f42d021c@mail.gmail.com \
    --to=blauwirbel@gmail.com \
    --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).