delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/05/17/09:32:48

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Date: 17 May 2004 16:23:46 +0200
Message-Id: <uk6zbgmj1.fsf@gnu.org>
From: Eli Zaretskii <eliz AT gnu DOT org>
To: djgpp AT delorie DOT com
In-reply-to: <Pine.GSO.4.58.0405171202480.16403@ural2> (message from Gabriel
Zoltan on Mon, 17 May 2004 12:07:42 +0200 (MEST))
Subject: Re: Task switch with SIGALRM
References: <Pine DOT GSO DOT 4 DOT 58 DOT 0405170936310 DOT 4679 AT ural2> <u1xljz7ph DOT fsf AT gnu DOT org> <Pine DOT GSO DOT 4 DOT 58 DOT 0405171202480 DOT 16403 AT ural2>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> Date: Mon, 17 May 2004 12:07:42 +0200 (MEST)
> From: Gabriel Zoltan <gz331 AT hszk DOT bme DOT hu>
> 
> I included the crash dumps in my letter.

Thanks.

All examples show bad EBP values.  See below.

> I use WinXP and somehow symify doesn't seem to work.

Try `bfdsymify' instead.  Recent versions of GCC use DWARF-2 debug
info format, which symify doesn't support.

> Exiting due to signal SIGSEGV
> Stack Fault at eip=0000b2d5
> eax=00000000 ebx=000e05d4 ecx=00000000 edx=00000125 esi=00000000 edi=000026e6
> ebp=00000000 esp=000e05d8 program=d:\diploma\progi\dynamos.exe

Here EBP is zero, which is clearly invalid.

> Exiting due to signal SIGSEGV
> General Protection Fault at eip=000011f1, error=012c
> eax=00010cb3 ebx=00000125 ecx=000e0604 edx=00000000 esi=00000000 edi=00000000
> ebp=000026d9 esp=000e05ec program=d:\diploma\progi\dynamos.exe

Here EBP is way far from ESP.

> Exiting due to signal SIGSEGV
> General Protection Fault at eip=00000007
> eax=0d9f9e25 ebx=00000000 ecx=000e05e8 edx=000e05f4 esi=000e05f4 edi=0005274c
> ebp=000026e6 esp=000e05dc program=d:\diploma\progi\dynamos.exe

Same here.

In sum, it sounds like your stack-changing code doesn't set up EBP.

I agree with the advice elsewhere in this thread to use setjmp/longjmp
for switching stacks, since they preserve and restore the entire
context of the thread (with the exception of the numerical coprocessor
registers).

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019