[parisc-linux] glibc 2.2.3: setjmp/longjmp

Matthew Wilcox matthew@wil.cx
Sat, 5 May 2001 01:00:32 +0100


On Fri, May 04, 2001 at 11:57:11PM +0100, Matthew Wilcox wrote:
> 
> taking a somewhat different approach:
> 
>     ea44:       e8 42 11 d4     b,l 14334 <_setjmp>,rp
> 
> 00014334 <_setjmp>:
>    14334:       6b c2 3f d9     stw rp,-14(sr0,sp)
>    14338:       34 19 00 00     ldi 0,r25
>    1433c:       37 de 00 80     ldo 40(sp),sp
>    14340:       6b d3 3f c1     stw r19,-20(sr0,sp)
>    14344:       e8 41 00 d8     b,l 163b8 <__sigsetjmp>,rp
>    14348:       6b d3 3f 91     stw r19,-38(sr0,sp)
>    1434c:       4b d3 3f 91     ldw -38(sr0,sp),r19
>    14350:       4b c2 3f 59     ldw -54(sr0,sp),rp
>    14354:       e8 40 c0 00     bv r0(rp)
>    14358:       37 de 3f 81     ldo -40(sp),sp

> oh.  wait.  1434F is exactly where it should be.  *sigh*.  So why the hell
> is it returning to the wrong place?

OK, got it.  the first time we call _setjmp, everything is fine.
But when we return to it through longjmp, the `rp' which got stored has
changed, and now its the rp for the last function we called.  Which is
what happens using `step' through gdb (now that i have a working gdb,
thanks for the deb, matt).

Ugh.  I guess we can't use _setjmp then, at least in its current form.
Oh well, at least the problem's found.

-- 
Revolutions do not require corporate support.