83249 Commits

Author SHA1 Message Date
Hiroshi SHIBATA
99c2c703da Extract resolv-replace 2024-01-19 17:44:58 +09:00
git
9ac316bb48 Update bundled gems list at 11ec59c92bab5346fc0fdce9d8ed2a [ci skip] 2024-01-19 07:28:30 +00:00
Hiroshi SHIBATA
11ec59c92b Removed sync task for abbrev 2024-01-19 16:27:45 +09:00
Hiroshi SHIBATA
e28bdff941 Document about abbrev at Ruby 3.4 2024-01-19 16:27:45 +09:00
Hiroshi SHIBATA
f4670b46c4 spec/mspec/tool/wrap_with_guard.rb 'ruby_version_is ""..."3.4"' spec/ruby/library/abbrev/**/*.rb 2024-01-19 16:27:45 +09:00
Hiroshi SHIBATA
b4ee5266f1 Extract abbrev as bundled gems 2024-01-19 16:27:45 +09:00
Hiroshi SHIBATA
d3898e9752
Removed sync task for observer 2024-01-19 15:56:55 +09:00
git
e8cb9e1328 Update bundled gems list as of 2024-01-18 2024-01-19 06:35:57 +00:00
Hiroshi SHIBATA
fb5722c09a Document about observer at Ruby 3.4 2024-01-19 15:24:09 +09:00
Hiroshi SHIBATA
8b551b0e7a spec/mspec/tool/wrap_with_guard.rb 'ruby_version_is ""..."3.4"' spec/ruby/library/observer/**/*.rb 2024-01-19 15:24:09 +09:00
Hiroshi SHIBATA
176a442883 Extract observer as bundled gems 2024-01-19 15:24:09 +09:00
Hiroshi SHIBATA
68b403c45a
Fixed inconsistent library name 2024-01-19 14:01:30 +09:00
Hiroshi SHIBATA
385a1b15ef
Fixed upstream URL at bundled gems 2024-01-19 14:00:08 +09:00
Hiroshi SHIBATA
54552b89e7
Revert "[rubygems/rubygems] Fix require of a default gem when unresolved gems depend on it"
This reverts commit f1f5f22d22a149f20e019728b1ab35593d29d81a.
2024-01-19 12:12:33 +09:00
Hiroshi SHIBATA
04cf66765a
Revert "[rubygems/rubygems] Fix activation conflicts when circularly requiring a gem"
This reverts commit db44088c2a92040879386aa5f268db4c858e4e5b.

  https://github.com/ruby/ruby/actions/runs/7578672002/job/20641640821
  https://github.com/ruby/ruby/actions/runs/7578672002/job/20641641212
  https://github.com/ruby/ruby/actions/runs/7578672002/job/20641642031
2024-01-19 11:54:17 +09:00
dependabot[bot]
7265a5be01 Bump actions/upload-artifact from 4.1.0 to 4.2.0
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.1.0 to 4.2.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](1eb3cb2b3e...694cdabd8b)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-18 18:44:42 -08:00
David Rodríguez
a8fa28ab80
Bump uri version used in development 2024-01-19 11:29:55 +09:00
David Rodríguez
db44088c2a [rubygems/rubygems] Fix activation conflicts when circularly requiring a gem
If a gem is required circular, and there are unresolved specs depending
on it, we may end up in an activation conflict.

The solution is to not try to activate unresolved gems when requiring a
default gem, regardless of it having already been activated or not.

https://github.com/rubygems/rubygems/commit/3b2b8f4e3e
2024-01-19 11:28:11 +09:00
David Rodríguez
f1f5f22d22 [rubygems/rubygems] Fix require of a default gem when unresolved gems depend on it
The following conditions must be met:

* A default gem is required.
* A previous require left some gems unresolved, and those dependencies
  themselves depend on the default gem.

In this case, rubygems require will first activate the default version
of the gem, then try to activate another unresolved version of the
default gem that conflicts with the first activation.

The solution is, if we are in the middle of requiring a default gem,
skip this step, because we have already activated it successfully.

https://github.com/rubygems/rubygems/commit/8cd5608db5

