qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: jojelino <jojelino@gmail.com>
To: qemu-devel@nongnu.org
Cc: gcc@gcc.gnu.org
Subject: Re: [Qemu-devel] gcc auto-omit-frame-pointer vs msvc longjmp
Date: Thu, 20 Oct 2011 22:04:00 +0900	[thread overview]
Message-ID: <j7p65g$37r$1@dough.gmane.org> (raw)
In-Reply-To: <4E9F3BB4.3050604@mc.net>

On 2011-10-20 AM 6:05, Bob Breuer wrote:
>
> We probably have a difference in build or run environment.  I've
> double-checked with another machine and can get the same crash in
> longjmp when running the test executable on both WinXP and Win2k, but
> not on Win7.  So it looks like Microsoft may have changed this "feature"
> somewhere between WinXP and Win7.
YEES! It does crash in winxp.
>
> The msvcrt implementation of longjmp (or at least the one I'm looking
> at) does a ebp based access using the saved value of ebp.  Here's the
> relevant disassembly of longjmp:
>
> 0x7801e6f3 in longjmpex () from C:\WINNT\system32\msvcrt.dll
> (gdb) disas
> Dump of assembler code for function longjmpex:
>     0x7801e6ef<+0>:     mov    0x4(%esp),%ebx
> =>  0x7801e6f3<+4>:     mov    (%ebx),%ebp
> ...
>     0x7801e73d<+78>:    call   0x7800bd5e<abnormal_termination+56>
> ...
>     0x7800bd5e<+56>:    push   %ebx
>     0x7800bd5f<+57>:    push   %ecx
>     0x7800bd60<+58>:    mov    $0x7803dc64,%ebx
> =>  0x7800bd65<+63>:    mov    0x8(%ebp),%ecx
>
> It crashes on the access of 0x8(%ebp).  Those are the only 2 places
> where this version of longjmp touches ebp.  Is it possible to force a
> stackframe by just adding a suitable attribute to either the setjmp
> function prototype, or the function which calls setjmp?
and we had relevant report in ruby.
http://redmine.ruby-lang.org/issues/5375

Kai, would you mind if i reopen this bug you rejected?
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49230

>
> Bob
>
>


-- 
Regards.

      parent reply	other threads:[~2011-10-20 13:05 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-17  4:39 [Qemu-devel] qemu-system-sparc io-thread segfault on win32 Bob Breuer
     [not found] ` <4E9C0497.2000605@siriusit.co.uk>
2011-10-17 14:09   ` Bob Breuer
2011-10-17 17:22     ` [Qemu-devel] gcc auto-omit-frame-pointer vs msvc longjmp Richard Henderson
2011-10-17 19:14       ` Blue Swirl
2011-10-17 20:11         ` Richard Henderson
2011-10-17 21:20       ` Bob Breuer
2011-10-17 21:31         ` Kai Tietz
2011-10-17 22:23           ` Bob Breuer
2011-10-17 22:56             ` Kai Tietz
2011-10-19 21:05               ` Bob Breuer
2011-10-19 22:19                 ` Richard Henderson
2011-10-20  4:22                 ` xunxun
2011-10-20 14:48                   ` Kai Tietz
2011-10-20 15:34                     ` Kai Tietz
     [not found]                       ` <j7sgfi$i66$1@dough.gmane.org>
2011-10-22  5:13                         ` xunxun
2011-10-22  5:21                           ` xunxun
2011-10-22 11:19                             ` Kai Tietz
2011-10-22 14:23                       ` asmwarrior
2011-10-24 14:45                       ` Bob Breuer
2011-10-24 16:18                         ` Kai Tietz
2011-10-25 15:14                           ` Bob Breuer
2011-10-20 13:04                 ` jojelino [this message]

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='j7p65g$37r$1@dough.gmane.org' \
    --to=jojelino@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --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).