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 2B3941F508 for ; Sun, 2 Feb 2025 08:59:36 +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=zIDsJ3Jr; 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=C19Y1JWR; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1738486774; bh=8yNw3VTIV8XO3oZ125pEs+rMq5WRP9141ZYO3WzESXQ=; 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=zIDsJ3Jro+t737BtZMkV46JuUESbIztHfY8n9rvYMy9fJ59UQyFmikfs89MAUgo9T Fpo/OUz88Ql4UsUd9GCjb8PlJUhHBgwKpQO0HI/cclDDXa0qS8jFWlooEFiyPWNrNe koM6mYsginUGLhozOxKdS7yVcL3PqL+M2QPW6gZk= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id B69794687E for ; Sun, 2 Feb 2025 08:59:34 +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=C19Y1JWR; 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 1313244B04 for ; Sun, 2 Feb 2025 08:59:29 +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=W8bg2z+S5kX3mEqPqUy/Q/e1d9UB3EiqWoacDpE2pl8=; b=C19Y1JWRYgkBfb4YKxGfVAd5uTpuolsywJ4rOc0SU5uJiPtLKSKdYibSDlq84xD+Cdqr pVTUzhsEe14AtgYKsLoBxkkxHyOoyD2ohG7/7LS7CIucLFz8BZaxye9zgzE1KaDhP8/bHl uc8CKZ0EpFGL6ojGwexoF6BFx3p/aTpbE7NgWXp2eCXM1HnKu8pJMVWj54kz1JZyoFbaMm 9+PQyCJtaUPXZhUCnyo8FApA80ofleRRoP9getZu+bVc/0rBLgg2EVWnL4dn2eWay/YqBg UqF5CoBIdNvZy86w1i/ISUMpe9yJz2llkYavNYhvbElGx9raRryDgigQMqO2Wl8w== Received: by recvd-84b546689d-6cb64 with SMTP id recvd-84b546689d-6cb64-1-679F33F0-5 2025-02-02 08:59:28.687802773 +0000 UTC m=+6867357.255602199 Received: from herokuapp.com (unknown) by geopod-ismtpd-21 (SG) with ESMTP id JThguCarQsS_BF59DUgkQQ for ; Sun, 02 Feb 2025 08:59:28.515 +0000 (UTC) Date: Sun, 02 Feb 2025 08:59:28 +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: osyoyu 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: 97575 X-SG-EID: =?us-ascii?Q?u001=2EanE5UfAszL2ddRoCmYG9g+CedqmCutiUtfFfNrEKceaMzGEX=2FGWvsCIIg?= =?us-ascii?Q?BqFTLp=2FbkLTYYjm8JoOZx=2FbdZslur1d=2F66wP01e?= =?us-ascii?Q?GxviWLb4OvedT=2FxxojhHXD2Ir75EsUwdU82PNbl?= =?us-ascii?Q?GEHEbuqdRINmS1aCiS3MbxBPGfYL8coJg+Y=2FpnU?= =?us-ascii?Q?ubcSwpK0TudNRxJTwWGH=2FJhDVk2U6Td=2FxogPLof?= =?us-ascii?Q?xdxB3MVJ=2Fq6rYD1w3W4Z4yMsGjD4gL=2Fnccuu+VB?= =?us-ascii?Q?UPaOJ6qqVNuf6JuQvQW4F5xnZw=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: FDSX3WGXBQFIXOTZU6ST5MTHUHEMXSH2 X-Message-ID-Hash: FDSX3WGXBQFIXOTZU6ST5MTHUHEMXSH2 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:120859] [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: "osyoyu (Daisuke Aritomo) via ruby-core" Cc: "osyoyu (Daisuke Aritomo)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #21108 has been reported by osyoyu (Daisuke Aritomo). ---------------------------------------- Bug #21108: C-c (SIGINT) crashes ruby when looping Ractors are not taken? https://bugs.ruby-lang.org/issues/21108 * 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/