From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13887 invoked by alias); 24 Feb 2006 19:56:32 -0000 Received: (qmail 13813 invoked by uid 48); 24 Feb 2006 19:56:29 -0000 Date: Fri, 24 Feb 2006 19:56:00 -0000 Message-ID: <20060224195629.13812.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug other/26208] Serious problem with unwinding through signal frames In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jakub at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-02/txt/msg02863.txt.bz2 List-Id: ------- Comment #25 from jakub at gcc dot gnu dot org 2006-02-24 19:56 ------- Updated patches. Unfortunately, it seems even this is not enough as Java (and C++ as well, but there we aren't expecting to throw through signal frames), the personality routine does the same as uw_frame_state_for was doing, i.e. subtract one from ra. That's ok for most frames, unless they are immediately above a signal trampoline. In that case we shouldn't be subtracting one. But returning context->ra - fs->signal_frame in _Unwind_GetIP is a bad idea IMHO, _Unwind_GetIP should show some instruction pointer, context->ra - 1 may very well not be start of any instruction. For e.g. _Unwind_Backtrace we want context->ra as is, not adjusted. So, I'd say we should export a new function from libgcc_s, either something like _Unwind_SignalFrameContext (context) which will return context->signal_frame != 0, or _Unwind_GetIP alternative, _Unwind_GetAdjustedIP (context). In the first case, C++/Java personality routine would use _Unwind_GetIP (context) + (_Unwind_SignalFrameContext (context) ? 0 : -1) instead of the current _Unwind_GetIP (context) - 1, in the latter case it would use _Unwind_GetAdjustedIP (context) instead of _Unwind_GetIP (context) - 1. _Unwind_SignalFrameContext sounds more flexible to me. Richard, what do you think? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26208