Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751658AbZKZSWt (ORCPT ); Thu, 26 Nov 2009 13:22:49 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751170AbZKZSWt (ORCPT ); Thu, 26 Nov 2009 13:22:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:1659 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750930AbZKZSWs (ORCPT ); Thu, 26 Nov 2009 13:22:48 -0500 Date: Thu, 26 Nov 2009 19:22:26 +0100 From: Veaceslav Falico To: Oleg Nesterov Cc: Ananth N Mavinakayanahalli , Alexey Dobriyan , Christoph Hellwig , "Frank Ch. Eigler" , Ingo Molnar , Peter Zijlstra , Roland McGrath , linux-kernel@vger.kernel.org, utrace-devel@redhat.com, Benjamin Herrenschmidt Subject: Re: powerpc: fork && stepping (Was: [RFC,PATCH 0/14] utrace/ptrace) Message-ID: <20091126182226.GF12355@darkmag.usersys.redhat.com> References: <20091124200127.GA5751@redhat.com> <20091125080342.GD2660@in.ibm.com> <20091125154052.GA6734@redhat.com> <20091126075335.GA18508@in.ibm.com> <20091126145051.GB4382@redhat.com> <20091126172524.GA14768@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091126172524.GA14768@redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2257 Lines: 78 On Thu, Nov 26, 2009 at 06:25:24PM +0100, Oleg Nesterov wrote: > On 11/26, Oleg Nesterov wrote: > > > > On 11/26, Ananth N Mavinakayanahalli wrote: > > > > > > step-fork: step-fork.c:56: handler_fail: Assertion `0' failed. > > > /bin/sh: line 5: 17325 Aborted ${dir}$tst > > > FAIL: step-fork > > > > Good to know, thanks again Ananth. > > > > I'll take a look. Since I know nothing about powerpc, I can't > > promise the quick fix ;) > > > > The bug was found by code inspection, but the fix is not trivial > > because it depends on arch/, and it turns out the arch-independent > > fix in > > > > ptrace-copy_process-should-disable-stepping.patch > > http://marc.info/?l=linux-mm-commits&m=125789789322573 > > > > doesn't work. > > Just noticed the test-case fails in handler_fail(). Most probably > this means it is killed by SIGALRM because either parent or child > hang in wait(). Perhaps we have another (ppc specific?) bug, but > currently I do not understand how this is possible, this should > not be arch-dependent. I can confirm that we have another bug on ppc arch. The test case below is spinning forever, #include #include #include #include #include #include int main(void) { int pid, status; if (!(pid = fork())) { assert(ptrace(PTRACE_TRACEME) == 0); kill(getpid(), SIGSTOP); if (!fork()) return 0; printf("fork passed..\n"); return 0; } for (;;) { assert(pid == wait(&status)); if (WIFEXITED(status)) break; assert(ptrace(PTRACE_SINGLESTEP, pid, 0,0) == 0); } printf("Parent exit.\n"); return 0; } it doesn't hang, the parent is spinning around for, the test case isn't printing anything. Seems like fork() can't complete under PTRACE_SINGLESTEP. -- Veaceslav -- 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/