From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751610AbcLEKrR (ORCPT ); Mon, 5 Dec 2016 05:47:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41944 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751510AbcLEKrP (ORCPT ); Mon, 5 Dec 2016 05:47:15 -0500 Date: Mon, 5 Dec 2016 11:46:52 +0100 From: Oleg Nesterov To: Dmitry Vyukov Cc: Pavel Machek , Denys Vlasenko , jan.kratochvil@redhat.com, palves@redhat.com, Roland McGrath , syzkaller , LKML Subject: Re: Unkillable processes due to PTRACE_TRACEME again Message-ID: <20161205104652.GA29197@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 05 Dec 2016 10:47:15 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/02, Dmitry Vyukov wrote: > > I am not on 2caceb3294a78c389b462e7e236a4e744a53a474 (Dec 1). And see > the same unwaitable zombie processes. This is another thing, and notabug. This is how ptrace works, > void *thr(void *arg) > { > ptrace(PTRACE_TRACEME, 0, 0, 0); > } > > int main() > { > int pid = fork(); > if (pid == 0) { > pthread_t th; > pthread_create(&th, 0, thr, 0); > usleep(100000); > exit(0); > } > usleep(200000); > kill(pid, SIGKILL); > int status = 0; > waitpid(pid, &status, __WALL); waitpid(pid) hangs because you need to reap the sub-thread first. Oleg.