From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from nue.mailmanlists.eu (nue.mailmanlists.eu [IPv6:2a01:4f8:1c0c:6b10::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) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 7C5721F4B8 for ; Tue, 30 Apr 2024 06:40:53 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=lHLdwOfY; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=ga7/zZZj; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 6E9E08462D; Tue, 30 Apr 2024 06:40:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1714459240; bh=H2ybYWsIJsFfmNHFb3IugsJ8wOudhXhRdeu0pGqFT1A=; h=Date:References:To:Reply-To:Subject:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Cc:From; b=lHLdwOfYY47BwwTqokEQMsd38ojRiQKqoahzkBQs3B4ohWMHdt1raW1ofdFUJ1+A7 kHlz5gskiFfZbSsZWXZrh3tWGa0Z708YQaOSyZfYkhL4qtA/YpcLPjh1Etxvj9ie0U SxpzZo1MfO1SloosG6qTgDZddYQ65svfQz4084lE= Received: from s.wfbtzhsv.outbound-mail.sendgrid.net (s.wfbtzhsv.outbound-mail.sendgrid.net [159.183.224.104]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 949F184601 for ; Tue, 30 Apr 2024 06:40:36 +0000 (UTC) Authentication-Results: nue.mailmanlists.eu; dkim=pass (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=ga7/zZZj; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ruby-lang.org; h=from:references:subject:mime-version:content-type: content-transfer-encoding:list-id:to:cc:content-type:from:subject:to; s=s1; bh=cPgyLVF7ssAjxpOWdA8lxnns4Qapozgi4ZtuIcecwTY=; b=ga7/zZZjZrqn4xJ28+DhtRjMar7TuY0PsPkkWSE99NRJZ+7uW1AzfAeXu5zSLrasU+UZ NaXbMLMOldsllPW5IdjXO3nFY0PBMI9+5fOuP1UYeMZ69qLqeguR6Hk5c+51Dc9Vx1skhZ XQGhYwx9NBlZNo7KRJg5j8rP3a7gyB5mTpeSfjFgDbJcrum2uAeSAsS26cvOwjBMjkyHbA I6elE9MwcBaKyYKP8CyGYxmbovU/ZaU4KQqoez7mEsc1Ei3bYB4ro3SPSgIfcKjU5NlpHI uUiyIZDIqJTg71VbDqj0DdriMcq6q5o+/op9WoC7NJR72hBtztBZWkQoLdlWG41g== Received: by recvd-58d7cf8f77-k5xnm with SMTP id recvd-58d7cf8f77-k5xnm-1-66309263-3 2024-04-30 06:40:35.046923759 +0000 UTC m=+28305.422042878 Received: from herokuapp.com (unknown) by geopod-ismtpd-38 (SG) with ESMTP id kRKu3_TFTkuy9ITJttfD8w for ; Tue, 30 Apr 2024 06:40:34.979 +0000 (UTC) Date: Tue, 30 Apr 2024 06:40:35 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 20461 X-Redmine-Issue-Author: yamam X-Redmine-Issue-Priority: Normal X-Redmine-Sender: yamam X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-Redmine-MailingListIntegration-Message-Ids: 94335 X-SG-EID: =?us-ascii?Q?u001=2Es7dCVYoQTPMgeKR72sRNgIiVff0ldt0xHCBAlNQK2lJGqzNfUyOr1fukU?= =?us-ascii?Q?cSlJ6TtKj9JYFsE7bpbFVBq6Mf=2FRTlyM2e5C6El?= =?us-ascii?Q?3skTSom9d7GQdg7TIOqW+79Av7Yo49Qf1sri6l1?= =?us-ascii?Q?yRKH6Il2uZ0U+FWeGsWESwwfHuUDoS676NC72fi?= =?us-ascii?Q?oGKhjt9gUznsMgCTLtUapZ3eEhfRjPgdy4O=2F1iU?= =?us-ascii?Q?4BCWLmaF604JdKsTqU9nFuNAnKKJV14KNRlpydQ?= =?us-ascii?Q?p3bGmrg1uZPSVmXb4wYCOw2lCQ=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: DKH5PLJNTZLUIX53IIGP3VO2PFUPYUXJ X-Message-ID-Hash: DKH5PLJNTZLUIX53IIGP3VO2PFUPYUXJ X-MailFrom: bounces+313651-b711-ruby-core=ml.ruby-lang.org@em5188.ruby-lang.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:117739] [Ruby master Bug#20461] Unreadable pipe included in the readable IO of IO.select List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "yamam (Masanari Yamamoto) via ruby-core" Cc: "yamam (Masanari Yamamoto)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20461 has been updated by yamam (Masanari Yamamoto). Using git bisect, I found that the following commit is the cause of the bug: https://github.com/ruby/ruby/commit/49a55f28abdcf3dea1f84ec5b59cfbedc37f44bf ---------------------------------------- Bug #20461: Unreadable pipe included in the readable IO of IO.select https://bugs.ruby-lang.org/issues/20461#change-108146 * Author: yamam (Masanari Yamamoto) * Status: Open * ruby -v: ruby 3.4.0dev (2024-04-27T12:55:28Z master c844968b72) [x86_64-linux] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- When executing the following script, pipe_r is not supposed to be readable because no writing is done to pipe_w, but pipe_r is included in the return value rs of IO.select. Since it is not possible to read from pipe_r, the IO::EAGAINWaitReadable exception is raised. ```ruby pipe_r, pipe_w = IO.pipe 1000.times do |i| IO.popen(['seq', '1', '1000']) do |popen_r| j = 0 while true rs, ws, = IO.select([popen_r, pipe_r]) if rs.include?(popen_r) unless popen_r.gets break end end if rs.include?(pipe_r) puts "IO.select BUG pipe_r is not readable! i = #{i} j = #{j}" p pipe_r.read_nonblock(1) end j += 1 end end end ``` ``` $ ruby select.rb IO.select BUG pipe_r is not readable! i = 0 j = 20 :63:in `read_nonblock': Resource temporarily unavailable - read would block (IO::EAGAINWaitReadable) from select.rb:14:in `block (2 levels) in
' from select.rb:3:in `popen' from select.rb:3:in `block in
' from select.rb:2:in `times' from select.rb:2:in `
' [1] 73732 exit 1 ruby select.rb ``` -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/