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=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY shortcircuit=no autolearn=ham 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 052B01F4B4 for ; Mon, 28 Dec 2020 02:25:49 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 7ED97120AC1; Mon, 28 Dec 2020 11:25:00 +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 E651D120AB7 for ; Mon, 28 Dec 2020 11:24:58 +0900 (JST) Received: by filterdrecv-p3iad2-74bd9fb996-ckhwx with SMTP id filterdrecv-p3iad2-74bd9fb996-ckhwx-20-5FE94228-12 2020-12-28 02:25:44.303104838 +0000 UTC m=+1481015.669626148 Received: from herokuapp.com (unknown) by geopod-ismtpd-2-0 (SG) with ESMTP id T-DFCEvhTLmkJANq_pB9aA for ; Mon, 28 Dec 2020 02:25:44.262 +0000 (UTC) Date: Mon, 28 Dec 2020 02:25:44 +0000 (UTC) From: duerst@it.aoyama.ac.jp Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 77668 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 17477 X-Redmine-Issue-Author: kirs X-Redmine-Sender: duerst 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?uQY=2F2xNrNfHHTWbKn6MBvvzfU5Pqk9I4lnOVb0CFDuvcPAs1aC8R=2FMrlBFMDw4?= =?us-ascii?Q?Bnu9XkmA1Sv4uK1KXewu9AR4zJKp=2F=2FctShtdOS0?= =?us-ascii?Q?KHiWw4gGMi6L9hRrCkWHOppte7167urKE50YgiR?= =?us-ascii?Q?jcQQAnojtZCwzMhMUv+euEH9Wp026YVQA7N+PQ4?= =?us-ascii?Q?ZdZhlagCRSHJZk2GskZ43o=2FMjN+fvI0poG2y7t7?= =?us-ascii?Q?0HY1pjmo1Edue4DI8=3D?= To: ruby-core@ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== X-ML-Name: ruby-core X-Mail-Count: 101766 Subject: [ruby-core:101766] [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="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #17477 has been updated by duerst (Martin D=FCrst). My preference would be to make `require` work everywhere, but always be exe= cuted in the main Reactor. That would just be part of the semantics of `req= uire`. ---------------------------------------- Bug #17477: Ractor and pp incompatibility https://bugs.ruby-lang.org/issues/17477#change-89593 * 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 =3D Ractor.new do pp("foobar") end Ractor.select(r) ``` fails with: ``` # terminated with exception (report_on_excep= tion is true): :164:in `ensure in require': can not access non-shareable objects in co= nstant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::Iso= lationError) from :167:in `require' from notractor.rb:8:in `block in
' :37:in `require': can not access non-shareable objects in constant Kern= el::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError) from notractor.rb:8:in `block in
' :345:in `select': thrown by remote Ractor. (Ractor::Remote= Error) from notractor.rb:11:in `
' :164:in `ensure in require': can not access non-shareable objects in co= nstant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::Iso= lationError) from :167:in `require' from notractor.rb:8:in `block in
' :37:in `require': can not access non-shareable objects in constant Kern= el::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 Ract= or - but I don't think it is expected for developers. We should optimize fo= r developer's happiness and either make it just work or make it clear that = everything should be required beforehand. -- = https://bugs.ruby-lang.org/ Unsubscribe: