From nobody Sun Sep 14 07:35:41 2025 X-Original-To: dev-commits-src-all@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 4cPg2L5K6kz67Wp0 for ; Sun, 14 Sep 2025 07:36:10 +0000 (UTC) (envelope-from 6yearold@gmail.com) Received: from mail-yw1-f180.google.com (mail-yw1-f180.google.com [209.85.128.180]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cPg2L20Zdz3jsv for ; Sun, 14 Sep 2025 07:36:10 +0000 (UTC) (envelope-from 6yearold@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-yw1-f180.google.com with SMTP id 00721157ae682-72ce9790ab3so22078637b3.1 for ; Sun, 14 Sep 2025 00:36:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757835369; x=1758440169; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0uubREHrl1i1J/bS6QyQuR5Ay0X2IcsRXtTGMKDded4=; b=hI6P2u+utCSM15lNxouqVWs0HgVchU0bHumchF2bpDcoGbC+wS9bRgHZIyHSLIqUQa tjLhvoRtmXDPDs5bAtKaC+fjRzQPAypRraSthgIlyqVZr2xjJq1QOEw2StkyLDan0WFp 5dyyFbua6nN3vohL15veY3hgv3CAv6MLXJlF99VjjYNfJVTVOsDkwbJckVdqfy6J/x27 5IB0za5D16pwIdBjBOpAwFtooX8eR5Mh4yMALyzTox3G6aF08TRIvfK/pzOL8kAqeBju 1KAq/ziSP7Czt+axwWBIUsh5PquItJgyxDDa8c1Z6RsJRkySe2LRz7TAQn8U571tdNi1 YIzg== X-Forwarded-Encrypted: i=1; AJvYcCW3h6dV6eG4bBaNM2Fa6c0JXu2Who+G5B/28xKdrV0PAkkuOCgJFzXxDV3TY4qg3036zn8jHBqF43D2ZDKjPIDAWgom@freebsd.org X-Gm-Message-State: AOJu0Yytpl4z2MEpxzjpJQBZdZAaDAER0dY2pdinh5D7OJmJHP0E481w O5bv7d+VH6tEyxxIGnc/j6t5GdgF/zGQ55GIn+7VDa3aKocxXy4PmAQvYkXeJkgQSzw= X-Gm-Gg: ASbGncuAdEEf8RGPmDoprxnfbj5ecVAqlBpSzo5GFyuX4i2h1WI5ttpUl7foXJwEuK4 zWAqZYCG8FqZX0crb4XNk0MMyysY3irZSrUf3dT8BdtDXxIOkjXufXaJpvQpd3YPucbBNmj149C sBZNa6zB93IkN2dHvxNogffD4pcaUOlMGne25Tt313AvucU3/qChwnHlQLbotUiJ6t4D25G3Pmv lQ3vcSJFxrfjjzQ/i/e1N+5V69fNA7VFHC/73TVl7h4tiLBcFn5Fd0JK/enlabsgG8iinAAtVHi ey1Rtg5M18gxztVG/KgfzhytgJoFJvu0DqP73U++MXuWpdCohlOI0syX4T28ex23GOTw4nof4b5 +6kp16NTuXdKK0hLVcI1Z0ELfBRabiHPCJdOnQOFWth3paUJCPtvs/m+FDYgV0tTp4aG/M14t X-Google-Smtp-Source: AGHT+IG+ptuGJyIYFjt3/yXSTZSWKesj3KqiPpY2XjKgclhgC9lQtZrZsfhNBytIdJxdsev2NOnYMw== X-Received: by 2002:a05:690c:ed2:b0:724:2cad:8df3 with SMTP id 00721157ae682-730652dd1f5mr84419837b3.41.1757835369409; Sun, 14 Sep 2025 00:36:09 -0700 (PDT) Received: from mail-yw1-f176.google.com (mail-yw1-f176.google.com. [209.85.128.176]) by smtp.gmail.com with ESMTPSA id 00721157ae682-72f796974f9sm23021147b3.53.2025.09.14.00.36.08 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 14 Sep 2025 00:36:09 -0700 (PDT) Received: by mail-yw1-f176.google.com with SMTP id 00721157ae682-71d60150590so19912247b3.0 for ; Sun, 14 Sep 2025 00:36:08 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCVVU2Br+drVX8UfBDklFM1cE/vhk60mV1i6DllnCkWzSZ/wWjx3510D6hTNhouJ18jCpNN8rclbfRyMJDRCY2iqw6hv@freebsd.org X-Received: by 2002:a05:690c:2902:b0:722:7a7f:536e with SMTP id 00721157ae682-730633842bemr78298277b3.16.1757835368564; Sun, 14 Sep 2025 00:36:08 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: In-Reply-To: From: Gleb Popov Date: Sun, 14 Sep 2025 10:35:41 +0300 X-Gmail-Original-Message-ID: X-Gm-Features: Ac12FXwMSJKAYIh4VkWAZMmK9GrGh_IdEa3DwMEG7_hI14ty4Jh7sTxVtynZlM4 Message-ID: Subject: Re: git: fd9e09cb2ab0 - main - kern: replace several EBADF with EINVAL To: Konstantin Belousov Cc: kib@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 4cPg2L20Zdz3jsv On Sat, Sep 13, 2025 at 10:27=E2=80=AFPM Konstantin Belousov wrote: > > On Sat, Sep 13, 2025 at 09:55:52PM +0300, Gleb Popov wrote: > > This change affects following code inside the Qt library: > > https://github.com/qt/qtbase/blob/d6cc7562689d8a07bc933178ea367706ca38e= 4ac/src/3rdparty/forkfd/forkfd.c#L902 > > > > The code in question expects to receive EBADF when being fed a wrong > > type of the descriptor. Returning EINVAL makes sense to me, so maybe > > we should patch Qt rather than revert this change? > > It is really weird code, calling pdgetpid(2) on random fds. Anyway, plea= se > confirm that the following revert makes the problem go away. It does! > BTW, would it be useful to implement something like waitid(P_PROCDESC) > to eliminate the ugly code you pointed to? >From what I gather, yes. The pdgetpid() call there is only used to obtain a PID to pass to wait4. Having waitid(P_PROCDESC) would save us from calling pdgetpid() > commit 4b47521ce2bc4ede52611c268d00ceb1608d959e > Author: Konstantin Belousov > Date: Sat Sep 13 22:23:27 2025 +0300 > > pdgetpid(2): switch back returning EBADF for non-procdesc fd > > This partially reverts fd9e09cb2ab0, since apparently QT depends on t= his > specific error code. It seems that it applies pdgetpid() to random f= ds > and filters non-procdescs by checking errno for EBADF. > > Reported by: gleb That's a different Gleb, my freefall handle is arrowd. But anyways, the original report came from "Kenneth Raplee ".