From nobody Wed May 25 21:26:45 2022 X-Original-To: gnome@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 A8E151B3997E for ; Wed, 25 May 2022 21:26:45 +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 4L7kfF2bzBz3t4b for ; Wed, 25 May 2022 21:26:45 +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 3512D20CCD for ; Wed, 25 May 2022 21:26:45 +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 24PLQjHh080525 for ; Wed, 25 May 2022 21:26:45 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 24PLQjYg080524 for gnome@FreeBSD.org; Wed, 25 May 2022 21:26:45 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: gnome@FreeBSD.org Subject: [Bug 194727] uaudio device gets disconnected, and hangs usb until everything using /dev/mixer* is closed Date: Wed, 25 May 2022 21:26:45 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: usb X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: hselasky@FreeBSD.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: hselasky@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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: GNOME for FreeBSD -- porting and maintaining List-Archive: https://lists.freebsd.org/archives/freebsd-gnome List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-gnome@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653514005; 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: in-reply-to:in-reply-to:references:references; bh=1keDW7B70DaDmtljpEeF74XqulmNcjXkqyaIMho6Dfc=; b=gF4/aeKe5ozkOPZPUGKfDZBd89pq1luNncLv7mCUdbHWnmdHk/RDYAri1wT+bRYw2ewaJh j3uZHjPNAkbR/InRQtw1LcHxuSosiHOEH8f43yMi0W8Wh5+aiCXAV0+gIJSAcUwPYlcuT0 cmjlVUPP63zYDzAotxyflnzMdSn5jJMR/ijVuuj4+cjGxaBrO/w9TqmKOIhmRXfHAn71DR +RAsRYnxdhYl8ogd+NWmUmRvovlF4orceR4NZUQYCCXq3a5CFT8Qr8xPgq377RGfpLIiOd YI8bYGYE09fMg4Oa9pZKRj+g9YvbZWzqYT5RPcyxPqtuuTnhYMownlZkJh4RLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653514005; a=rsa-sha256; cv=none; b=KJm9usRJOQQ/4AJFGTgK68GYBqHhEuwDEsRcAfIRIKIJc+Y09CTR6sbZdECfesEaYg1+C5 9ZJz8mjkTPVCxJ7bZkVc9CKIe+CvjNSMFaykdl4BECTh11G5BcTP1GbSA2/uevYOI/Uk/5 cdp9hIeO7m3X87BjvZySbVBf+pFDRvVJ1nFIJJ9X6NNKG/Y+ljIAX47k+XLU8V0Xb1VNIC gofjRBEp1K5F6ALcI4I0d5rcHtDRI/m2PdbgS68HoD1c4FuaNKko2vadoDSLUsOMxIEncV hbwmkQDKe/UmJ8GLJC3FrPdOTcPg+RlZ40uM0LK6xz+fhB0NkcnWyUG7SycoVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D194727 --- Comment #76 from Hans Petter Selasky --- (In reply to Hans Petter Selasky from comment #71) > My complaint, and I think others have expressed this, is that a misbehavi= ng=20 > application should not prevent me from using the USB port the sound card = was=20 > inserted previously. A misbehaving application should not have the level = of=20 > control of the system. While PulseAudio is having an issue, the handling = of=20 > this situation needs to be more robust. Hi, The only responsibility of the kernel is to garbage collect memory and resources which are not freed when a user-space application exits. For example if you open a shared FIFO and don't read the data which is writ= ten there, the writer will eventually be blocked as the internal buffer it has = is used up! The same with USB. If you get any handle on a USB device, and don't free it when the device vanishes, the kernel will wait enumerating further devices, because it not only wants the memory back it also wants to free up unit num= bers for coming character device nodes. I'm not willing to leak memory as a compromise for faulty applications. But= I could be willing to implement a kill after timeout sysctl, that if an application using USB resources does not free up its handles and such, it g= ets automagically killed, like out of memory, OOM. What do you think about that? Applications and the kernel are in a symbiosis and must "talk" to each other correctly for things to work in the end. It's like a protocol. Audio applications may need realtime priority for example, to process audio= in time, but if they are broken, they may go looping and use 100% CPU and lock your system anyway. Again, if your application leaks file descriptors, and you think it is a bu= g, I would fix the application and not the kernel. --HPS --=20 You are receiving this mail because: You are on the CC list for the bug.=