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.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 4BB2F1F4B4 for ; Thu, 7 Jan 2021 16:27:15 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 0B8D3120A75; Fri, 8 Jan 2021 01:26:23 +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 37B53120A6D for ; Fri, 8 Jan 2021 01:26:21 +0900 (JST) Received: by filterdrecv-p3mdw1-7474cd8bfd-7xg8g with SMTP id filterdrecv-p3mdw1-7474cd8bfd-7xg8g-18-5FF7365B-4B 2021-01-07 16:27:07.790726665 +0000 UTC m=+2395498.559875058 Received: from herokuapp.com (unknown) by ismtpd0049p1mdw1.sendgrid.net (SG) with ESMTP id 5q0unWamS3GPsw-rWNPTjA for ; Thu, 07 Jan 2021 16:27:07.678 +0000 (UTC) Date: Thu, 07 Jan 2021 16:27:07 +0000 (UTC) From: pkmuldoon@picobot.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 77881 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 17516 X-Redmine-Issue-Author: pkmuldoon X-Redmine-Sender: pkmuldoon 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?RuTB10pI959km83g18mQJC9KvtH6cFTzAlC=2F+3P+a7R+KPZcjk1WwRoY3pUP7o?= =?us-ascii?Q?DWVBVoVJmddiUWIXIpcI4ZOfF+GlM0AbqbOYr=2FP?= =?us-ascii?Q?p9B26DOQljDnqKjk7tXGCPcNK8VVAbYUOTYfXdR?= =?us-ascii?Q?Y83ZJAw0OZWO3oLpwwKs9TAqsJeud8ZvjZfAPuB?= =?us-ascii?Q?XPDmTMfFxrwz6RHZCsXnE9cxazjbS4sHdGEw+kR?= =?us-ascii?Q?cGmcAalbCZnzsoLE4=3D?= To: ruby-core@ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== X-ML-Name: ruby-core X-Mail-Count: 101975 Subject: [ruby-core:101975] [Ruby master Bug#17516] forking in a ractor causes Ruby to crash 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 #17516 has been updated by pkmuldoon (Phil Muldoon). I'm wondering if we can limit Process calls in the ractor as we do for accessing out of band variables? I've not had a chance to attach GDB to the Ruby VM yet (I have to compile Ruby with -O0 -g3 for things to be clear). BTW I'm not suggesting anyone every do that code snippet in the original post! It's somewhat of a theoretical testcase. But the Ruby interpreter shouldn't crash either :thinking face: ---------------------------------------- Bug #17516: forking in a ractor causes Ruby to crash https://bugs.ruby-lang.org/issues/17516#change-89827 * Author: pkmuldoon (Phil Muldoon) * Status: Open * Priority: Normal * ruby -v: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20] * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN ---------------------------------------- I just want to point out, there's absolutely no reason to do this, but r = Ractor.new do Process.fork() end Will cause: :267: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues. [BUG] rb_thread_terminate_all: called by child thread (0x0000700004ddca40, 0x00007f981b567ee0) ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20] -- Crash Report log information -------------------------------------------- See Crash Report log file under the one of following: * ~/Library/Logs/DiagnosticReports * /Library/Logs/DiagnosticReports for more details. Don't forget to include the above Crash Report log file in bug reports. -- Control frame information ----------------------------------------------- c:0001 p:---- s:0003 e:000002 (none) [FINISH] -- C level backtrace information ------------------------------------------- => # [4] pry(main)> /Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_vm_bugreport+0x6cf) [0x103084d1f] /Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_bug_without_die+0x206) [0x102e9e2b6] /Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_bug+0x71) [0x103091e6b] /Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_thread_terminate_all+0x329) [0x10301e5b9] /Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_ractor_terminate_all+0xa3) [0x102f8acc3] /Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_ec_cleanup+0x229) [0x102ea9299] /Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(ruby_stop+0x9) [0x102ea9509] /Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(thread_start_func_2+0x8ce) [0x103027fce] /Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(thread_start_func_1+0x10d) [0x10302753d] /usr/lib/system/libsystem_pthread.dylib(_pthread_start+0xe0) [0x7fff20382950] ---Files-------------------------------- ruby_2021-01-06-104315_phillip-muldoon-FA588.crash (31.8 KB) -- https://bugs.ruby-lang.org/