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 [94.130.110.93]) (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 A8B4C1F4B8 for ; Sat, 27 Apr 2024 23:21:22 +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=woMTLhG5; 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=N6/MG1YR; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 50F65844EB; Sat, 27 Apr 2024 23:21:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1714260074; bh=kp3G94iWDNLPtAF16TbzxZ2HNNyTvX+CqVWWFnbbjEE=; 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=woMTLhG5BTo5nvplCPkj22Yd8t+0Ih2oIEtoA029HTPT+yljYv8VaAKobaokivEzZ +ZmA/+81u0O2lrfr8XNtmVq5jI0wfx+tPvFLCrgVXND/D/s8xgq1a3TqT7aEcvGjRi M23Eqt2H68p56ktauPo1Oag2T0Op5acB9G60KYrA= 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 1AC2784425 for ; Sat, 27 Apr 2024 23:21:10 +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=N6/MG1YR; 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=sPqlxGzFBFbvjaXVixQm0J3WtYkNmiMPMTnWQ3Y25Jo=; b=N6/MG1YR1JCZ6WPZIpzTNyE2y7pACRzvZDlo+3LcPSnNRA+Yth25Nqj2PVcIyivFdCGA 0w5thSfILdqhaK3kbpehOOgav5yCGhp2Rxz0+b1/QjuT5pjNWpagnrkAbzMKpfVRCkvbi+ D3Hek02Cs3lHtRtZQ7wc8chfYdfh7kcLL0jTgFuzOAPXEqy5UUwVkxw1HhKopD4VppDnel o9dn4Aud+pyKZfJ8pI7L3hDrWTtNJ5MjuCv3JAODBDIRY9P7Kl5mEgN3p2M7FuVG435Tde Ho/Kv7ETjASPYP+76tiE5GXKP16WbDOk9vKKWZPzh6r+K5Tz7sx0HYs4HRgTRobg== Received: by recvd-547d99795c-g8lb4 with SMTP id recvd-547d99795c-g8lb4-1-662D8865-D 2024-04-27 23:21:09.957920078 +0000 UTC m=+1300815.214521498 Received: from herokuapp.com (unknown) by geopod-ismtpd-10 (SG) with ESMTP id yWui0qSuT6WXYM4WIT8zag for ; Sat, 27 Apr 2024 23:21:09.936 +0000 (UTC) Date: Sat, 27 Apr 2024 23:21:10 +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: 94329 X-SG-EID: =?us-ascii?Q?u001=2Es7dCVYoQTPMgeKR72sRNgIiVff0ldt0xHCBAlNQK2lJGqzNfUyOr1fukU?= =?us-ascii?Q?cSlJ6TtKj9JYFsE7bpbFVBq6Mf=2FRTlyM2e5C6El?= =?us-ascii?Q?3skTSom9d7H2xL6Yr8EoUH7i+3kDi=2FRQXrUu=2F+A?= =?us-ascii?Q?IuCOoQGV=2FzSsZcBL+Aaa7orM2QMs9+1hepriac0?= =?us-ascii?Q?v0mS03B4dAOHzpWRuxwkiRMOvgk1CunjxshRAA0?= =?us-ascii?Q?FJy3YGKRoov2yNlqJrYo7c88kRJ2siZWxOizLEl?= =?us-ascii?Q?p2VpML016DlPYRHlqNKlU2fuNA=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: YLDIZV45VR3F2SL65AOLUTXRWECELCZO X-Message-ID-Hash: YLDIZV45VR3F2SL65AOLUTXRWECELCZO 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:117733] [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 reported by yamam (Masanari Yamamoto). ---------------------------------------- Bug #20461: Unreadable pipe included in the readable IO of IO.select https://bugs.ruby-lang.org/issues/20461 * 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| File.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/