Project

General

Profile

Actions

Bug #17489

closed

Ractor segfaults

Added by kirs (Kir Shatrov) about 3 years ago. Updated about 2 years ago.

Status:
Closed
Target version:
-
ruby -v:
3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin19]
[ruby-core:101797]

Description

I was able to boil it down to this script:

require 'bundler/inline'

gemfile do
  source 'https://rubygems.org'
  gem "sinatra", "~> 2.1"
end

require 'sinatra'

class App < Sinatra::Base
  get '/' do
    200
  end
end

module Sinatra
  class Base
    class << self
      # patch it to avoid hitting other unsafe things
      def setup_default_middleware(builder)
        builder.use Rack::NullLogger
      end
    end
  end
end

workers = 2.times.map do
  Ractor.new { App.new }
end

Ractor.select(*workers)

Even though the code doesn't make a lot of sense and Sinatra has other stuff that's not compatible with Ractor, I would not expect user-level Ruby code to segfault.

I have attached the crash report and stderr output.


Files

segfault.dump (44.8 KB) segfault.dump kirs (Kir Shatrov), 12/28/2020 09:22 PM
ruby_2020-12-29-002108_Kirs-MacBook-Pro-2.crash (27.9 KB) ruby_2020-12-29-002108_Kirs-MacBook-Pro-2.crash kirs (Kir Shatrov), 12/28/2020 09:22 PM

Related issues 2 (0 open2 closed)

Related to Ruby master - Bug #17529: Ractor Segfaults with GC enabledClosedko1 (Koichi Sasada)Actions
Is duplicate of Ruby master - Bug #18120: Deadlock and segfault when using autoload in RactorClosedko1 (Koichi Sasada)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0