From owner-freebsd-current@freebsd.org Fri Jul 8 07:52:41 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CCF9B7539B; Fri, 8 Jul 2016 07:52:41 +0000 (UTC) (envelope-from mmacy@nextbsd.org) Received: from sender163-mail.zoho.com (sender163-mail.zoho.com [74.201.84.163]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2FBC1C66; Fri, 8 Jul 2016 07:52:40 +0000 (UTC) (envelope-from mmacy@nextbsd.org) Received: from mail.zoho.com by mx.zohomail.com with SMTP id 1467964358050811.143266695883; Fri, 8 Jul 2016 00:52:38 -0700 (PDT) Date: Fri, 08 Jul 2016 00:52:38 -0700 From: Matthew Macy To: "Matthew Macy" Cc: "Konstantin Belousov" , "" , "Don Lewis" , "" , "" Message-ID: <155c97e7d70.126966a3c142756.8632532805949896728@nextbsd.org> In-Reply-To: <155c688eecf.fe750982120278.6541123167784850321@nextbsd.org> References: <155c427b1ea.e316552376378.990303254341485453@nextbsd.org> <201607070714.u677EqVx008159@gw.catspoiler.org> <20160707140424.GM38613@kib.kiev.ua> <155c688eecf.fe750982120278.6541123167784850321@nextbsd.org> Subject: Re: difference in SIGCHLD behavior between Linux and FreeBSD breaks apt MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Priority: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail X-ZohoMail: Z_57973067 SPT_1 Z_57973066 SPT_1 SLF_D X-Zoho-Virus-Status: 2 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2016 07:52:41 -0000 > Unsurprisingly I may have misinterpreted the trace. > > John observes: > Alternatively, if apt is creating a pipe() that it passes to dpkg() via fork() and apt > only creates the read end opened and dpkg only keeps the write end up opened, then when > dpkg exits, the pipe_read should return EOF when dpkg exits (that is normally the way pipes > are used to detect child exit rather than EINTR from SIGCLD). > > The SIGCHLD may be a red herring as strace will report it even if it is ignored. What John describes is borne out by the traces. > > FreeBSD from pipe creation to dpkg exit and apt hang > http://pastebin.com/TGRrMniD > > Linux from pipe creation to dpkg exit and apt continue > http://pastebin.com/wPfd31Pf It turns out that this was footshooting. In my changes to linprocfs the /fd directory was holding additional references to the struct file pointers which prevented apt from getting an EOF when dpkg exited. Thanks to all who commented. FWIW, after fixing the previous issue and then linux_mremap to be able to grow a mapping apt works now: root@planecrash:/home/mmacy # chroot /compat/linux/ apt-get update Hit:1 http://archive.ubuntu.com/ubuntu xenial InRelease Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [94.5 kB] Hit:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease Fetched 94.5 kB in 1s (56.3 kB/s) Reading package lists... Done I don't think this is all that useful until I update / implement any system calls to get steam / widevine whatever working, but in case anyone cares this is all going on in the drm-next-4.6 branch alongside the graphics work. -M