Project

General

Profile

Actions

Bug #17622

closed

Segfault in new Rails app

Added by peterzhu2118 (Peter Zhu) about 3 years ago. Updated about 3 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:102463]

Description

Pull request on GitHub.

There is a segfault in Ruby master and Ruby 3.0.0, but not present in Ruby 2.7.2. A bisect shows that it's present since commit a53e2850c572135ed657144bc14e47b29c64fa94.

Reproduction

  1. Use Ruby 3.0.0 or Ruby master.

  2. Create a new Rails app (rails new repro).

  3. Add the following script.rb:

    def load_rails
      tp = TracePoint.new(:c_return) do
      end
    
      require './config/application'
      rails = Object.const_get(:Rails)
      rails.application.require_environment!
      rails.application.eager_load!
    end
    
    def foo
      -> do
        load_rails
      end
    end
    
    foo.call
    puts "ok"
    
  4. Run the script with DISABLE_BOOTSNAP=1 ruby script.rb

Expected output

The script should print ok.

Actual output

Crashes with a segfault (check file crash.log for full crash log).


Files

crash.log (218 KB) crash.log peterzhu2118 (Peter Zhu), 02/11/2021 09:23 PM
Actions #1

Updated by peterzhu2118 (Peter Zhu) about 3 years ago

  • Description updated (diff)
Actions #2

Updated by peterzhu2118 (Peter Zhu) about 3 years ago

  • Status changed from Open to Closed

Applied in changeset git|15dbaa0b54f10e43976d594ef987da5f51e0c7c1.


[Fixes #17622] Mark and move the previous ep

Actions #3

Updated by nagachika (Tomoyuki Chikanaga) about 3 years ago

  • Backport changed from 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN to 2.5: DONTNEED, 2.6: DONTNEED, 2.7: DONTNEED, 3.0: REQUIRED

Updated by naruse (Yui NARUSE) about 3 years ago

  • Backport changed from 2.5: DONTNEED, 2.6: DONTNEED, 2.7: DONTNEED, 3.0: REQUIRED to 2.5: DONTNEED, 2.6: DONTNEED, 2.7: DONTNEED, 3.0: DONE

ruby_3_0 5816725ccc9642101d447b0f3b03c14d232aec6a merged revision(s) 15dbaa0b54f10e43976d594ef987da5f51e0c7c1.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0