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) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id A08AC1F4C4 for ; Mon, 4 Nov 2024 20:03:33 +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=WKimVCuG; 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=N+AQcaj2; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1730750610; bh=pSFw6NfwXifG1vBg6Jmn94q8TEjFu24EJSzVpufryiU=; 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=WKimVCuG5khwHllqfcRHs7LYQq8e8z27KoVTFsSi+zmSkU7Xaeu5euiv+8VVghU4v O1yVSSKGYQZ2Isf6jVB6sHV2h5m3JjW2OIorrzbWQsCwGiz0/vHHRdUrxVVgq04pon gvkhjVqoPS27htcDrsyU/bm0OWGsN4evzbBVUbB4= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id EF14C44B3D for ; Mon, 4 Nov 2024 20:03:30 +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=N+AQcaj2; dkim-atps=neutral Received: from s.wrqvtzvf.outbound-mail.sendgrid.net (s.wrqvtzvf.outbound-mail.sendgrid.net [149.72.126.143]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 6CB0A44AE7 for ; Mon, 4 Nov 2024 20:03:20 +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=3uv+JQ13SF8FZhj+1Nv6rhftpTnlPm7N/1UyAC4C97M=; b=N+AQcaj2JLqB4CctgcFwYwKIAK/7Na2yLbJXI4FNUntY7LvMJ/nR+7UnS8Vu77JmNZH5 cGAG1i8cXnpwOAVOc4Cn6J2HPg5dbdqn1mM0heO9wV2OkudUhNUqz8Y46le5kCgLATkx5Y +0jkW6bxA4ioNB0p1erq1eSgJe/Skwtv+0vt2QP9uAJRQo6CizvJUaCKKCAzhLqZngkEK0 vurdffakyg1mGTE+UnRsTtyR/buwm9gn11ZnAtpZXHByFXt4IbnGpRZWBLhecFYa4SDYW3 u3DXha0HTcN0p4RhpesLxfZN13YWPwx3gjtN/BctuuJmfF+jLUvxQAor5/GfukXQ== Received: by recvd-d66cff667-4bs8l with SMTP id recvd-d66cff667-4bs8l-1-67292884-1B 2024-11-04 20:03:16.425313362 +0000 UTC m=+4586816.985322242 Received: from herokuapp.com (unknown) by geopod-ismtpd-20 (SG) with ESMTP id nGkf8r-BQV2DjV99zS7y-w for ; Mon, 04 Nov 2024 20:03:16.341 +0000 (UTC) Date: Mon, 04 Nov 2024 20:03:18 +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: Group (prism) X-Redmine-Issue-Priority: Normal X-Redmine-Sender: kddnewton 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: 96366 X-SG-EID: =?us-ascii?Q?u001=2E41nWPij=2FD1kdGmpgWeHScbb9X8tZePZrQQx3bl8Vy2odBuMhLMhId2kIq?= =?us-ascii?Q?I4MmMJ43lNHfKPNNds=2Fb3JsTYpYoWyQb3+sPV4d?= =?us-ascii?Q?vscaSKwkBzW49TXeJ2CojyZkOMwDqwD7sJdT6bn?= =?us-ascii?Q?gzT3R2mdUxeBnj9AiAFQ3NB8iZSoahnTwpi81h=2F?= =?us-ascii?Q?q1KssNJm9pz2ersjhh=2FulLMGO3hd2N0irg34YSm?= =?us-ascii?Q?B5X44thHeDg9Ul6IKBPhBX1WNVGgpI58y7vJ1kf?= =?us-ascii?Q?20WzyYgh6pVPEGoiQn1JYyZ8pQ=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: ZTEOMG7BGTFB6FJGCVUUO4LQ3WMY7U2H X-Message-ID-Hash: ZTEOMG7BGTFB6FJGCVUUO4LQ3WMY7U2H 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:119701] [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: "kddnewton (Kevin Newton) via ruby-core" Cc: "kddnewton (Kevin Newton)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20856 has been updated by kddnewton (Kevin Newton). Thanks for the report, it should be fixed by https://github.com/ruby/ruby/pull/11993. ---------------------------------------- Bug #20856: Incorrect and inconsistent multi-thread eval execution with Prism compiler https://bugs.ruby-lang.org/issues/20856#change-110361 * Author: hurricup (Alexandr Evstigneev) * Status: Open * Assignee: prism * 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/