From owner-freebsd-pkg@freebsd.org Wed Apr 8 22:02:40 2020 Return-Path: Delivered-To: freebsd-pkg@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF39327E627 for ; Wed, 8 Apr 2020 22:02:40 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 48yJDJ4HGKz3DjX for ; Wed, 8 Apr 2020 22:02:40 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 92F5C27E626; Wed, 8 Apr 2020 22:02:40 +0000 (UTC) Delivered-To: pkg@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 92BD327E625 for ; Wed, 8 Apr 2020 22:02:40 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48yJDJ3LzHz3DjW for ; Wed, 8 Apr 2020 22:02:40 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E81E22B7 for ; Wed, 8 Apr 2020 22:02:40 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 038M2eiS099585 for ; Wed, 8 Apr 2020 22:02:40 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 038M2e3X099584 for pkg@FreeBSD.org; Wed, 8 Apr 2020 22:02:40 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" From: bugzilla-noreply@freebsd.org To: pkg@FreeBSD.org Subject: maintainer-feedback requested: [Bug 245462] ports-mgmt/pkg: 1.14.2 pipe remains open while running scripts Date: Wed, 08 Apr 2020 22:02:40 +0000 X-Bugzilla-Type: request X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: pkg@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? Message-ID: In-Reply-To: References: X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-pkg@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binary package management and package tools discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2020 22:02:40 -0000 Bugzilla Automation has asked freebsd-pkg mailing li= st for maintainer-feedback: Bug 245462: ports-mgmt/pkg: 1.14.2 pipe remains open while running scripts https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D245462 --- Description --- We are observing latest version of pkg hanging if some process spawn by the script remains running after script itself exits. Inspecting the process with GDB the pkg-static process stucks doing poll() = on FD#7: (gdb) bt #0 0x000000000084ba1a in _poll () #1 0x00000000007fad26 in __thr_poll () #2 0x00000000005e7303 in pkg_script_run (pkg=3D0x801079000, type=3DPKG_SCRIPT_POST_INSTALL, upgrade=3Dfalse) at scripts.c:248 #3 0x0000000000469574 in pkg_add_port (db=3D0x801078700, pkg=3D0x801079000, input_path=3D0x7fffffffe7b7 "/tmp/media/ssp_port/work/stage", reloc=3D0x0, testing=3Dfalse) at pkg_ports.c:1338 #4 0x0000000000416535 in exec_register (argc=3D7, argv=3D0x7fffffffe3e8) at register.c:195 #5 0x0000000000411202 in main (argc=3D7, argv=3D0x7fffffffe3e8) at main.c:= 886 Then checking the file descriptor table using lsof shows the following, the stray denyhosts process is a culprit, however it's unclear why it should ha= ve a pipe connected all the way to the pkg-static: [sobomax@builder ~]$ ps -xalww | grep -w 33903 0 33903 33901 0 52 0 27020 22276 select I - 0:02.54 /usr/local/sbin/pkg-static register -i /tmp/media/ssp_port/work/stage -m /tmp/media/ssp_port/work/.metadir -f /tmp/media/ssp_port/work/.PLIST.mktmp 0 33923 33903 0 73 0 0 0 - Z - 0:02.16 0 34324 33903 0 75 0 0 0 - Z - 0:00.00 0 34325 33903 0 20 0 21096 17760 select S - 0:00.01 /usr/local/bin/python2.7 /usr/local/bin/denyhosts.py --config /usr/local/etc/denyhosts.conf --noemail --daemon 70 34361 33903 0 73 0 0 0 - Z - 0:05.03 [sobomax@builder ~]$ sudo lsof | grep -w 0xfffff8017cc32000 pkg-stati 33903 root 7u unix 0xfffff8017cc32000 0t0=20=20=20=20 ->0xfffff80480a06000 python2.7 34325 root 4u unix 0xfffff80480a06000 0t0=20=20=20=20 ->0xfffff8017cc32000 I believe this is direct result of the single change here: https://github.com/freebsd/pkg/commit/767fbd77ee64e22a31a4d5903c1e36dcd8533= a70 Some comments were left in that commit as to how to fix possibly.