<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/load.c, branch v3_3_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>merge revision(s) 7ae67e8f6ad6e7fd0677b28a7a10961f79d55495: [Backport #21568]</title>
<updated>2025-10-11T08:01:06+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2025-10-11T08:01:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=27a1df7506ba566d08a536e93910fff574cd6d56'/>
<id>27a1df7506ba566d08a536e93910fff574cd6d56</id>
<content type='text'>
	[PATCH] load.c: Fix dest and src of MEMMOVE

	When multiple files with the same name are required, the features_index
	hash stores the indexes in `$LOADED_FEATURES` array into a darray.
	The dest and src arguments for `MEMMOVE` were wrongly reversed when
	inserting a new index in the darray.

	[Bug #21568]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[PATCH] load.c: Fix dest and src of MEMMOVE

	When multiple files with the same name are required, the features_index
	hash stores the indexes in `$LOADED_FEATURES` array into a darray.
	The dest and src arguments for `MEMMOVE` were wrongly reversed when
	inserting a new index in the darray.

	[Bug #21568]
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 43dbb9a93f4de3f1170d7d18641c30e81cc08365, 2bb6fe3854e2a4854bb89bfce4eaaea9d848fd1b, 7c9dd0ecff61153b96473c6c51d5582e809da489: [Backport #21629]</title>
<updated>2025-10-08T13:56:02+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2025-10-08T13:55:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5a8d7642168f4ea0d9331fded3033c225bbc36c5'/>
<id>5a8d7642168f4ea0d9331fded3033c225bbc36c5</id>
<content type='text'>
	[PATCH] [Bug #21629] Enable `nonstring` attribute on clang 21

	[PATCH] [Bug #21629] Initialize `struct RString`

	[PATCH] [Bug #21629] Initialize `struct RArray`
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[PATCH] [Bug #21629] Enable `nonstring` attribute on clang 21

	[PATCH] [Bug #21629] Initialize `struct RString`

	[PATCH] [Bug #21629] Initialize `struct RArray`
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 928fea3bfa86053c0bc6f7a5bf7559b115a676b5: [Backport #21567]</title>
<updated>2025-09-14T04:47:35+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2025-09-14T04:47:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=01b0beb818e74c290fdf8fcc824946fd8c93b373'/>
<id>01b0beb818e74c290fdf8fcc824946fd8c93b373</id>
<content type='text'>
	Fix crash when $LOADED_FEATURES is modified during require

	[Bug #21567]

	When we require an object that is not a string, it will attempt to convert
	it to a string by calling to_str on it. If we modify the $LOADED_FEATURES
	array while it calls to_str, Ruby can crash because it can end up inserting
	the string in the wrong index in the array.

	For example, the following script crashes:

	    require "tempfile"

	    class MyString
	      def initialize(path)
	        @path = path
	      end

	      def to_str
	        $LOADED_FEATURES.clear
	        @path
	      end

	      def to_path = @path
	    end

	    def create_ruby_file = Tempfile.create(["test", ".rb"]).path

	    require MyString.new(create_ruby_file)
	    $LOADED_FEATURES.unshift(create_ruby_file)
	    $LOADED_FEATURES &lt;&lt; MyString.new(create_ruby_file)
	    require create_ruby_file

	Crash log:

	    test.rb:21: [BUG] Segmentation fault at 0x0000000000000004
	    ruby 3.5.0dev (2025-09-09T09:29:35Z master ce94add7fb) +PRISM [arm64-darwin24]

	    -- Crash Report log information --------------------------------------------
	      See Crash Report log file in one of the following locations:
	        * ~/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:0003 p:---- s:0011 e:000010 CFUNC  :require
	    c:0002 p:0076 s:0006 e:000005 EVAL   test.rb:21 [FINISH]
	    c:0001 p:0000 s:0003 E:0001b0 DUMMY  [FINISH]

	    -- Ruby level backtrace information ----------------------------------------
	    test.rb:21:in '&lt;main&gt;'
	    test.rb:21:in 'require'

	    -- Threading information ---------------------------------------------------
	    Total ractor count: 1
	    Ruby thread count for this ractor: 1

	    -- Machine register context ------------------------------------------------
	      x0: 0x0000000000000004  x1: 0x000000000000c800  x2: 0x0000000000000000
	      x3: 0x0000000000000000  x4: 0x0000000000000205  x5: 0x0000000000000000
	      x6: 0x0000000000000000  x7: 0x0000000000000001 x18: 0x0000000000000000
	    x19: 0x0000000209dfc0b0 x20: 0x0000000209dfc018 x21: 0x000000016ee8ab58
	    x22: 0x0fffffff0009d71d x23: 0x0000000209dfc018 x24: 0x0000000209dfc150
	    x25: 0x000000016ee8acc0 x26: 0x0000000000000000 x27: 0x0000000000000000
	    x28: 0x0000000000000000  lr: 0x0000000101244140  fp: 0x000000016ee887f0
	      sp: 0x000000016ee887d0

	    -- C level backtrace information -------------------------------------------
	    miniruby(rb_print_backtrace+0x24) [0x101317b08] vm_dump.c:843
	    miniruby(rb_print_backtrace) (null):0
	    miniruby(rb_vm_bugreport+0x26c) [0x101317d94] vm_dump.c:1175
	    miniruby(rb_bug_for_fatal_signal+0xa4) [0x10105ddac] error.c:1130
	    miniruby(sig_do_nothing+0x0) [0x1012278c0] signal.c:948
	    miniruby(sigsegv) (null):0
	    /usr/lib/system/libsystem_platform.dylib(_sigtramp+0x38) [0x19c1216a4]
	    miniruby(rb_str_new_frozen+0x1c) [0x101244140] string.c:1495
	    miniruby(rb_check_realpath_internal+0x68) [0x101077804] file.c:4679
	    miniruby(rb_check_realpath+0x2c) [0x101077aa4] file.c:4765
	    miniruby(get_loaded_features_index+0x37c) [0x1010f9c94] load.c:467
	    miniruby(rb_feature_p+0xd0) [0x1010f8174] load.c:582
	    miniruby(search_required+0xac) [0x1010f6ad4] load.c:1193
	    miniruby(require_internal+0x274) [0x1010f7518] load.c:1424
	    miniruby(rb_require_string_internal+0x94) [0x1010f6830] load.c:1571
	    miniruby(rb_require_string+0x58) [0x1010f66e8] load.c:1557
	    miniruby(rb_f_require+0x1c) [0x1010f6684] load.c:1150
	    miniruby(ractor_safe_call_cfunc_1+0x38) [0x101306c28] vm_insnhelper.c:3696
	    miniruby(vm_call_cfunc_with_frame_+0x250) [0x1012f857c] vm_insnhelper.c:3873
	    miniruby(vm_call_cfunc_with_frame+0x6c) [0x1012f8834] vm_insnhelper.c:3919
	    miniruby(vm_sendish+0x1a8) [0x1012c990c] vm_insnhelper.c:6087
	    miniruby(vm_exec_core+0x4050) [0x1012cfb48] insns.def:900
	    miniruby(vm_exec_loop+0x80) [0x1012e5448] vm.c:2666
	    miniruby(rb_vm_exec+0x134) [0x1012c9b40] vm.c:2645
	    miniruby(rb_iseq_eval_main+0x34) [0x1012e5628] vm.c:2919
	    miniruby(rb_ec_exec_node+0xe4) [0x10106d094] eval.c:282
	    miniruby(ruby_run_node+0x94) [0x10106cf64] eval.c:320
	    miniruby(rb_main+0x40) [0x100f7499c] main.c:42
	    miniruby(main+0x60) [0x100f74928] main.c:62
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Fix crash when $LOADED_FEATURES is modified during require

	[Bug #21567]

	When we require an object that is not a string, it will attempt to convert
	it to a string by calling to_str on it. If we modify the $LOADED_FEATURES
	array while it calls to_str, Ruby can crash because it can end up inserting
	the string in the wrong index in the array.

	For example, the following script crashes:

	    require "tempfile"

	    class MyString
	      def initialize(path)
	        @path = path
	      end

	      def to_str
	        $LOADED_FEATURES.clear
	        @path
	      end

	      def to_path = @path
	    end

	    def create_ruby_file = Tempfile.create(["test", ".rb"]).path

	    require MyString.new(create_ruby_file)
	    $LOADED_FEATURES.unshift(create_ruby_file)
	    $LOADED_FEATURES &lt;&lt; MyString.new(create_ruby_file)
	    require create_ruby_file

	Crash log:

	    test.rb:21: [BUG] Segmentation fault at 0x0000000000000004
	    ruby 3.5.0dev (2025-09-09T09:29:35Z master ce94add7fb) +PRISM [arm64-darwin24]

	    -- Crash Report log information --------------------------------------------
	      See Crash Report log file in one of the following locations:
	        * ~/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:0003 p:---- s:0011 e:000010 CFUNC  :require
	    c:0002 p:0076 s:0006 e:000005 EVAL   test.rb:21 [FINISH]
	    c:0001 p:0000 s:0003 E:0001b0 DUMMY  [FINISH]

	    -- Ruby level backtrace information ----------------------------------------
	    test.rb:21:in '&lt;main&gt;'
	    test.rb:21:in 'require'

	    -- Threading information ---------------------------------------------------
	    Total ractor count: 1
	    Ruby thread count for this ractor: 1

	    -- Machine register context ------------------------------------------------
	      x0: 0x0000000000000004  x1: 0x000000000000c800  x2: 0x0000000000000000
	      x3: 0x0000000000000000  x4: 0x0000000000000205  x5: 0x0000000000000000
	      x6: 0x0000000000000000  x7: 0x0000000000000001 x18: 0x0000000000000000
	    x19: 0x0000000209dfc0b0 x20: 0x0000000209dfc018 x21: 0x000000016ee8ab58
	    x22: 0x0fffffff0009d71d x23: 0x0000000209dfc018 x24: 0x0000000209dfc150
	    x25: 0x000000016ee8acc0 x26: 0x0000000000000000 x27: 0x0000000000000000
	    x28: 0x0000000000000000  lr: 0x0000000101244140  fp: 0x000000016ee887f0
	      sp: 0x000000016ee887d0

	    -- C level backtrace information -------------------------------------------
	    miniruby(rb_print_backtrace+0x24) [0x101317b08] vm_dump.c:843
	    miniruby(rb_print_backtrace) (null):0
	    miniruby(rb_vm_bugreport+0x26c) [0x101317d94] vm_dump.c:1175
	    miniruby(rb_bug_for_fatal_signal+0xa4) [0x10105ddac] error.c:1130
	    miniruby(sig_do_nothing+0x0) [0x1012278c0] signal.c:948
	    miniruby(sigsegv) (null):0
	    /usr/lib/system/libsystem_platform.dylib(_sigtramp+0x38) [0x19c1216a4]
	    miniruby(rb_str_new_frozen+0x1c) [0x101244140] string.c:1495
	    miniruby(rb_check_realpath_internal+0x68) [0x101077804] file.c:4679
	    miniruby(rb_check_realpath+0x2c) [0x101077aa4] file.c:4765
	    miniruby(get_loaded_features_index+0x37c) [0x1010f9c94] load.c:467
	    miniruby(rb_feature_p+0xd0) [0x1010f8174] load.c:582
	    miniruby(search_required+0xac) [0x1010f6ad4] load.c:1193
	    miniruby(require_internal+0x274) [0x1010f7518] load.c:1424
	    miniruby(rb_require_string_internal+0x94) [0x1010f6830] load.c:1571
	    miniruby(rb_require_string+0x58) [0x1010f66e8] load.c:1557
	    miniruby(rb_f_require+0x1c) [0x1010f6684] load.c:1150
	    miniruby(ractor_safe_call_cfunc_1+0x38) [0x101306c28] vm_insnhelper.c:3696
	    miniruby(vm_call_cfunc_with_frame_+0x250) [0x1012f857c] vm_insnhelper.c:3873
	    miniruby(vm_call_cfunc_with_frame+0x6c) [0x1012f8834] vm_insnhelper.c:3919
	    miniruby(vm_sendish+0x1a8) [0x1012c990c] vm_insnhelper.c:6087
	    miniruby(vm_exec_core+0x4050) [0x1012cfb48] insns.def:900
	    miniruby(vm_exec_loop+0x80) [0x1012e5448] vm.c:2666
	    miniruby(rb_vm_exec+0x134) [0x1012c9b40] vm.c:2645
	    miniruby(rb_iseq_eval_main+0x34) [0x1012e5628] vm.c:2919
	    miniruby(rb_ec_exec_node+0xe4) [0x10106d094] eval.c:282
	    miniruby(ruby_run_node+0x94) [0x10106cf64] eval.c:320
	    miniruby(rb_main+0x40) [0x100f7499c] main.c:42
	    miniruby(main+0x60) [0x100f74928] main.c:62
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) d4a1a2780c39bc648496ac92fc6e6ce2eb38ab47: [Backport #21032]</title>
<updated>2025-03-08T08:26:28+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2025-03-08T08:26:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=54dd27d89d2e6814114f1aff18836a987d5a4ab1'/>
<id>54dd27d89d2e6814114f1aff18836a987d5a4ab1</id>
<content type='text'>
	rb_feature_p: skip `get_expanded_load_path` for absolute paths

	Ref: https://github.com/fxn/zeitwerk/pull/308

	```ruby
	require 'benchmark'

	$LOAD_PATH &lt;&lt; 'relative-path'

	autoload :FOO, '/tmp/foo.rb'

	puts Benchmark.realtime {
	  500_000.times do
	    Object.autoload?(:FOO)
	  end
	}
	```

	The above script takes 2.5 seconds on `master`, and only
	50ms on this branch.

	When we're looking for a feature with an absolute path, we don't
	need to call the expensive `get_expanded_load_path`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	rb_feature_p: skip `get_expanded_load_path` for absolute paths

	Ref: https://github.com/fxn/zeitwerk/pull/308

	```ruby
	require 'benchmark'

	$LOAD_PATH &lt;&lt; 'relative-path'

	autoload :FOO, '/tmp/foo.rb'

	puts Benchmark.realtime {
	  500_000.times do
	    Object.autoload?(:FOO)
	  end
	}
	```

	The above script takes 2.5 seconds on `master`, and only
	50ms on this branch.

	When we're looking for a feature with an absolute path, we don't
	need to call the expensive `get_expanded_load_path`.
</pre>
</div>
</content>
</entry>
<entry>
<title>Adjust styles [ci skip]</title>
<updated>2023-12-16T15:21:00+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-12-16T15:21:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2f595c744e10f7d5222c477efd50fe168fe9d47e'/>
<id>2f595c744e10f7d5222c477efd50fe168fe9d47e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Introduce --parser runtime flag</title>
<updated>2023-12-15T18:42:19+00:00</updated>
<author>
<name>HParker</name>
<email>HParker@github.com</email>
</author>
<published>2023-12-07T23:47:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=55326a915f25608be1d40ab32baa9fc57762615d'/>
<id>55326a915f25608be1d40ab32baa9fc57762615d</id>
<content type='text'>
Introduce runtime flag for specifying the parser,

```
ruby --parser=prism
```

also update the description:

```
$ ruby --parser=prism --version
ruby 3.3.0dev (2023-12-08T04:47:14Z add-parser-runtime.. 0616384c9f) +PRISM [x86_64-darwin23]
```

[Bug #20044]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introduce runtime flag for specifying the parser,

```
ruby --parser=prism
```

also update the description:

```
$ ruby --parser=prism --version
ruby 3.3.0dev (2023-12-08T04:47:14Z add-parser-runtime.. 0616384c9f) +PRISM [x86_64-darwin23]
```

[Bug #20044]
</pre>
</div>
</content>
</entry>
<entry>
<title>rb_ext_resolve_symbol: C API to resolve and return externed symbols [Feature #20005]</title>
<updated>2023-12-14T08:39:42+00:00</updated>
<author>
<name>Satoshi Tagomori</name>
<email>tagomoris@gmail.com</email>
</author>
<published>2023-12-08T06:06:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e51f9e9f75cc1dde9234836fa92077d71b3c5141'/>
<id>e51f9e9f75cc1dde9234836fa92077d71b3c5141</id>
<content type='text'>
This is a C API for extensions to resolve and get function symbols of other extensions.
Extensions can check the expected symbol is correctly loaded and accessible, and
use it if it is available.
Otherwise, extensions can raise their own error to guide users to setup their
environments correctly and what's missing.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a C API for extensions to resolve and get function symbols of other extensions.
Extensions can check the expected symbol is correctly loaded and accessible, and
use it if it is available.
Otherwise, extensions can raise their own error to guide users to setup their
environments correctly and what's missing.
</pre>
</div>
</content>
</entry>
<entry>
<title>[DOC] Update description about shared library suffix</title>
<updated>2023-12-12T00:39:13+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-12-12T00:39:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=38348502b5429703e418cf4634e405ce77fd4bbc'/>
<id>38348502b5429703e418cf4634e405ce77fd4bbc</id>
<content type='text'>
Loading an extension library with ".dll" suffix on Windows was very
old behavior, and the suffix must be ".so" since 2004.  See commits
removing DLEXT2 181a3a2af5df88d145b73a060d51fe437c8c4ad4 and
b76ad15ed0da636161de0243c547ee1e6fc95681.

Instead, use macOS as an example, which uses ".bundle".
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Loading an extension library with ".dll" suffix on Windows was very
old behavior, and the suffix must be ".so" since 2004.  See commits
removing DLEXT2 181a3a2af5df88d145b73a060d51fe437c8c4ad4 and
b76ad15ed0da636161de0243c547ee1e6fc95681.

Instead, use macOS as an example, which uses ".bundle".
</pre>
</div>
</content>
</entry>
<entry>
<title>[DOC] Fix RDoc to match actual Kenrel.require behavior (#9180)</title>
<updated>2023-12-11T22:13:54+00:00</updated>
<author>
<name>hogelog</name>
<email>konbu.komuro@gmail.com</email>
</author>
<published>2023-12-11T22:13:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4a94ce8569c9399bd286d943ff35f6f3a25ed1b6'/>
<id>4a94ce8569c9399bd286d943ff35f6f3a25ed1b6</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Free everything at shutdown</title>
<updated>2023-12-07T20:52:35+00:00</updated>
<author>
<name>Adam Hess</name>
<email>adamhess1991@gmail.com</email>
</author>
<published>2023-10-12T18:15:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6816e8efcff3be75f8020cd1b0ea57d3cd664bbc'/>
<id>6816e8efcff3be75f8020cd1b0ea57d3cd664bbc</id>
<content type='text'>
when the RUBY_FREE_ON_SHUTDOWN environment variable is set, manually free memory at shutdown.

Co-authored-by: Nobuyoshi Nakada &lt;nobu@ruby-lang.org&gt;
Co-authored-by: Peter Zhu &lt;peter@peterzhu.ca&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
when the RUBY_FREE_ON_SHUTDOWN environment variable is set, manually free memory at shutdown.

Co-authored-by: Nobuyoshi Nakada &lt;nobu@ruby-lang.org&gt;
Co-authored-by: Peter Zhu &lt;peter@peterzhu.ca&gt;
</pre>
</div>
</content>
</entry>
</feed>
