From owner-freebsd-stable@freebsd.org Sun Dec 10 20:23:20 2017 Return-Path: Delivered-To: freebsd-stable@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 DCFF8E9A811 for ; Sun, 10 Dec 2017 20:23:20 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vps.rulingia.com (vps.rulingia.com [103.243.244.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.rulingia.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 90F8B16F4 for ; Sun, 10 Dec 2017 20:23:19 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from server.rulingia.com (ppp59-167-167-3.static.internode.on.net [59.167.167.3]) by vps.rulingia.com (8.15.2/8.15.2) with ESMTPS id vBAK9bp6094123 (version=TLSv1.2 cipher=DHE-RSA-CHACHA20-POLY1305 bits=256 verify=OK) for ; Mon, 11 Dec 2017 07:09:44 +1100 (AEDT) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.15.2/8.15.2) with ESMTPS id vBAK9Vm1008950 (version=TLSv1.2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256 verify=NO) for ; Mon, 11 Dec 2017 07:09:31 +1100 (AEDT) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.15.2/8.15.2/Submit) id vBAK9V6R008949 for freebsd-stable@freebsd.org; Mon, 11 Dec 2017 07:09:31 +1100 (AEDT) (envelope-from peter) Date: Mon, 11 Dec 2017 07:09:31 +1100 From: Peter Jeremy To: freebsd-stable@freebsd.org Subject: Unkillable process in "vm map (user)" Message-ID: <20171210200931.GS23931@server.rulingia.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="JwB53PgKC5A7+0Ej" Content-Disposition: inline X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Dec 2017 20:23:21 -0000 --JwB53PgKC5A7+0Ej Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I was experimenting with ports/devel/libmill (which is a library that provides Go-styly functionality for C programs) and managed to create an unkillable process by spawning 1000000 "goroutines" (think very cheap "thread" or "coroutine") joined by "channels" (think message passing pipes). (The program ran basically instantaneously with 10000 or 100000 "goroutines", and the Go version has no problems with 1000000 goroutines on a much smaller system). According to SIGINFO, it's blocked on "vm map (user)" but I can't kill it. Can anyone suggest a way to unwedge it? This is on a system running FreeBSD/amd64 11.1-STABLE r324494. server% procstat -kk 452 PID TID COMM TDNAME KSTACK 452 102382 chain - mi_switch+0x17c sleepq= _switch+0x118 sleepq_wait+0x43 _sx_slock_hard+0x34e _sx_slock+0xd4 vm_map_l= ookup+0xbd vm_fault_hold+0x194b vm_fault+0x75 trap_pfault+0x107 trap+0x382 = calltrap+0x8 server% ps -wal -p 452 UID PID PPID CPU PRI NI VSZ RSS MWCHAN STAT TT TIME COMMAND 204 452 53567 0 20 0 244064932 2180 vm map ( DL+ 13 0:10.31 ./chain 1= 000000 server% cat src/mill/chain.c #include #include #include coroutine void f(chan left, chan right) { chs(left, int, 1 + chr(right, int)); } int main(int argc, char **argv) { int i, n =3D argv[1] ? atoi(argv[1]) : 10000; chan leftmost =3D chmake(int, 0); chan left =3D NULL; chan right =3D leftmost; for (i =3D 0; i < n; i++) { left =3D right; right =3D chmake(int, 0); go(f(left, right)); } chs(right, int, 0); i =3D chr(leftmost, int); printf("result =3D %d\n", i); return 0; } server% --=20 Peter Jeremy --JwB53PgKC5A7+0Ej Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJaLZR7XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRFRUIyOTg2QzMwNjcxRTc0RTY1QzIyN0Ux NkE1OTdBMEU0QTIwQjM0AAoJEBall6Dkogs028sP/3ipIKNmNvIGhHnD2yt91vmg MvCgDFYcaqDbrdHroc0inkwLQuqEHKZAjEcpb7xkAGEautW2GRBN8gd7wnK5DM7w uPXUls0ad5LAn2IdP4vC+wgQlSwpeKLgDLkmS+Qfw1SccgV94IPk9SXRJ3i3XWBa wvkHyyYUa57BUadbYmm7I4VpYu+GUzvjeuvg+RV+r4iPJBZfPjnzDQA4a7Yu/H9G zMugHrKN6qoyyc/TBc3xOYiZ9BrJ2NgQAR/irj1n6rs7KWRKUEonMvdyixWIkOeC TisXCv/oKBKpboIO0/DGic2flIYwjBW/aIng4zzhs5Jfe/VkW+MBa36Yc8op8vJx BPERLoh+7rxyQSCAsNXpoQeC7e1bwLdKR1SSpXLo1HoAcEKDjzH+4tSR7J/Y8MQp gJ9RHkA3yUcRdbeZDjrGeOTA05DJ4JHnXvepj0k40vwp/3MTSG5EJp8VxwFn5t0V +C853f3+xJyvUdXE3ip6lTVeQPDDXZiI0pFV8Wr865Y9mGImlwrdqoAJsBe2PmNP EhH6wHXnUpF6XVdbEcnF9LnM9bgTsq5GRvD5J6jXm+UsuofO6QWM6RIgSbGZVUbC ikKk3SohlfHUoKXBr/sp8IT5gIK6BMSqL4uV/MCWPTh9N6vlhKt07LyMayh/FYV5 wH/ETkvdylFws2TMhu29 =P1Sl -----END PGP SIGNATURE----- --JwB53PgKC5A7+0Ej--