From patchwork Thu Mar 7 23:03:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Neuling X-Patchwork-Id: 225995 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 7E3A02C042E for ; Fri, 8 Mar 2013 10:04:05 +1100 (EST) Received: from localhost.localdomain (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 86A5E2C0378; Fri, 8 Mar 2013 10:03:36 +1100 (EST) Received: by localhost.localdomain (Postfix, from userid 1000) id AE4FFD48A42; Fri, 8 Mar 2013 10:03:34 +1100 (EST) Received: from ale.ozlabs.ibm.com (localhost [127.0.0.1]) by localhost.localdomain (Postfix) with ESMTP id AD2A7D43B06; Fri, 8 Mar 2013 10:03:34 +1100 (EST) From: Michael Neuling To: Philippe De Muyter Subject: Re: 3.9-rc1 powerpc ptrace.c: 'brk.len' is used uninitialized In-reply-to: <22285.1362695571@ale.ozlabs.ibm.com> References: <20130306060058.GA3106@frolo.macqel> <21084.1362607788@ale.ozlabs.ibm.com> <20130306223645.GA15484@frolo.macqel> <31862.1362611670@ale.ozlabs.ibm.com> <20130307095907.GA16489@frolo.macqel> <22285.1362695571@ale.ozlabs.ibm.com> Comments: In-reply-to Michael Neuling message dated "Fri, 08 Mar 2013 09:32:51 +1100." X-Mailer: MH-E 8.2; nmh 1.5; GNU Emacs 23.4.1 Date: Fri, 08 Mar 2013 10:03:34 +1100 Message-ID: <11606.1362697414@ale.ozlabs.ibm.com> Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Michael Neuling wrote: > Philippe De Muyter wrote: > > > Hello Mikey, > > > > On Thu, Mar 07, 2013 at 10:14:30AM +1100, Michael Neuling wrote: > > > Philippe De Muyter wrote: > > > > > > > On Thu, Mar 07, 2013 at 09:09:48AM +1100, Michael Neuling wrote: > > > > > > bisect tells me that since your commit 9422de3e953d0e60eb95f5430a9dd803eec1c6d7 > > > > > > "powerpc: Hardware breakpoints rewrite to handle non DABR breakpoint registers", > > > > > > compiling linux fails with : > > > > > > > > > > > > cc1: warnings being treated as errors > > > > > > arch/powerpc/kernel/ptrace.c: In function 'arch_ptrace': > > > > > > arch/powerpc/kernel/ptrace.c:1450: warning: 'brk.len' is used uninitialized in this function > > > > > > arch/powerpc/kernel/ptrace.c:1352: note: 'brk.len' was declared here > > > > > > > > > > > > could you look at that ? > > > > > > > > > > Sure. > > > > > > > > I use gcc-4.2.2, and my .config follows. > > > > > > I'm a bit lost. > > > > > > I don't have 4.2.2 (which is ancient BTW) and I can't hit this on > > > 4.3,4.5 or 4.6 with your config. It compiles fine. > > > > > > Also: > > > > > > > arch/powerpc/kernel/ptrace.c:1450: warning: 'brk.len' is used uninitialized in this function > > > > arch/powerpc/kernel/ptrace.c:1352: note: 'brk.len' was declared here > > > > > > These line numbers make no sense at all WRT v3.9-rc1. brk.len is neither > > > declared or used in those lines: > > > > those were the line numbers just after your commit > > > > In 3.9-rc1 they are : > > > > cc1: warnings being treated as errors > > arch/powerpc/kernel/ptrace.c: In function 'arch_ptrace': > > arch/powerpc/kernel/ptrace.c:1479: warning: 'brk.len' is used uninitialized in this function > > arch/powerpc/kernel/ptrace.c:1381: note: 'brk.len' was declared here > > > > if (child->thread.hw_brk.address) > > return -ENOSPC; > > > > 1479: child->thread.hw_brk = brk; > > > > return 1; > > #endif /* !CONFIG_PPC_ADV_DEBUG_DVCS */ > > Got it. I still can't replicate the issue here, so can you check if the > below works for you? Argh, scrap that..... try this. diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c index 245c1b6..8564515 100644 --- a/arch/powerpc/kernel/ptrace.c +++ b/arch/powerpc/kernel/ptrace.c @@ -1428,6 +1428,7 @@ static long ppc_set_hwdebug(struct task_struct *child, brk.address = bp_info->addr & ~7UL; brk.type = HW_BRK_TYPE_TRANSLATE; + brk.len = 0; if (bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_READ) brk.type |= HW_BRK_TYPE_READ; if (bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_WRITE)