From owner-freebsd-current@freebsd.org Thu Jul 7 04:44:04 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 2605DB7502B; Thu, 7 Jul 2016 04:44:04 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0727D1360; Thu, 7 Jul 2016 04:44:04 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id u674hsgK007808; Wed, 6 Jul 2016 21:43:58 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201607070443.u674hsgK007808@gw.catspoiler.org> Date: Wed, 6 Jul 2016 21:43:54 -0700 (PDT) From: Don Lewis Subject: Re: difference in SIGCHLD behavior between Linux and FreeBSD breaks apt To: mmacy@nextbsd.org cc: freebsd-current@freebsd.org, freebsd-hackers@freebsd.org In-Reply-To: <155c3a25e3f.11fb4143170445.2284890475527649192@nextbsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii 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: Thu, 07 Jul 2016 04:44:04 -0000 On 6 Jul, 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. It shoulds like SA_RESTART is set in sa_flags for SIGCHLD but shouldn't be in this case.