From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53516) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGsJ8-00044R-EI for qemu-devel@nongnu.org; Thu, 20 Oct 2011 09:05:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RGsJ3-0006HJ-8l for qemu-devel@nongnu.org; Thu, 20 Oct 2011 09:05:14 -0400 Received: from lo.gmane.org ([80.91.229.12]:34971) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGsJ2-0006Gl-Lt for qemu-devel@nongnu.org; Thu, 20 Oct 2011 09:05:09 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RGsJ1-00076O-6S for qemu-devel@nongnu.org; Thu, 20 Oct 2011 15:05:07 +0200 Received: from 118.45.149.199 ([118.45.149.199]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 20 Oct 2011 15:05:07 +0200 Received: from jojelino by 118.45.149.199 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 20 Oct 2011 15:05:07 +0200 From: jojelino Date: Thu, 20 Oct 2011 22:04:00 +0900 Message-ID: References: <4E9BB180.6080506@mc.net> <4E9C0497.2000605@siriusit.co.uk> <4E9C3703.3040109@mc.net> <4E9C645A.5060200@twiddle.net> <4E9C9C08.20001@mc.net> <4E9CAACE.4070804@mc.net> <4E9F3BB4.3050604@mc.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit In-Reply-To: <4E9F3BB4.3050604@mc.net> Subject: Re: [Qemu-devel] gcc auto-omit-frame-pointer vs msvc longjmp List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: gcc@gcc.gnu.org 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 > ... > 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.