From nobody Fri Jun 13 09:35:59 2025 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 4bJZ5W30sjz5ph7y for ; Fri, 13 Jun 2025 09:35:59 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJZ5W1DS6z4QYX for ; Fri, 13 Jun 2025 09:35:59 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749807359; 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=8AUJuIOzANb9Ubqwyl9Rn5urzJua5UOVEzUcGORqcCs=; b=Ks2BV1TgEiXM8QmTQ1RkPNk8mthyZ3STc25z2ordR+qH5OjQX8OEdJj+CJLA4GpKt6wYFq +v28kfBGvLkqXQXSfA9mK92LV+hrrEfjUr2+Mxox10mHd9kTodgVIFVZPrQaw6huHrcXEA qYphD80coPEgFkXZZxJTecLdOshHaeVNG1G27c1OEiAV6KgoUq4JaYEbfKm0z38GNxjOIM ZmRhysfu8pSYupdQ7BVtJcEy7HZb+LdOO2jJG5FkQAYzcHtNC2GCP23Bh2P11cQPOMbxKJ HEyZCDbpg0wuCptL3bnDY6OTTihsqBHsOPyaPxBIEl5Wv9I2uTC/d9oY5JrAdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749807359; 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=8AUJuIOzANb9Ubqwyl9Rn5urzJua5UOVEzUcGORqcCs=; b=nw8IPxvRm0rrzlTUXGxLa/fWxy2teb6ak+IJO5tNSlCqgEZMfPxhTTI/m3JJGxg6CAYH0D Ex54H42278C4lVXTxcInGi26ip2I1BldsJtXGWVeB+SyzmJ++Vi1djEfQY+pghzxAroaqM cURgj264gZaRCUk105qYrbqeHr/uOd0m6wvMHK/5H+qQd602eD+mupkyjCwuuj8we0wFrC 6iygc+wY2USG1pRooIGLeMLKI2lGIQ0cgkzvTbpVLyxeXAs6amkvMADbsfqWjDxApVIM8t xgC/DFoJvGzXwPtqX8MVnRPia2fdftenyY8PWQh2Rb/cMIp4+lVQyC4SomqurQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749807359; a=rsa-sha256; cv=none; b=HtHs6iaJav9SxBjA4h8aLUU2XwT/J0MOPNbpJLjWrzJ03bA0kPpv6sFKsy8CbPGfOJrLIU YnJfhmBKWsNI/X7LwAZCIm5RonbHny5+H2r+ZDwAH3upavczIaw0aIb5WKerEkIPsqnEjy XfIeAS7nPwcsrNsmBGziKDeI3mRBan4hhDXgE9/rvUs0avxoFUXXgTrYHGn4vIxK+6O5QH 3m3mzZVDuu9sTHAhrTYyhPJYbs6/CewXYNEsJrLfq3z6K3XnFsh2SCpCfiDalrtu8OXFjI Xj51bgXMawt84OuTr9OpbbdNvqUl1gNJZgyeCbGPxxm4a4mD1IAwPi250BiHZQ== 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 4bJZ5W0qrkzshr for ; Fri, 13 Jun 2025 09:35:59 +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 55D9Zxor015408 for ; Fri, 13 Jun 2025 09:35:59 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 55D9Zx1p015406 for bugs@FreeBSD.org; Fri, 13 Jun 2025 09:35:59 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 287499] [unix/stream socket] SO_SNDLOWAT value is ignored on select(2) Date: Fri, 13 Jun 2025 09:35:59 +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: 15.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: takahiro.kurosawa@gmail.com 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 attachments.created Message-ID: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" 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 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D287499 Bug ID: 287499 Summary: [unix/stream socket] SO_SNDLOWAT value is ignored on select(2) Product: Base System Version: 15.0-CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: takahiro.kurosawa@gmail.com Created attachment 261231 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D261231&action= =3Dedit tesst program to reproduce the problesm The setsockopt(2) manual page states: SO_SNDLOWAT is an option to set the minimum count for output operation= s. Most output operations process all of the data supplied by the call, delivering data to the protocol for transmission and blocking as necessary for flow control. Nonblocking output operations will process as much data as permitted subject to flow control without blocking, but will process no data if flow control does not allow the smaller of the low water mark value or the entire request to be processed. A select(= 2) operation testing the ability to write to a socket will return true on= ly if the low water mark amount could be processed. On 15-CURRENT, select() returns >0 even if the buffer space for sending data is less than the SO_SNDLOWAT value. 14-STABLE does not have this problem. A test program is attached. The test succeeds on 14-STABLE but fails on 15-CURRENT. It seems that libcap_fileargs relies on this feature for sending control messages. I have run into this problem while building packages in a 14-STABLE jail on= a 15-CURRENT host. elftoolchain on 14-STABLE uses libcap_fileargs. Probably the problem is caused because the sb_lowat of the peer's receive buffer is used for checking availability of the send buffer space instead of sb_lo= wat of the local send buffer: https://cgit.freebsd.org/src/tree/sys/kern/uipc_usrreq.c?id=3D1beab149d0b97= 68ad6d07501326a2060d7b0ba58#n1705 --=20 You are receiving this mail because: You are the assignee for the bug.=