From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28601 invoked by alias); 1 Jan 2007 19:54:27 -0000 Received: (qmail 28592 invoked by uid 22791); 1 Jan 2007 19:54:26 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO brahms.sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 01 Jan 2007 19:54:18 +0000 Received: from brahms.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by brahms.sibelius.xs4all.nl (8.13.8/8.13.8) with ESMTP id l01Js8Hh009014; Mon, 1 Jan 2007 20:54:08 +0100 (CET) Received: (from kettenis@localhost) by brahms.sibelius.xs4all.nl (8.13.8/8.13.8/Submit) id l01Js85r031019; Mon, 1 Jan 2007 20:54:08 +0100 (CET) Date: Mon, 01 Jan 2007 19:54:00 -0000 Message-Id: <200701011954.l01Js85r031019@brahms.sibelius.xs4all.nl> From: Mark Kettenis To: drow@false.org CC: gdb-patches@sourceware.org In-reply-to: <20070101191927.GA14930@nevyn.them.org> (message from Daniel Jacobowitz on Mon, 1 Jan 2007 14:19:27 -0500) Subject: Re: [patch RFC] Re: Notes on a frame_unwind_address_in_block problem References: <20060706222157.GA1377@nevyn.them.org> <200607132020.k6DKKCSB023812@elgar.sibelius.xs4all.nl> <20060718183910.GB17864@nevyn.them.org> <20070101191927.GA14930@nevyn.them.org> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-01/txt/msg00029.txt.bz2 > Date: Mon, 1 Jan 2007 14:19:27 -0500 > From: Daniel Jacobowitz > > Now that the CFI issue in glibc is fixed, I'm back to this discussion > from July. Quoted below for reference, since it's been a while. > > Here's a patch, that I'm looking for comments on. It's not the most > gorgeous code I've ever written, but it's the simplest solution I could > come up with for a complicated problem. Well, I really can't say I like it. The problem is that it's been several months since we last discussed this problem, so I'll have to start to think again from scratch :(. Isn't it just a matter of making sure we set the right function address for signal trampolines? That is, shouldn't we have a dwarf2_signal_frame_this_id() that chooses a more sensible code address than frame_func_unwind()? > It fixes eight failures in the x86-64 GNU/Linux testsuite and I > believe it will fix those same failures for i386 also. Test results > for this platform are starting to look really good. I hope I can > get it to no failures during the next two weeks, and then move on to > do the same for another platform. Optimist! We'll only have to wait for the GCC/glibc/kernel people to come up with the next smart hack that they don't bother to test GDB with and you'll have lots of failures to fix again ;-) > Problem > ======= > > The problem is a function which looks like this: > > nop > function_label: code > > > Such functions are interesting to me because glibc and the Linux kernel > both use them to provide unwind information for signal handlers. The > nop allows pc-1 to work, at least for libgcc's unwinder, even though > function_label is pushed directly onto the stack as if it were a return > address. > > But GDB ends up subtracting one from the PC in some places it would be > better not to. We decide that get_frame_func for that frame should > return the func associated with the fde start if the next frame is a > normal frame, but the func associated with the function_label if the > next frame is the sentinel frame. This inconsistency breaks "finish" > out of a signal handler, because the unwound frame ID when the command > is issued doesn't match the current frame ID when we hit the temporary > breakpoint. We have several tests for this case. But we have no stand-alone testcase. You really need the right version of glibc to be able to test this. Could you come up with a testcase that works everywhere, or at least on all targets?