From owner-freebsd-current@freebsd.org Mon Jul 18 23:15:09 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 80E57B9D9CF for ; Mon, 18 Jul 2016 23:15:09 +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 596AD1B4E; Mon, 18 Jul 2016 23:15:09 +0000 (UTC) (envelope-from mmacy@nextbsd.org) Received: from mail.zoho.com by mx.zohomail.com with SMTP id 1468883708471685.750836884111; Mon, 18 Jul 2016 16:15:08 -0700 (PDT) Date: Mon, 18 Jul 2016 16:15:08 -0700 From: Matthew Macy To: "Alfred Perlstein" Cc: "freebsd-current@freebsd.org" Message-ID: <156004aaa06.11295bd6563219.9185936432327003324@nextbsd.org> In-Reply-To: <884f17bd-7742-cc6f-0974-81c7bc833175@freebsd.org> References: <155c3a25e3f.11fb4143170445.2284890475527649192@nextbsd.org> <884f17bd-7742-cc6f-0974-81c7bc833175@freebsd.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-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: Mon, 18 Jul 2016 23:15:09 -0000 ---- On Mon, 18 Jul 2016 16:11:53 -0700 Alfred Perlstein wrote ---- > I believe the > > > On 7/6/16 9:34 PM, Matthew Macy wrote: > > As a first step towards managing linux user space in a chrooted /compat/linux, initially for i915 testing with intel gpu tools, later on to get widevine and steam to work I'm trying to get apt to work. I've fixed a number of issues to date in pseudofs/linprocfs but now I'm running in to a bug caused by differences in SIGCHLD handling between Linux and FreeBSD. The situation is that apt will spawn dpkg and wait on a pipe read. On Linux when dpkg exits the SIGCHLD to apt causes a short read on the pipe which lets apt then continue. On FreeBSD a SIGCHLD is silently ignored. I've even experimented with doing a kill -20 to no effect. > > > > It would be easy enough to check sysvec against linux in pipe_read and break out of the loop when it's awakened from msleep (assuming there aren't deeper issues with signal propagation for anything other than SIGINT/SIGKILL) and then do a short read. However, I'm assuming that anyone who has worked in this area probably has a cleaner solution. > > > > Thanks in advance. > > Are you sure you need a hack in pipe_read and not one of the following > possibilities: > 1) a setting for the default signal disposition for linux processes > needs to be fixed. > 2) a flag set in p_flag2 that says set this behavior properly in a > generic manner. > > Again not sure why you need to hack pipe_read and not just make sure > that SIGCHLD is generated... > > Finally that sure is oddball behavior, dpkg probably has a bug where the > parent is keeping the write side of the pipe open, you might be able to > get them to take a patch upstream to fix that. > If you read my final mail it turns out I was holding a reference to the pipe in question in linprocfs. Maintaining the reference kept apt from getting the EOF on the pipe. I've since fixed this. -M