From nobody Mon Oct 24 21:02:22 2022 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Mx6vz12pDz4glHR for ; Mon, 24 Oct 2022 21:02:23 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Mx6vy5qwbz46wM for ; Mon, 24 Oct 2022 21:02:22 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Mx6vy4cmxzML6 for ; Mon, 24 Oct 2022 21:02:22 +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 29OL2MXa050910 for ; Mon, 24 Oct 2022 21:02:22 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 29OL2MWb050909 for bugs@FreeBSD.org; Mon, 24 Oct 2022 21:02:22 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 267315] dangling jail references Date: Mon, 24 Oct 2022 21:02:22 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: markj@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666645342; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=omrFvyOMP0xiTZs6pIZQGV9QhsCdFSeDoHfAMBbFwAA=; b=kcjorIOGJ+5Ckc3X0v5d/X+FEzFNUWCJrWHWcA4860ALm+RpBvx0QKVORQMgXuiLDNmdQs JeS3iwwS0W6QSDpkXs/zi2FsUhcyZw3ydlH3eKIDnyRfgm3HT/stwFo/PTxkQ75LvZhbgn qMTQV+8Db0du6QoSt8y2RScowKZeool3u1RH+x65sYh2NqdMnhcdwAQ5pXrlMc46iPnHfD ENqd8k3vrXMwm47hCRyJ0SqcmYQ4ZcI5RQYTcKNaGE2KgWlSLUN8wWel/+JHD+CfMLirhh LbCAGLTDAJk0wDJm5k28m7VRuwqrpjV/F+CAuc5tomLxK04Bu/+T+pkFk4ZGQw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666645342; a=rsa-sha256; cv=none; b=vNPHFWoq1d+YlE1rvrM8JvjF0nY/LSfmF+3BBtXWiTnHYiZHzM23eRqNa3dKW/APrfR25g FZoPsSmC2NQY+dxmGU3NZxJuv5EHufcuTrvPy7u9+63Ogo8EB7w8xXZttQEI5C7Nw0TmJl qfMfKCg/jFB/VZCwdi+1FFqTmt5LMc1DGvwr7He959LZFgbTkU2epqL5MXvSrC98wCy+qn R46ddiOI8D9wlTEJZnzxHrcEU/H1JM/kF0HRzkU13C3pxzVam4dII28TUcy9JqJTN0Lv3k MzWAWahLoyMQTIg+RKiXu86f6GJgaY3yllqNx/Avq3CjxCJksZlfKGkYlOY97w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D267315 Bug ID: 267315 Summary: dangling jail references Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: markj@FreeBSD.org Some operations in jails cause the jail to get stuck in the DYING state, holding onto memory resources. This makes it difficult to write regression tests using jails, particularly with nested jails. With nested jails, I *think* the fact that the child gets stuck prevents the parent from auto-destroying itself when the last process exits. But this means that te= st cleanup doesn't work even if the test passes. I can reproduce one case easily: markj@biggie> sudo jail -c name=3Dtest vnet command=3Dsh # ifconfig lo0 up # ^D At this point the jail is supposed to go away since it isn't persistent and doesn't contain any processes. But jls shows that it's still there: 20 / test DYING 30 If I don't UP lo0, then it works as expected. Here's a more involved example: markj@biggie> sudo jail -c name=3Dtest children.max=3D1 vnet command=3Dsh # ifconfig lo0 up # ifconfig lo0 inet 127.0.0.1 # jail -c name=3Dtest ip4.addr=3D127.0.0.1 command=3Dsh # exit # jls -vd JID Hostname Path Name State CPUSetID IP Address(es) So far so good, but then if I try to create a connection: # jail -c name=3Dtest ip4.addr=3D127.0.0.1 command=3Dsh # nc 127.0.0.1 8080 # echo $? 1 # exit # jls -vd JID Hostname Path Name State CPUSetID IP Address(es) 32 / test DYING 39 127.0.0.1 Then upon exiting the parent jail, it remains in the ACTIVE state, so I hav= e to manually destroy it. --=20 You are receiving this mail because: You are the assignee for the bug.=