From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29559 invoked by alias); 11 Jun 2007 19:57:17 -0000 Received: (qmail 29550 invoked by uid 22791); 11 Jun 2007 19:57:16 -0000 X-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,DK_POLICY_SIGNSOME,DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: sourceware.org Received: from e6.ny.us.ibm.com (HELO e6.ny.us.ibm.com) (32.97.182.146) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 11 Jun 2007 19:57:11 +0000 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e6.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id l5BJwDp2009684 for ; Mon, 11 Jun 2007 15:58:13 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l5BJv6h5545738 for ; Mon, 11 Jun 2007 15:57:08 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l5BJv5HZ026114 for ; Mon, 11 Jun 2007 15:57:05 -0400 Received: from [9.47.18.79] (dyn9047018079.beaverton.ibm.com [9.47.18.79]) by d01av02.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l5BJv4mt026065; Mon, 11 Jun 2007 15:57:05 -0400 Subject: Re: [WIP] uprobe tests From: Jim Keniston To: "Frank Ch. Eigler" Cc: Srikar Dronamraju , systemtap@sources.redhat.com In-Reply-To: <1181429722.3661.33.camel@ibm-ni9dztukfq8.beaverton.ibm.com> References: <20070605130636.GC29581@linux.vnet.ibm.com> <1181429722.3661.33.camel@ibm-ni9dztukfq8.beaverton.ibm.com> Content-Type: text/plain Date: Mon, 11 Jun 2007 19:57:00 -0000 Message-Id: <1181588232.3739.28.camel@ibm-ni9dztukfq8.beaverton.ibm.com> Mime-Version: 1.0 X-Mailer: Evolution 2.8.3 (2.8.3-2.fc6) Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2007-q2/txt/msg00563.txt.bz2 On Sat, 2007-06-09 at 15:55 -0700, Jim Keniston wrote: > On Sat, 2007-06-09 at 17:01 -0400, Frank Ch. Eigler wrote: > > Srikar Dronamraju writes: > > ... > > > > When I run this test suite on i686 2.6.21-rc6-mm1 + may25-uprobes > > kernel configured with a bunch of debugging options, we get a bunch of > > kernel errors. A sampling: > ... > > Most of these problems appear to be associated with the test harness > (which includes u_dbfs_cleanup), but there's one associated with > register_uprobe(). ... > > > > slab error in verify_redzone_free(): cache `size-32': memory outside object was > > overwritten > > [] cache_free_debugcheck+0xb2/0x1a6 > > [] kfree+0x90/0xe0 > > [] u_dbfs_cleanup+0x4b/0x4d [blink2] > > [] cleanup_module+0x49/0x4b [blink2] ... I rebuilt kernels with Frank's debugging options enabled. Here's a simple fix that yields clean test runs for me. In the test suite, in include/udbgfs.c, in the line print_buf = kmalloc(sizeof(print_buf),GFP_KERNEL); change sizeof(print_buf) to sizeof(*print_buf) BTW, I don't think test_printk() handles buffer overflows correctly. When we reach the end of the buffer, it's possible for vsnprintf() to return a number greater than print_buf->bytes_left (see "Return value" in the man page), which means print_buf->bytes_left can underflow to a very big number, telling the next call to vsnprintf() that we have a very big buffer. I don't see any overflows in the test suite that would test my hypothesis, though, so I'll leave that investigation and fix to Srikar. > > > > > > - FChE Jim