[committed] Fix unwind problem on PA linux

John David Anglin dave@hiauly1.hia.nrc.ca
Sat Aug 27 19:40:00 GMT 2005


This change fixes a problem exposed by the Java PR218 testcase.  This
testcase has a very simple function that generates a null pointer
exception.  This function doesn't save the return pointer on the stack.
The original implementation of pa32_fallback_frame_state used the
return pointer column in the frame state for return pointer column
from the signal frame, overwritting the previous setup for the saved
return pointer.  This caused the unwind machinary to think the
excepting routine called itself using the same frame.  As a result,
the unwind machinery looped indefinitely.

The fix is to use the r0 column in the frame state for the return
column of signal frames.  This column is always available and unused
since register r0 is a hardware zero.  The return column for the
excepting routine is then correct.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

2005-08-27  John David Anglin  <dave.anflin@nrc-cnrc.gc.ca>

	PR libgcj/23508
	* pa/linux-unwind.h (pa32_fallback_frame_state): Use r0 slot in frame
	state for return address column of signal frames.

Index: config/pa/linux-unwind.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/linux-unwind.h,v
retrieving revision 1.4
diff -u -3 -p -r1.4 linux-unwind.h
--- config/pa/linux-unwind.h	25 Jun 2005 01:21:51 -0000	1.4
+++ config/pa/linux-unwind.h	24 Aug 2005 16:54:14 -0000
@@ -131,8 +131,8 @@ pa32_fallback_frame_state (struct _Unwin
     }
   fs->regs.reg[88].how = REG_SAVED_OFFSET;
   fs->regs.reg[88].loc.offset = (long) &sc->sc_sar - new_cfa;
-  fs->regs.reg[2].how = REG_SAVED_OFFSET;
-  fs->regs.reg[2].loc.offset = (long) &sc->sc_iaoq[0] - new_cfa;
-  fs->retaddr_column = 2;
+  fs->regs.reg[0].how = REG_SAVED_OFFSET;
+  fs->regs.reg[0].loc.offset = (long) &sc->sc_iaoq[0] - new_cfa;
+  fs->retaddr_column = 0;
   return _URC_NO_REASON;
 }



More information about the Gcc-patches mailing list