From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13050 invoked by alias); 15 Dec 2005 07:47:24 -0000 Received: (qmail 13038 invoked by uid 22791); 15 Dec 2005 07:47:22 -0000 X-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_FAIL X-Spam-Check-By: sourceware.org Received: from gateway.sf.frob.com (HELO gateway.sf.frob.com) (64.81.54.130) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 15 Dec 2005 07:47:19 +0000 Received: from magilla.sf.frob.com (magilla.sf.frob.com [198.49.250.228]) by gateway.sf.frob.com (Postfix) with ESMTP id EA488357B; Wed, 14 Dec 2005 18:58:54 -0800 (PST) Received: by magilla.sf.frob.com (Postfix, from userid 5281) id 9D387180987; Wed, 14 Dec 2005 18:58:54 -0800 (PST) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Roland McGrath To: "Stone, Joshua I" Cc: Subject: kretprobes vs __switch_to In-Reply-To: Stone, Joshua I's message of Wednesday, 7 December 2005 18:40:09 -0800 X-Zippy-Says: I LIKE Aisle 7a. Message-Id: <20051215025854.9D387180987@magilla.sf.frob.com> Date: Thu, 15 Dec 2005 08:21:00 -0000 X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2005-q4/txt/msg00443.txt.bz2 > The second one that failed was 'kernel.function("__switch_to").return'. > This one is a problem with kretprobes only, as all of my other probes in > __switch_to behaved just fine, even in the middle of the function. > Running this gave "Kernel BUG at kprobes:449" (the full dump is included > below). The line mentioned is in trampoline_probe_handler: > > BUG_ON(!orig_ret_address || (orig_ret_address == > trampoline_address)); > > It seems pretty obvious that the actions taken in __switch_to would > conflict with the way the trampoline works. I don't know if it's > possible to make kretprobes work on this function - if not, it should be > blacklisted. It's not clear to me why this fails. It's actually some assembly code in the switch_to macro (used in context_switch) that changes stacks, before it calls __switch_to. __switch_to is entered on the new stack and it seems to me that kretprobes ought to be able to handle it normally. Clearly I'm missing something.