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=0.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET,SPF_HELO_PASS, SPF_PASS autolearn=no 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)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 1DC8C1F4C4 for ; Thu, 31 Oct 2024 19:58:00 +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=vpaD3n56; 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=uAOc6zoJ; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1730404677; bh=ZFQiOEQsDHdpfkbBPOhkfIY3J29IHVzF14Ufd7PpB+I=; 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=vpaD3n56ROBZ+0F0NRcmxeFS3dmtPTRA80nC8jbDyQyqgN8d7aj1efR+zy565P3as axzxi44VPWr1M9MY2caOYhC29NEmPJIUHE9mHEIFYOstKdmsWws1NuZXpNCr+wdEUm XcKw8fQcXJkELBZG/SvOwCrOSE9cBkLe7ibJelDo= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 5A34B44B17 for ; Thu, 31 Oct 2024 19:57:57 +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=uAOc6zoJ; dkim-atps=neutral Received: from s.wrqvtbkv.outbound-mail.sendgrid.net (s.wrqvtbkv.outbound-mail.sendgrid.net [149.72.123.24]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 4F0DA44B86 for ; Thu, 31 Oct 2024 19:57:31 +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=3Rv+Er+APaybQVCf+mG5MuLOY6DhDqgJJur3tXTrScI=; b=uAOc6zoJiVOzEM/sXpOciu2v4WY83gY1WebQWbTXPsRwIm+OPBiqNoLN7rk/H8hnL2M2 uMHc8VKqRyaB209g9Q/cg4OKuzhv6rPfncxDzSlhFEN/PG0emjF4AGynG8NKKIPvylWBQ/ 7qvFU1mkpyipn8PsPGDgJb54YrwyLdAVdZ0v5x9h/GD99KNsS6EN5aZKMglKbtSLe2K74U O5pV433HjHRzWbSyup7qslvrj++1Lx+J3RtAB8sYZCe3HLiaj2JjHkZfs3+iKpOTiRC49/ MlWt1EG4bsKHvkMCGZ/tvo5u/99F/wSB1sM20nEVaQ9U6zDSx5i7leHHa4s9mqyw== Received: by recvd-canary-75db7f77df-gtqf9 with SMTP id recvd-canary-75db7f77df-gtqf9-1-6723E129-1F 2024-10-31 19:57:29.736815389 +0000 UTC m=+4240897.605573741 Received: from herokuapp.com (unknown) by geopod-ismtpd-11 (SG) with ESMTP id O5xbGNPOSJ-xZHLq7f7HiA for ; Thu, 31 Oct 2024 19:57:29.673 +0000 (UTC) Date: Thu, 31 Oct 2024 19:57:29 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 20856 X-Redmine-Issue-Author: hurricup X-Redmine-Issue-Assignee: kddnewton X-Redmine-Issue-Priority: Normal X-Redmine-Sender: Eregon 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: 96325 X-SG-EID: =?us-ascii?Q?u001=2EByjZWvxTCjdoV8K03xEuhE7KqN4thWULFLM7+oH78KY30oYB3qFthsDpL?= =?us-ascii?Q?4w4cbYa3ttBh8bAHPOnE=2FkzPba67JNu7Lnrked2?= =?us-ascii?Q?O7K9VQ=2FJax0VFB60X+KwzBGWpjD6HUbx8i=2FE4Z5?= =?us-ascii?Q?IE7Rjg1eBYn3bJ8y8hYKT=2FOFHnfgXckqwkFRvLR?= =?us-ascii?Q?ke8CLbugtEsNROD85=2FUeIjJ7bDs0OiCkfm3XABC?= =?us-ascii?Q?fWWJjIEqtm5JXwde2jEE6WLz=2FFc27FSuGtpEikq?= =?us-ascii?Q?az8T1I0pOdPJRvFjFy7GnO91+w=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: ID5GPUCDMO375FMY3U65XNMYIHLBMIFM X-Message-ID-Hash: ID5GPUCDMO375FMY3U65XNMYIHLBMIFM 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:119661] [Ruby master Bug#20856] Incorrect and inconsistent multi-thread eval execution with Prism compiler List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "Eregon (Benoit Daloze) via ruby-core" Cc: "Eregon (Benoit Daloze)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20856 has been updated by Eregon (Benoit Daloze). Subject changed from Incorrect and inconsistent multi-thread eval execution to Incorrect and inconsistent multi-thread eval execution with Prism compiler Assignee set to kddnewton (Kevin Newton) ---------------------------------------- Bug #20856: Incorrect and inconsistent multi-thread eval execution with Prism compiler https://bugs.ruby-lang.org/issues/20856#change-110318 * Author: hurricup (Alexandr Evstigneev) * Status: Open * Assignee: kddnewton (Kevin Newton) * ruby -v: 3.4.0-preview2 * Backport: 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED ---------------------------------------- Consider example: ``` s = Thread.new { a = 5 puts eval("a == b") x = 6 } s.join b = 11 ``` As far as I see it, it should not work. Because at the moment of eval, b is unknown and not even declared (it can even be in condition). But it may be available because file `iseq` already compiled and we know that there is b. So, this works in ruby 3.3 in a script we running, wrapped into the method, or required by other file. But in 3.4-preview2: - it works in file - it works in method - it fails if required from other file with: ``` # terminated with exception (report_on_exception is true): (eval at /home/hurricup/Projects/ruby-debugger/rdi30/test2.rb:3):1:in 'block in ': undefined local variable or method 'b' for main (NameError) from /home/hurricup/Projects/ruby-debugger/rdi30/test2.rb:3:in 'Kernel#eval' from /home/hurricup/Projects/ruby-debugger/rdi30/test2.rb:3:in 'block in ' (eval at /home/hurricup/Projects/ruby-debugger/rdi30/test2.rb:3):1:in 'block in ': undefined local variable or method 'b' for main (NameError) from /home/hurricup/Projects/ruby-debugger/rdi30/test2.rb:3:in 'Kernel#eval' from /home/hurricup/Projects/ruby-debugger/rdi30/test2.rb:3:in 'block in ' ``` And this ^^ is correct behavior if you ask me :) but atm it is inconsistent between the ruby versions and even in the scope of 3.4-preview2 -- 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/