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 C1A071F508 for ; Sun, 2 Feb 2025 23:19:20 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; unprotected) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=hDj4VZm7; 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=CGXWV9Fs; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1738538357; bh=4atr2agSkWv9JgvegefBD95mAwNG50mNfqE5F9bNQTo=; 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=hDj4VZm7IMTp3ymOcCnLioMobQhn1inNceeTQtQWUV2X3eIyWuc5df5Z99T8Q3Cn3 Lxqtd9Rog8vyxm3L0ir8o0/hlJoQ/1OMSQ6nJyexlXzYXwOrARv21CJ8ViOXz7MR6c ULYMiN3cKfm7/BkRdJhXV/F5eRdw281Hg/ONQzSk= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 9302446888 for ; Sun, 2 Feb 2025 23:19:17 +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=CGXWV9Fs; dkim-atps=neutral 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 5FCAF44B04 for ; Sun, 2 Feb 2025 23:19:12 +0000 (UTC) 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=bKl2YVoHS6S9ti+O43b/DFKu6+hIrIFDbsJBW7h1PG4=; b=CGXWV9FsA3G/RFMHFy/CfFEkk44P1kNpUP++G57EkxtpA4HbzFbO4qXgwcOzGzwPQNVt /4pWskQ7uG9pc2VlsHjKSIzzI3WR3NvV+WD/6HgjEq5TkIAYDjeihGuecfFJGum0VLqavn u8ID8KOSBFwqRD2jYQOd+3gTco84RsCGthIkw+xx3hFVRx4jhLzKae2Yw40dXDqeAzEGns wXQxWF16Oo8+I6JfzEPdgdI3W04L5QuPml8Da3hCwlVcUNY8/BZ8icYluI4UrZLr6UBezC 9UcLu+C4FI7/9NQZcMCivk0k6lKOmDqHP+U8SX9JfAvetBVE6Fc351Tpa5EOYPvg== Received: by recvd-5f9ffdf494-vzpds with SMTP id recvd-5f9ffdf494-vzpds-1-679FFD6F-5 2025-02-02 23:19:11.353824557 +0000 UTC m=+6919238.468373626 Received: from herokuapp.com (unknown) by geopod-ismtpd-37 (SG) with ESMTP id s-Tu2S3STfO1LKIAeUMd0Q for ; Sun, 02 Feb 2025 23:19:11.310 +0000 (UTC) Date: Sun, 02 Feb 2025 23:19:08 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 21108 X-Redmine-Issue-Author: osyoyu X-Redmine-Issue-Priority: Normal X-Redmine-Sender: luke-gru 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: 97581 X-SG-EID: =?us-ascii?Q?u001=2Eu2jV1cZCX3JeC9XuCMpKrPL8QYex4qqdacL0+MyIJYZ8T98+Yamf0oq9z?= =?us-ascii?Q?aSwYa9OgKS1yrZArj33QXc1KJqA8PopG+kgVPq9?= =?us-ascii?Q?cjRbGB5G3hd+6HYX2sODd47UDOAlg=2FFk2XtIPij?= =?us-ascii?Q?UqPH=2FhnAV3S=2FMVV9ajTnKsBXmE7j4QtLi9UQp5y?= =?us-ascii?Q?IRTnE=2FwARr6ZIibM4ZPI=2FW1EdKUyH0e4P2mUBSV?= =?us-ascii?Q?hmF5KNDVuwi5VGbgraYF7RCWu5VscDdjeIGlI3i?= =?us-ascii?Q?Ho=2F5s+fyxrAbjuvErjWPuSI2vg=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: ZQCML4RODGEKHWUNCMVJO4VSI2C73Q6A X-Message-ID-Hash: ZQCML4RODGEKHWUNCMVJO4VSI2C73Q6A 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.9 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:120865] [Ruby master Bug#21108] C-c (SIGINT) crashes ruby when looping Ractors are not taken? List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "luke-gru (Luke Gruber) via ruby-core" Cc: "luke-gru (Luke Gruber)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #21108 has been updated by luke-gru (Luke Gruber). This is actually related to https://bugs.ruby-lang.org/issues/21090, my patch fixes this issue as well. ---------------------------------------- Bug #21108: C-c (SIGINT) crashes ruby when looping Ractors are not taken? https://bugs.ruby-lang.org/issues/21108#change-111739 * Author: osyoyu (Daisuke Aritomo) * Status: Open * ruby -v: ruby 3.5.0dev (2025-01-27T08:19:32Z master c3c7300b89) +PRISM [x86_64-linux] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- Hitting C-c causes ruby to crash under these circumstances. ## Repro Hit C-c while the program is running. ```ruby r1 = Ractor.new do ary = [] loop do Ractor.receive Ractor.yield ary.push(1) end end r2 = Ractor.new(r1) do |r1| loop do |i| r1.send(nil) r1.take end end # r1.take # `take`ing r1 will fix this issue r2.take ``` ### Expected The process quits. ### Actual An `[BUG] unreachable` occurs. The rb_bug() is called inside `ractor_try_yield`. https://github.com/ruby/ruby/blob/ace39a3ed40cc32ff8d48893173413a7e05b8316/ractor.c#L1359 ``` wrap.rb:1: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues. :644: [BUG] unreachable ruby 3.5.0dev (2025-01-27T08:19:32Z master c3c7300b89) +PRISM [x86_64-linux] -- Control frame information ----------------------------------------------- c:0005 p:0003 s:0022 e:000021 METHOD :644 c:0004 p:0014 s:0015 e:000014 BLOCK wrap.rb:5 c:0003 p:0017 s:0012 e:000011 METHOD :168 c:0002 p:0008 s:0007 e:000006 BLOCK wrap.rb:3 [FINISH] c:0001 p:---- s:0003 e:000002 DUMMY [FINISH] -- Ruby level backtrace information ---------------------------------------- wrap.rb:3:in 'block in
' :168:in 'loop' wrap.rb:5:in 'block (2 levels) in
' :644:in 'yield' -- Threading information --------------------------------------------------- Total ractor count: 2 Ruby thread count for this ractor: 1 -- C level backtrace information ------------------------------------------- ruby(0x639a516dc55a) [0x639a516dc55a] [0x639a512af8dd] [0x639a512a3a31] [0x639a513876a1] [0x639a513877a6] [0x639a5149b0b3] [0x639a51487565] [0x639a514317db] [0x639a51433e71] [0x639a51434295] ``` See full log at: https://gist.github.com/osyoyu/2ae4fe3e41c139703bab5c321a81dda5 -- 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/lists/ruby-core.ml.ruby-lang.org/