From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=AWL,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id DAC2E1F4B4 for ; Sun, 27 Dec 2020 16:20:37 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 72D3D120ABC; Mon, 28 Dec 2020 01:19:49 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 40091120ABC for ; Mon, 28 Dec 2020 01:19:47 +0900 (JST) Received: by filterdrecv-p3iad2-74bd9fb996-mzbxp with SMTP id filterdrecv-p3iad2-74bd9fb996-mzbxp-20-5FE8B450-28 2020-12-27 16:20:32.380548931 +0000 UTC m=+1444700.450043303 Received: from herokuapp.com (unknown) by geopod-ismtpd-1-5 (SG) with ESMTP id ELDeZBp6TmC-XHH6MynJxA for ; Sun, 27 Dec 2020 16:20:32.288 +0000 (UTC) Date: Sun, 27 Dec 2020 16:20:32 +0000 (UTC) From: eregontp@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 77651 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 17477 X-Redmine-Issue-Author: kirs 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-SG-EID: =?us-ascii?Q?KippOI8ZHtTweq7XfQzW93937kJ4QNWwSBuHnaMEcr0kGruY5Ednm02jDc4igB?= =?us-ascii?Q?Fdz87vTvLYwhLqvjPj04KOWpy2K=2FhIirBs84TrH?= =?us-ascii?Q?ga+hrrVz9SEjBfXbn3nHmWcuq0KCecDkRp=2Femd2?= =?us-ascii?Q?ovMqcLsjLEMZ2DutY0H6N5BB1R6OYy3eSQnUR5+?= =?us-ascii?Q?HBwtfR25nuOCL161w20vTLZ3wPLeS3=2FjxOAfxuv?= =?us-ascii?Q?qO7nWvczxTj+y42Ug=3D?= To: ruby-core@ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== X-ML-Name: ruby-core X-Mail-Count: 101749 Subject: [ruby-core:101749] [Ruby master Bug#17477] Ractor and pp incompatibility X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #17477 has been updated by Eregon (Benoit Daloze). I doubt `require` can ever be supported in a Ractor, see #17420. It seems there is no good solution for this, and besides this problem not only happens with `pp` but with any kind of "autoloaded" library/gem. ---------------------------------------- Bug #17477: Ractor and pp incompatibility https://bugs.ruby-lang.org/issues/17477#change-89573 * Author: kirs (Kir Shatrov) * Status: Open * Priority: Normal * ruby -v: 3.0.0 * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- ```ruby r = Ractor.new do pp("foobar") end Ractor.select(r) ``` fails with: ``` # terminated with exception (report_on_exception is true): :164:in `ensure in require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError) from :167:in `require' from notractor.rb:8:in `block in
' :37:in `require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError) from notractor.rb:8:in `block in
' :345:in `select': thrown by remote Ractor. (Ractor::RemoteError) from notractor.rb:11:in `
' :164:in `ensure in require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError) from :167:in `require' from notractor.rb:8:in `block in
' :37:in `require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError) from notractor.rb:8:in `block in
' ``` This is easy to fix by calling `require 'pp'` in the top from the main Ractor - but I don't think it is expected for developers. We should optimize for developer's happiness and either make it just work or make it clear that everything should be required beforehand. -- https://bugs.ruby-lang.org/