Co-authored-by: Stan Hu <stanhu@gmail.com>
2024-01-19 11:28:11 +09:00
David Rodríguez
8044e57907 [rubygems/rubygems] Add a comment to explain default gem activation
https://github.com/rubygems/rubygems/commit/291128268f
2024-01-19 11:28:10 +09:00
git
74e5665ec1 Update default gems list at b2ec4308d69a13f3ff3b1b3128d52b [ci skip] 2024-01-19 02:16:35 +00:00
Stan Lo
b2ec4308d6
[ruby/irb] Bump version to v1.11.1
(https://github.com/ruby/irb/pull/837)

https://github.com/ruby/irb/commit/f052097c4b
2024-01-19 10:49:12 +09:00
NAITOH Jun
91f3530580
[ruby/strscan] Add test to check encoding for empty string
(https://github.com/ruby/strscan/pull/80)

See: https://github.com/ruby/strscan/issues/78#issuecomment-1890849891

https://github.com/ruby/strscan/commit/d0508518a9
2024-01-19 10:49:12 +09:00
Sutou Kouhei
ac636f5709
[ruby/strscan] Bump version
https://github.com/ruby/strscan/commit/d6f97ec102
2024-01-19 10:49:12 +09:00
David Rodríguez
4e47671073
[rubygems/rubygems] Test that regular gems don't shadow default gems
https://github.com/rubygems/rubygems/commit/b8ca5950a6
2024-01-19 10:49:12 +09:00
Alan Wu
7b253cfea4 RJIT: Properly reject keyword splat with yield
See the fix for YJIT.
2024-01-18 20:22:40 -05:00
Alan Wu
bbd249e351 YJIT: Properly reject keyword splat with yield
We don't have support for keyword splat anywhere, but we tried to
compile these anyways in case of `invokeblock`. This led to bad things
happening such as passing the wrong value and passing a hash into
rb_yjit_array_len(), which raised in the middle of compilation.

[Bug #20192]
2024-01-18 20:22:40 -05:00
KJ Tsanaktsidis
61da90c1b8 Mark asan fake stacks during machine stack marking
ASAN leaves a pointer to the fake frame on the stack; we can use the
__asan_addr_is_in_fake_stack API to work out the extent of the fake
stack and thus mark any VALUEs contained therein.

[Bug #20001]
2024-01-19 09:55:12 +11:00
KJ Tsanaktsidis
3cfcb45ecf Define special macros for asan/msan being enabled
__has_feature is a clang-ism, and GCC has a different way to tell if
sanitizers are enabled. For this reason, I don't want to spray
__has_feature all over the codebase for other places where conditional
compilation based on sanitizers is required.

[Bug #20001]
2024-01-19 09:55:12 +11:00
KJ Tsanaktsidis
cabdaebc70 Make stack bounds detection work with ASAN
Where a local variable is used as part of the stack bounds detection, it
has to actually be on the stack. ASAN can put local variable on "fake
stacks", however, with addresses in different memory mappings. This
completely destroys the stack bounds calculation, and can lead to e.g.
things not getting GC marked on the machine stack or stackoverflow
checks that always fail.

The __asan_addr_is_in_fake_stack helper can be used to get the _real_
stack address of such variables, and thus perform the stack size
calculation properly

[Bug #20001]
2024-01-19 09:55:12 +11:00
KJ Tsanaktsidis
807714447e Pass down "stack start" variables from closer to the top of the stack
This commit changes how stack extents are calculated for both the main
thread and other threads. Ruby uses the address of a local variable as
part of the calculation for machine stack extents:

* pthreads uses it as a lower-bound on the start of the stack, because
  glibc (and maybe other libcs) can store its own data on the stack
  before calling into user code on thread creation.
* win32 uses it as an argument to VirtualQuery, which gets the extent of
  the memory mapping which contains the variable

However, the local being used for this is actually too low (too close to
the leaf function call) in both the main thread case and the new thread
case.

In the main thread case, we have the `INIT_STACK` macro, which is used
for pthreads to set the `native_main_thread->stack_start` value. This
value is correctly captured at the very top level of the program (in
main.c). However, this is _not_ what's used to set the execution context
machine stack (`th->ec->machine_stack.stack_start`); that gets set as
part of a call to `ruby_thread_init_stack` in `Init_BareVM`, using the
address of a local variable allocated _inside_ `Init_BareVM`. This is
too low; we need to use a local allocated closer to the top of the
program.

In the new thread case, the lolcal is allocated inside
`native_thread_init_stack`, which is, again, too low.

In both cases, this means that we might have VALUEs lying outside the
bounds of `th->ec->machine.stack_{start,end}`, which won't be marked
correctly by the GC machinery.

To fix this,

* In the main thread case: We already have `INIT_STACK` at the right
  level, so just pass that local var to `ruby_thread_init_stack`.
* In the new thread case: Allocate the local one level above the call to
  `native_thread_init_stack` in `call_thread_start_func2`.

[Bug #20001]

fix
2024-01-19 09:55:12 +11:00
Olle Jonsson
08edad31a6 [rubygems/rubygems] Drop two TODOs from specification.rb
These were introduced 13 years ago, in a documentation update. Perhaps we can let the TODOs go, without taking any action?

https://github.com/rubygems/rubygems/commit/fb23fa84f9
2024-01-18 22:49:32 +00:00
Peter Zhu
c28094d385 [PRISM] Add function to free scope node
pm_scope_node_destroy frees the scope node after we're done using it to
make sure that the index_lookup_table is not leaked.

For example:

    10.times do
      100_000.times do
        RubyVM::InstructionSequence.compile_prism("begin; 1; rescue; 2; end")
      end

      puts `ps -o rss= -p #{$$}`
    end

Before:

    33056
    50304
    67776
    84544
    101520
    118448
    135712
    152352
    169136
    186656

After:

    15264
    15296
    15408
    17040
    17152
    17152
    18320
    18352
    18400
    18608
2024-01-18 16:33:25 -05:00
Peter Zhu
47081c3ee3 [PRISM] Pass pm_scope_node_t by reference
We can pass pm_scope_node_t by reference to pm_new_child_iseq rather
than by value.
2024-01-18 16:33:25 -05:00
Matt Valentine-House
60dd731125 [PRISM] Correct checkmatch flags for splat in rescue 2024-01-18 20:25:28 +00:00
Matt Valentine-House
8a3e7f08b8 [PRISM] Fix case splat with no predicate 2024-01-18 20:03:27 +00:00
Peter Zhu
686b1655a0 [PRISM] Fix indentation in switch [ci skip] 2024-01-18 14:59:59 -05:00
Takashi Kokubun
33306a08d1
YJIT: Stop incrementing chain_depth on defer_compilation (#9597) 2024-01-18 11:40:11 -08:00
Peter Zhu
d8ac96efc5 [PRISM] Fix memory leak in case nodes
The temporary array conditions_labels is heap allocated and never freed.
We can use alloca instead to stack allocate it so that we don't need to
manually free it.

For example:

    code = "case; #{100.times.map { "when #{it}; " }.join}; end"

    10.times do
      10_000.times do
        RubyVM::InstructionSequence.compile_prism(code)
      end

      puts `ps -o rss= -p #{$$}`
    end

Before:

    21376
    30304
    38800
    47184
    55456
    64192
    72288
    80400
    89040
    97104

After:

    13088
    13632
    13760
    14016
    14688
    14992
    15120
    15232
    15744
    15744
2024-01-18 13:40:14 -05:00
Robert Schulze
d3b07b9845 [ruby/psych] Add :stringify_names option to convert symbol keys to string for dumping
https://github.com/ruby/psych/commit/3d051d89aa
2024-01-18 17:32:34 +00:00
Peter Zhu
00814fd672 [PRISM] Fix memory leak in iseq
rb_iseq_compile_prism_node calls both rb_translate_prism and iseq_setup.
Both of these functions call iseq_set_sequence. This means that the first
iseq_set_sequence will leak because the iseq will be overwritten.

For example:

    10.times do
      100_000.times do
        RubyVM::InstructionSequence.compile_prism("")
      end

      puts `ps -o rss= -p #{$$}`
    end

Before:

    20528
    27328
    33840
    40208
    46400
    52960
    59168
    65600
    71888
    78352

After:

    13696
    13712
    13712
    13712
    13712
    14352
    14352
    14992
    14992
    14992
2024-01-18 10:35:46 -05:00
Burdette Lamar
ef685554c9
[DOC] RDoc for ARGF (#9558) 2024-01-18 10:15:25 -05:00
Nobuyoshi Nakada
97721fa4e1
Old sh does not allow : in function names [ci skip] 2024-01-18 19:56:52 +09:00
Nobuyoshi Nakada
264b7363aa
Preserve spaces in messages [ci skip] 2024-01-18 18:09:42 +09:00
Nobuyoshi Nakada
a3e6546e7e
Print error messages to the stderr [ci skip] 2024-01-18 16:36:09 +09:00
git
74ce7905d7 Update bundled gems list at 419f4260aa4827c633b3172d95a9fa [ci skip] 2024-01-18 07:23:49 +00:00
Hiroshi SHIBATA
419f4260aa
Use released version of bigdecimal 2024-01-18 16:01:02 +09:00
Edwing123
a660e1de18
[DOC] correct doc comment for rb_ary_aset
Signed-off-by: Edwin Garcia <egarciavalle2014@gmail.com>
2024-01-18 06:56:42 +00:00
tomoya ishida
fd1bafc11f [ruby/stringio] Fix ascii_only? flag in strio_write
(https://github.com/ruby/stringio/pull/77)

Followup of #79

`rb_str_resize()` was changed by b0b9f7201a  .

```c
rb_str_resize(string, shorter) // clear ENC_CODERANGE in some case
rb_str_resize(string, longer) // does not clear ENC_CODERANGE anymore
```

```c
// rb_str_resize in string.c
if (slen > len && ENC_CODERANGE(str) != ENC_CODERANGE_7BIT) {
  ENC_CODERANGE_CLEAR(str);
}
```

I think this change is based on an assumption that appending null bytes
will not change flag `ascii_only?`.

`strio_extend()` will make the string longer if needed, and update the
flags correctly for appending null bytes.
Before `memmove()`, we need to `rb_str_modify()` because updated flags are not
updated for `memmove()`.

https://github.com/ruby/stringio/commit/b31a538576
2024-01-18 03:42:21 +00:00
git
4095191f2c Update default gems list at af60cdf6747316b23bf254128d8472 [ci skip] 2024-01-18 01:37:52 +00:00