Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Oct 2022 21:02:22 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 267315] dangling jail references
Message-ID:  <bug-267315-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
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.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-267315-227>