From owner-freebsd-net@freebsd.org Fri Jan 8 19:32:23 2021 Return-Path: Delivered-To: freebsd-net@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 C980F4D455D for ; Fri, 8 Jan 2021 19:32:23 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4DCCsz2rM1z4sr4; Fri, 8 Jan 2021 19:32:23 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 108JWFel032979 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 8 Jan 2021 21:32:18 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 108JWFel032979 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 108JWFIq032978; Fri, 8 Jan 2021 21:32:15 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 8 Jan 2021 21:32:15 +0200 From: Konstantin Belousov To: Vasily Postnicov Cc: Mark Johnston , freebsd-net@freebsd.org Subject: Re: DNS using Name Service Switch module and Casper Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4DCCsz2rM1z4sr4 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; TAGGED_RCPT(0.00)[]; REPLY(-4.00)[] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2021 19:32:23 -0000 On Fri, Jan 08, 2021 at 08:17:25PM +0300, Vasily Postnicov wrote: > I have noticed that after I kill stuck ping, the process spawned with > cap_init() remains. I cannot even kill it with SIGKILL. This is the > output of procstat on such a process. > > > vasily 969 0.0 0.1 26428 6532 v0 I 22:43 0:00.00 ping > vonbraun.local > vasily 983 0.0 0.1 26428 6532 v0 I 22:43 0:00.00 ping > resurrected.local > vasily 1024 0.0 0.1 26428 6532 v0 I 22:49 0:00.00 ping > resurrected.local > vasily 1028 0.0 0.1 26428 6532 v0 I 22:49 0:00.00 ping > resurrected.local > root 1089 0.0 0.0 12976 2512 v1 S+ 22:58 0:00.01 grep ping > PID TID COMM TDNAME KSTACK > 1028 100579 ping - mi_switch+0x155 > sleepq_switch+0x109 sleepq_catch_signals+0x266 sleepq_wait_sig+0x9 > _sleep+0x2aa umtxq_sleep+0x19e do_lock_umutex+0x744 > __umtx_op_wait_umutex+0x49 sys__umtx_op+0x7a amd64_syscall+0x12e > fast_syscall_common+0xf8 This is strange, I sprinkled enough checks for stops and kills into kern_umtx:do_lock_*(), I believe. Also, if there is kill pending, sleepq_catch_signal() should not remove the thread from runq. I would expect that there is such bug if this thread went into loop with 100% CPU usage, but by your report it sleeps. Could it be that you need to kill ping from root? If killing from root does not help: What is the kernel version? Can you provide minimal standalone binary that reproduces this situation? I do not even need sources, binary alone which does not use any libraries not from base, is enough.