From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2566 invoked by alias); 20 Oct 2011 13:10:27 -0000 Received: (qmail 2435 invoked by uid 22791); 20 Oct 2011 13:10:26 -0000 X-SWARE-Spam-Status: No, hits=-0.0 required=5.0 tests=AWL,BAYES_00,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_NUMERIC_HELO,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_GJ,TW_TJ,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from lo.gmane.org (HELO lo.gmane.org) (80.91.229.12) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 20 Oct 2011 13:10:11 +0000 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RGsNt-00018N-B6 for gcc@gcc.gnu.org; Thu, 20 Oct 2011 15:10:09 +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:10:09 +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:10:09 +0200 To: gcc@gcc.gnu.org From: jojelino Subject: Re: gcc auto-omit-frame-pointer vs msvc longjmp Date: Thu, 20 Oct 2011 14:16:00 -0000 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 User-Agent: Mozilla/5.0 (Windows NT 5.2; rv:9.0a2) Gecko/20111018 Thunderbird/9.0a2 In-Reply-To: <4E9F3BB4.3050604@mc.net> Cc: qemu-devel@nongnu.org X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2011-10/txt/msg00349.txt.bz2 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.