ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:102463] [Ruby master Bug#17622] Segfault in new Rails app
@ 2021-02-11 21:26 peter
  2021-03-02  9:27 ` [ruby-core:102705] " naruse
  0 siblings, 1 reply; 2+ messages in thread
From: peter @ 2021-02-11 21:26 UTC (permalink / raw
  To: ruby-core

Issue #17622 has been reported by peterzhu2118 (Peter Zhu).

----------------------------------------
Bug #17622: Segfault in new Rails app
https://bugs.ruby-lang.org/issues/17622

* Author: peterzhu2118 (Peter Zhu)
* Status: Open
* Priority: Normal
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
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](https://github.com/ruby/ruby/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`:

    ```ruby
    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)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [ruby-core:102705] [Ruby master Bug#17622] Segfault in new Rails app
  2021-02-11 21:26 [ruby-core:102463] [Ruby master Bug#17622] Segfault in new Rails app peter
@ 2021-03-02  9:27 ` naruse
  0 siblings, 0 replies; 2+ messages in thread
From: naruse @ 2021-03-02  9:27 UTC (permalink / raw
  To: ruby-core

Issue #17622 has been updated by naruse (Yui NARUSE).

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.

----------------------------------------
Bug #17622: Segfault in new Rails app
https://bugs.ruby-lang.org/issues/17622#change-90699

* Author: peterzhu2118 (Peter Zhu)
* Status: Closed
* Priority: Normal
* Backport: 2.5: DONTNEED, 2.6: DONTNEED, 2.7: DONTNEED, 3.0: DONE
----------------------------------------
[Pull request on GitHub](https://github.com/ruby/ruby/pull/4175).

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](https://github.com/ruby/ruby/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`:

    ```ruby
    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)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-02  9:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-11 21:26 [ruby-core:102463] [Ruby master Bug#17622] Segfault in new Rails app peter
2021-03-02  9:27 ` [ruby-core:102705] " naruse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).