From nobody Fri Mar 31 23:43:00 2023 X-Original-To: freebsd-current@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 4PpH0h0tXcz43QVM; Fri, 31 Mar 2023 23:43:16 +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 4PpH0g1QhYz3xNT; Fri, 31 Mar 2023 23:43:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.17.1/8.17.1) with ESMTPS id 32VNh0F0027958 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 1 Apr 2023 02:43:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 32VNh0F0027958 Received: (from kostik@localhost) by tom.home (8.17.1/8.17.1/Submit) id 32VNh0Xw027957; Sat, 1 Apr 2023 02:43:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 1 Apr 2023 02:43:00 +0300 From: Konstantin Belousov To: Ed Maste Cc: Charlie Li , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, "freebsd-x11@freebsd.org" , FreeBSD Current Subject: Re: git: 61194e9852e6 - main - Add kqueue1() syscall Message-ID: References: <202303272339.32RNdWPD063667@gitrepo.freebsd.org> List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org 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=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on tom.home X-Rspamd-Queue-Id: 4PpH0g1QhYz3xNT X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Fri, Mar 31, 2023 at 01:27:54PM -0400, Ed Maste wrote: > On Fri, 31 Mar 2023 at 12:38, Charlie Li wrote: > > > > Konstantin Belousov wrote: > > > The branch main has been updated by kib: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=61194e9852e641d1533cd04a5679d6042ff975d3 > > > > > > commit 61194e9852e641d1533cd04a5679d6042ff975d3 > > > Author: Konstantin Belousov > > > AuthorDate: 2023-03-25 23:39:02 +0000 > > > Commit: Konstantin Belousov > > > CommitDate: 2023-03-27 23:39:26 +0000 > > > > > > Add kqueue1() syscall > > > > > > It takes the flags argument. Immediate use is to provide the KQUEUE_CLOEXEC > > > flag for kqueue(2). > > > > > This commit series causes x11/libinput to hit an assert (which also > > silently crashes X on launch): > > > Assertion failed: (libinput->refcount > 0), function libinput_unref, file ../src/libinput.c, line 1957. > > > > devel/libepoll-shim, x11/libinput's prime dependency, has its own > > kqueue1() implementation, which is used when the system does not already > > have one. Reverting this series and rebuilding devel/libepoll-shim to > > use its included implementation allows x11/libinput to work again. > > Ah, NetBSD added kqueue1 some time ago, and it uses the already > existing flags (O_CLOEXEC etc.) > If it's easy to test, can you try changing libepoll-shim to call > kqueue1(KQUEUE_CLOEXEC)? Overloading open(2) flags this way is not wise IMO. Not to mention that a lot of them do not make sense in kqueue(2) context, and that we might want to add other flags which would put even more pressure on the limited O_* bit set. Please see https://reviews.freebsd.org/D39377 for my attempt to somewhat mitigate the mess.