From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30379 invoked by alias); 23 Jul 2007 16:15:21 -0000 Received: (qmail 30368 invoked by uid 22791); 23 Jul 2007 16:15:21 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 23 Jul 2007 16:15:16 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id D0C8E98301; Mon, 23 Jul 2007 16:15:15 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 6A1C598300; Mon, 23 Jul 2007 16:15:15 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.67) (envelope-from ) id 1ID0Yy-0000ta-Vz; Mon, 23 Jul 2007 12:15:13 -0400 Date: Mon, 23 Jul 2007 16:19:00 -0000 From: Daniel Jacobowitz To: Bill Gatliff Cc: gdb@sourceware.org, linuxppc-embedded@ozlabs.org Subject: Re: Gdbserver syscall clobber Message-ID: <20070723161512.GA3235@caradoc.them.org> Mail-Followup-To: Bill Gatliff , gdb@sourceware.org, linuxppc-embedded@ozlabs.org References: <469B922D.3050701@billgatliff.com> <20070716155348.GA5281@caradoc.them.org> <469E550E.5080905@billgatliff.com> <20070718183143.GA25324@caradoc.them.org> <46A4D1F5.1060005@billgatliff.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46A4D1F5.1060005@billgatliff.com> User-Agent: Mutt/1.5.15 (2007-04-09) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-07/txt/msg00161.txt.bz2 On Mon, Jul 23, 2007 at 11:06:13AM -0500, Bill Gatliff wrote: > Daniel Jacobowitz wrote: > > On Wed, Jul 18, 2007 at 12:59:42PM -0500, Bill Gatliff wrote: > > > >> Now, I'm a little rusty on PPC asm (I've been doing a lot of ARM > >> lately), but it looks to me like the kernel is setting bit 0 in CR0 > >> (oris r10, r10, 0x1000) a.k.a LT, but the user side is looking at CR0 > >> (bnslr+) bit 3 a.k.a. SO. Or maybe the other way around, I'm not sure > >> after reading Sections 1.2 and 2.1 of the Programming Environments manual. > >> > > > > It's not checking for restart here - userspace isn't supposed to have to. > > It's probably checking for error. Check for the bit of kernel code > > that's supposed to back you up two instructions. > > > > > > I don't see it in this kernel. What I see is this after the call to the > syscall handler: Look around do_signal: regs->nip -= 4; /* Back up & retry system call */ If your kernel has corrupted the register containing the syscall number at this point, that would explain your problem. It will then do the wrong syscall. I guess PPC only backs up one instruction. -- Daniel Jacobowitz CodeSourcery