Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753770AbZKSR7S (ORCPT ); Thu, 19 Nov 2009 12:59:18 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753269AbZKSR7R (ORCPT ); Thu, 19 Nov 2009 12:59:17 -0500 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.123]:51520 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752852AbZKSR7R (ORCPT ); Thu, 19 Nov 2009 12:59:17 -0500 Subject: Re: BUG: GCC-4.4.x changes the function frame on some functions From: Steven Rostedt Reply-To: rostedt@goodmis.org To: Linus Torvalds Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , LKML , Andrew Morton , Heiko Carstens , feng.tang@intel.com, Fr??d??ric Weisbecker , Peter Zijlstra , jakub@redhat.com, gcc@gcc.gnu.org In-Reply-To: References: <20091119072040.GA23579@elte.hu> Content-Type: text/plain Organization: Kihon Technologies Inc. Date: Thu, 19 Nov 2009 12:59:22 -0500 Message-Id: <1258653562.22249.682.camel@gandalf.stny.rr.com> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1405 Lines: 38 On Thu, 2009-11-19 at 09:39 -0800, Linus Torvalds wrote: > > This modification leads to a hard to solve problem in the kernel > > function graph tracer which assumes that the stack looks like: > > > > return address > > saved ebp > > Umm. But it still does, doesn't it? That > > pushl -0x4(%edi) > push %ebp > > should do it - the "-0x4(%edi)" thing seems to be trying to reload the > return address. No? Yes that is what it is doing. The problem we have is that it is putting into the frame pointer a "copy" of the return address, and not the actual pointer. Which is fine for the function tracer, but breaks the function graph tracer (which is a much more powerful tracer). Technically, this is all that mcount must have. And yes, we are making an assumption that the return address in the frame pointer is the one that will be used to leave the function. But the reason for making this copy just seems to be all messed up. I don't know if the ABI says anything about the return address in the frame pointer must be the actual return address. But it would be nice if the gcc folks would let us guarantee that it is. -- Steve -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/