From: "tenderlovemaking (Aaron Patterson) via ruby-core" <ruby-core@...>
Date: 2023-01-26T16:04:38+00:00
Subject: [ruby-core:112055] [Ruby master Bug#19381] SEGV - ivars, both Ubuntu & Windows

Issue #19381 has been updated by tenderlovemaking (Aaron Patterson).





Thanks.  I'm going to revert the commit for now.  �����������������



----------------------------------------

Bug #19381: SEGV - ivars, both Ubuntu & Windows

https://bugs.ruby-lang.org/issues/19381#change-101490



* Author: MSP-Greg (Greg L)

* Status: Open

* Priority: Normal

* ruby -v: ruby 3.3.0dev (2023-01-26T07:31:08Z master 6422fef90c) [x86_64-linux]

* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN

----------------------------------------

I've used code similar to the below for a long time.  When max is set to 50, it runs.  When max is set to 51, it SEGV faults.



Rubies tested:

ruby 3.3.0dev (2023-01-26T07:31:08Z master 6422fef90c) [x86_64-linux]

ruby 3.3.0dev (2023-01-26T07:31:08Z master 6422fef90c) [x64-mingw-ucrt]

ruby 3.3.0dev (2023-01-26T07:31:08Z master 6422fef90c) [x64-mswin64_140]



I suspect it involves the changes in https://github.com/ruby/ruby/pull/7183 'Limit maximum number of IVs on a shape'





```ruby

module Test

  class << self

    def run

      max = 51

      (1..max).each do |v|

        instance_variable_set("@iv#{v}".to_sym, nil)

      end

    end

  end

end

Test.run

puts Test.instance_variables

```









-- 

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

 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/