| Age | Commit message (Collapse) | Author |
|
This fixes a bug where the gen_fields_cache could become invalid when
the last ivar was removed. Also adds more assertions.
|
|
This reverts commit 26a9e0b4e31f7b5a9cbd755e0a15823a8fa51bae partially.
|
|
|
|
|
|
[Bug #21694]
`vm_search_super_method` explictly calls `vm_cc_new` with `cme=NULL`
when there is no super class.
|
|
[Bug #21703]
RUBY_CRASH_REPORT does not work in some cases when shelling out on Linux.
For example, given the following shell script dump.sh:
#!/usr/bin/env bash
cat > /tmp/crash
And we see it fails like this:
$ RUBY_CRASH_REPORT="|dump.sh" ruby -rfiddle -e "Fiddle::Pointer.new(1, 10)[0]"
cat: -: Resource temporarily unavailable
|
|
- Buffer's size did not account for offset when mapping the file, leading to possible crashes.
- Size and offset were not checked properly, leading to many situations raising EINVAL errors with generic messages.
- Documentation was wrong.
|
|
definition is used
|
|
|
|
|
|
|
|
For subclasses from Set, require `set/subclass_compatible`, and
extend the subclass and include a module in it that makes it more
backwards compatible with the pure Ruby Set implementation used
before Ruby 4.
The module included in the subclass contains a near-copy of the
previous Set implementation, with the following changes:
* Accesses to `@hash` are generally replaced with `super` calls. In
some cases, they are replaced with a call to another instance method.
* Some methods that only accessed `@hash` and nothing else are not
defined, so they inherit behavior from core Set.
* The previous `Set#divide` implementation is not used, to avoid
depending on tsort.
This fixes the following two issues:
* [Bug #21375] Set[] does not call #initialize
* [Bug #21396] Set#initialize should call Set#add on items passed in
It should also fix the vast majority of backwards compatibility issues
in other cases where code subclassed Set and depended on implementation
details (such as which methods call which other methods).
This does not affect Set internals, so Set itself remains fast. For
users who want to subclass Set but do not need to worry about
backwards compatibility, they can subclass from Set::CoreSet, a Set
subclass that does not have the backward compatibility layer included.
|
|
[Feature #20408]
|
|
[Feature #20408]
|
|
[Feature #20408]
|
|
Previously any T_OBJECT with >= 94 IVARs would crash during compaction
attempting to make an object too large to embed.
|
|
* Add Insn::StoreField and Insn::WriteBarrier
|
|
This implements Shopify#854:
- Splits boot-time and enable-time initialization,
tracks progress with `InitializationState` enum
- Introduces `RubyVM::ZJIT.enable` Ruby method for
enabling the JIT lazily, if not already enabled
- Introduces `--zjit-disable` flag, which can be
used alongside the other `--zjit-*` flags but
prevents enabling the JIT at boot time
- Adds ZJIT infra to support JIT hooks, but this
is not currently exercised (Shopify/ruby#667)
Left for future enhancements:
- Support kwargs for overriding the CLI flags in
`RubyVM::ZJIT.enable`
Closes Shopify#854
|
|
When there are nested capture variables inside of a pattern match
that has an alternation pattern, it is a syntax error. Currently it
only adds a syntax error when it is at the top level of the pattern.
|
|
|
|
Should fail even with `-c` option.
|
|
https://www.unicode.org/Public/emoji/ReadMe.txt
> This directory contains data files for versions 1.0 to 16.0 of Unicode Emoji.
> Starting with Unicode 17.0.0, the data files for Unicode Emoji are published in
> https://www.unicode.org/Public/<version>/emoji/
> together with the related files in
> https://www.unicode.org/Public/<version>/ucd/emoji/
|
|
These two class are most common sources of infinite sequences. This change should effectively prevent accidental infinite loops when calling to_set on them. [Bug #21513]
|
|
This reverts commit d4020dd5faf28486123853e7f00c36139fc07793, which introduced performance regression for objects like ActiveRecord::Relation by calling the costly #size method on them.
|
|
|
|
Fix wrong condition in base multiplying loop.
|
|
assert_ractor() runs in a subprocess.
|
|
|
|
Co-authored-by: Randy Stauner <randy@r4s6.net>
|
|
The crash was fixed by a4dff09be79b52288a47658964d25e5aa84fc960 ("Fix
resolving refined module-defined method"). I had a patch for this around
for a few months but never merged it. Oops!
|
|
This reverts commit 2998c8d6b99ec49925ebea42198b29c3e27b34a7.
We need to find a better way to fix this bug. Even with this refcount
change, errors were still being seen in CI. For now we need to remove
this failing test.
|
|
A method defined in a module has no `defined_class`, use the ICLASS
for it as the `defined_class`.
|
|
[Bug #21671]
|
|
|
|
|
|
|
|
|
|
|
|
We were seeing errors like:
```
* thread #8, stop reason = EXC_BAD_ACCESS (code=1, address=0x803)
* frame #0: 0x00000001001fe944 ruby`rb_st_lookup(tab=0x00000000000007fb, key=1, value=0x00000001305b7490) at st.c:1066:22
frame #1: 0x000000010002d658 ruby`remove_class_from_subclasses [inlined] class_get_subclasses_for_ns(tbl=0x00000000000007fb, ns_id=1) at class.c:604:9
frame #2: 0x000000010002d650 ruby`remove_class_from_subclasses(tbl=0x00000000000007fb, ns_id=1, klass=4754039232) at class.c:620:34
frame #3: 0x000000010002c8a8 ruby`rb_class_classext_free_subclasses(ext=0x000000011b5ce1d8, klass=4754039232, replacing=<unavailable>) at class.c:700:9
frame #4: 0x000000010002c760 ruby`rb_class_classext_free(klass=4754039232, ext=0x000000011b5ce1d8, is_prime=true) at class.c:105:5
frame #5: 0x00000001000e770c ruby`classext_free(ext=<unavailable>, is_prime=<unavailable>, namespace=<unavailable>, arg=<unavailable>) at gc.c:1231:5 [artificial]
frame #6: 0x000000010002d178 ruby`rb_class_classext_foreach(klass=<unavailable>, func=(ruby`classext_free at gc.c:1228), arg=0x00000001305b75c0) at class.c:518:5
frame #7: 0x00000001000e745c ruby`rb_gc_obj_free(objspace=0x000000012500c400, obj=4754039232) at gc.c:1282:9
frame #8: 0x00000001000e70d4 ruby`gc_sweep_plane(objspace=0x000000012500c400, heap=<unavailable>, p=4754039232, bitset=4095, ctx=0x00000001305b76e8) at default.c:3482:21
frame #9: 0x00000001000e6e9c ruby`gc_sweep_page(objspace=0x000000012500c400, heap=0x000000012500c540, ctx=0x00000001305b76e8) at default.c:3567:13
frame #10: 0x00000001000e51d0 ruby`gc_sweep_step(objspace=0x000000012500c400, heap=0x000000012500c540) at default.c:3848:9
frame #11: 0x00000001000e1880 ruby`gc_continue [inlined] gc_sweep_continue(objspace=0x000000012500c400, sweep_heap=0x000000012500c540) at default.c:3931:13
frame #12: 0x00000001000e1754 ruby`gc_continue(objspace=0x000000012500c400, heap=0x000000012500c540) at default.c:2037:9
frame #13: 0x00000001000e10bc ruby`newobj_cache_miss [inlined] heap_prepare(objspace=0x000000012500c400, heap=0x000000012500c540) at default.c:2056:5
frame #14: 0x00000001000e1074 ruby`newobj_cache_miss [inlined] heap_next_free_page(objspace=0x000000012500c400, heap=0x000000012500c540) at default.c:2280:9
frame #15: 0x00000001000e106c ruby`newobj_cache_miss(objspace=0x000000012500c400, cache=0x0000600001b00300, heap_idx=2, vm_locked=false) at default.c:2387:38
frame #16: 0x00000001000e0d28 ruby`newobj_alloc(objspace=<unavailable>, cache=<unavailable>, heap_idx=<unavailable>, vm_locked=<unavailable>) at default.c:2411:15 [artificial]
frame #17: 0x00000001000d7214 ruby`newobj_of [inlined] rb_gc_impl_new_obj(objspace_ptr=<unavailable>, cache_ptr=<unavailable>, klass=<unavailable>, flags=<unavailable>, wb_protected=<unavailable>, alloc_size=<unavailable>) at default.c:2490:15
frame #18: 0x00000001000d719c ruby`newobj_of(cr=<unavailable>, klass=4313971728, flags=258, wb_protected=<unavailable>, size=<unavailable>) at gc.c:995:17
frame #19: 0x00000001000d73ec ruby`rb_wb_protected_newobj_of(ec=<unavailable>, klass=<unavailable>, flags=<unavailable>, size=<unavailable>) at gc.c:1044:12 [artificial]
frame #20: 0x0000000100032d34 ruby`class_alloc0(type=<unavailable>, klass=4313971728, namespaceable=<unavailable>) at class.c:803:5
```
|
|
https://github.com/ruby/ruby/actions/runs/19111531630/job/54609629054
|
|
|
|
We shouldn't run any ruby code with the VM lock held.
|
|
Inline the `String#bytesize` function and remove the C call.
|
|
These just call to the C functions that do the optimized test but this avoids the side exit.
See https://github.com/ruby/ruby/pull/12123 for the original CRuby/YJIT implementation.
|
|
|
|
|
|
|
|
Classes/modules defined in a namespace are defined under ::Object
as usual (as without namespaces), and it'll be set into the const_tbl
of ::Object.
In namespaces, namespace objects' const_tbl is equal to the one of ::Object.
So constants of ::Object are just equal to constants of the namespace.
That means, top level classes/modules in a namespace can be referred
as namespace::KlassName without calling rb_define_class_under_id().
|
|
|
|
The following script leaks memory:
10.times do
100_000.times do
"\ufffd".encode(Encoding::US_ASCII, fallback: proc { Object.new })
rescue
end
puts `ps -o rss= -p #{$$}`
end
Before:
450244
887748
1325124
1762756
2200260
2637508
3075012
3512516
3950020
4387524
After:
12236
12364
12748
13004
13388
13516
13772
13772
13772
13772
|