c/1624: incorrect stack adjustment with -fomit-frame-pointer on x86

Richard Henderson rth@redhat.com
Tue Jan 16 00:42:00 GMT 2001


On Fri, Jan 12, 2001 at 01:24:08AM -0000, drepper@redhat.com wrote:
> The problem is that the return address is taken from the wrong stack slot.
> There is one more value left on the stack (the content of %ebx) which means
> the main() returns to somewhere in the data area (where %ebx points to).

This appears to be a bug in setjmp.

1: /a $esp = 0xbffff860
0x8048684 <main+196>:   call   0x804840c <setjmp>
(gdb) ni
0x08048689      56            value = setjmp (env);
1: /a $esp = 0xbffff85c
0x8048689 <main+201>:   mov    %eax,%ebx

Note that the value of esp is off by 4 on return from that function.
Interestingly, __sigsetjmp does not display this problem.

This is with glibc-2.2-9 from the rh7 errata installed.


r~


More information about the Gcc-bugs mailing list