From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934057AbcA0QFH (ORCPT ); Wed, 27 Jan 2016 11:05:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36673 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933377AbcA0QFC (ORCPT ); Wed, 27 Jan 2016 11:05:02 -0500 Date: Wed, 27 Jan 2016 17:04:57 +0100 From: Oleg Nesterov To: Dmitry Vyukov Cc: Andrew Morton , "Amanieu d'Antras" , Richard Weinberger , Davidlohr Bueso , Vladimir Davydov , Palmer Dabbelt , Andy Lutomirski , LKML , syzkaller , Kostya Serebryany , Alexander Potapenko , Sasha Levin , Eric Dumazet Subject: Re: WARNING in do_jobctl_trap Message-ID: <20160127160457.GA14320@redhat.com> References: <20160126205244.GA4649@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160126205244.GA4649@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/26, Oleg Nesterov wrote: > > On 01/26, Dmitry Vyukov wrote: > > > > Hello, > > > > The following program triggers WARN_ON_ONCE(!signr) in do_jobctl_trap: > > Can't reproduce, but most probably I understand the problem... I'll try to > make the simplified test-case tomorrow, it should work if I am right. This triggers the same problem immediately: #include #include #include void test(void) { for (;;) { if (fork()) { wait(NULL); continue; } ptrace(PTRACE_SEIZE, getppid(), 0, 0); ptrace(PTRACE_INTERRUPT, getppid(), 0, 0); _exit(0); } } int main(void) { int np; for (np = 0; np < 8; ++np) if (!fork()) test(); while (wait(NULL) > 0) ; return 0; } and just in case, your test-case works too if I run perl -e 'fork; fork; fork; 1 while 1' & in the background, it has too many delays to work on the idle system. > Does it work for you reliably? If yes, any chance you can try the patch > below? > > Oleg. > > --- x/kernel/ptrace.c > +++ x/kernel/ptrace.c > @@ -73,11 +73,11 @@ void __ptrace_unlink(struct task_struct *child) > { > BUG_ON(!child->ptrace); > > - child->ptrace = 0; > child->parent = child->real_parent; > list_del_init(&child->ptrace_entry); > > spin_lock(&child->sighand->siglock); > + child->ptrace = 0; > > /* > * Clear all pending traps and TRAPPING. TRAPPING should be The change above helps, but I need to think more... Oleg.