Граф коммитов

82617 Коммитов

Автор SHA1 Сообщение Дата
KJ Tsanaktsidis 6af0f442c7 Revert "Make stack bounds detection work with ASAN"
This reverts commit 6185cfdf38.
2024-01-12 17:58:54 +11:00
KJ Tsanaktsidis ac0ba3c07e Revert "Allow each_stack_location to accept context for the callback"
This reverts commit 179228cd83.
2024-01-12 17:58:54 +11:00
KJ Tsanaktsidis 33a03cb236 Revert "Define special macros for asan/msan being enabled"
This reverts commit bdafad8790.
2024-01-12 17:58:54 +11:00
KJ Tsanaktsidis 688a6ff510 Revert "Mark asan fake stacks during machine stack marking"
This reverts commit d10bc3a2b8.
2024-01-12 17:58:54 +11:00
git 18d85af969 Update bundled gems list as of 2024-01-12 2024-01-12 06:58:39 +00:00
Hiroshi SHIBATA 51ba654939
Set prerelease flag if tag includes preview or rc 2024-01-12 15:36:08 +09:00
KJ Tsanaktsidis d10bc3a2b8 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-12 17:29:48 +11:00
KJ Tsanaktsidis bdafad8790 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-12 17:29:48 +11:00
KJ Tsanaktsidis 179228cd83 Allow each_stack_location to accept context for the callback
This is preparing for a more specialised, asan-aware version of
gc_mark_maybe which needs some additional context passed through.

[Bug #20001]
2024-01-12 17:29:48 +11:00
KJ Tsanaktsidis 6185cfdf38 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-12 17:29:48 +11:00
KJ Tsanaktsidis 4ba8f0dc99 Pass down "stack start" variables from closer to the top of the stack
The implementation of `native_thread_init_stack` for the various
threading models can use the address of a local variable as part of the
calculation of the 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 allocated _inside_
the `native_thread_init_stack` frame; that means the caller might
allocate a VALUE on the stack that actually lies outside the bounds
stored in machine.stack_{start,end}.

A local variable from one level above the topmost frame that stores
VALUEs on the stack must be drilled down into the call to
`native_thread_init_stack` to be used in the calculation. This probably
doesn't _really_ matter for the win32 case (they'll be in the same
memory mapping so VirtualQuery should return the same thing), but
definitely could matter for the pthreads case.

[Bug #20001]
2024-01-12 17:29:48 +11:00
Hiroshi SHIBATA 6a45320c25
Truncate only prefix. Don't remove v from like preview1 2024-01-12 14:56:04 +09:00
dependabot[bot] 1e9fac4dbc Bump actions/cache from 3.3.2 to 3.3.3
Bumps [actions/cache](https://github.com/actions/cache) from 3.3.2 to 3.3.3.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](704facf57e...e12d46a63a)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-11 19:10:01 -08:00
dependabot[bot] f5237e105a Bump actions/cache in /.github/actions/setup/directories
Bumps [actions/cache](https://github.com/actions/cache) from 3.3.2 to 3.3.3.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](704facf57e...e12d46a63a)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-11 18:44:19 -08:00
John Hawthorn 18573b8d05 Avoid reading unused lvars in Primitive.cexpr
Previously on builds with optimizations disabled, this could result in
an out of bounds read. When we had all of:
* built with -O0
* Leaf builtin
* Primitive.mandatory_only
* "no args builtin", called by vm_call_single_noarg_inline_builti
* The stack is escaped to the heap via binding or a proc

This is because mk_builtin_loader generated reads for all locals
regardless of whether they were used and in the case we generated a
mandatory_only iseq that would include more variables than were actually
available.

On optimized builds, the invalid accesses would be optimized away, and
this also was often unnoticed as the invalid access would just hit
another part of the stack unless it had been escaped to the heap.

The fix here is imperfect, as this could have false positives, but since
Primitive.cexpr! is only available within the cruby codebase itself
that's probably fine as a proper fix would be much more challenging (the
only false positives we found were in rjit.rb).

Fixes [Bug #20178]

Co-authored-by: Adam Hess <HParker@github.com>
2024-01-11 16:53:20 -08:00
Aaron Patterson 371256775f Anonymous rest nodes should increase the local table size
When we calculate the local table size, we need to account for anonymous
"rest" parameters.  Since they don't have a name, they won't be in the
"locals" table that Prism provides, but we need to reserve room for them
anyway.

Fixes: https://github.com/ruby/prism/issues/2154
2024-01-11 15:53:52 -08:00
Jeremy Evans eb8df2fa7a Update Kernel#load documentation to remove phrase related to protection
Code loaded via Kernel#load can modify the global namespace even
if the wrap parameter is provided.

Fixes [Bug #19990]
2024-01-11 12:58:05 -08:00
Kevin Newton 76a207e542 [ruby/prism] Fix nested default value error
https://github.com/ruby/prism/commit/ef26b283de
2024-01-11 20:52:48 +00:00
Kevin Newton 44d0c5ae3f [PRISM] Raise syntax errors when found 2024-01-11 14:59:37 -05:00
Peter Zhu 45dd8edf82 [PRISM] Fix splat inside of aset
Fixes ruby/prism#2146.
2024-01-11 14:58:24 -05:00
Aaron Patterson f2149dc094 [PRISM] Support repeated required parameter names.
Fixes: https://github.com/ruby/prism/issues/2062

This patch only fixes positional parameters, we still need to fix the
other cases spelled out in test/prism/fixtures/repeat_parameters.txt
2024-01-11 11:31:59 -08:00
Kevin Newton 72be786017 [ruby/prism] Allow fsl comment to set to false
https://github.com/ruby/prism/commit/b4db7bb703
2024-01-11 19:27:14 +00:00
Kevin Newton 242dc537f9 [ruby/prism] Exclude encodings that are dynamic
https://github.com/ruby/prism/commit/6749146c0e
2024-01-11 19:14:25 +00:00
Kevin Newton 6ff9f1aa51 [ruby/prism] Provide ability to format errors
https://github.com/ruby/prism/commit/27985b0e7e
2024-01-11 18:36:32 +00:00
Peter Zhu 057df4379f Free environ when RUBY_FREE_AT_EXIT
The environ is malloc'd, so it gets reported as a memory leak. This
commit adds ruby_free_proctitle which frees it during shutdown when
RUBY_FREE_AT_EXIT is set.

    STACK OF 1 INSTANCE OF 'ROOT LEAK: <calloc in ruby_init_setproctitle>':
    5   dyld                                  0x18b7090e0 start + 2360
    4   ruby                                  0x10000e3a8 main + 100  main.c:58
    3   ruby                                  0x1000b4dfc ruby_options + 180  eval.c:121
    2   ruby                                  0x1001c5f70 ruby_process_options + 200  ruby.c:3014
    1   ruby                                  0x10035c9fc ruby_init_setproctitle + 76  setproctitle.c:105
    0   libsystem_malloc.dylib                0x18b8c7b78 _malloc_zone_calloc_instrumented_or_legacy + 100
2024-01-11 10:09:53 -05:00
Benoit Daloze 4e0c2f05ef [ruby/pp] Add TruffleRuby in CI
* Only 2 cyclic tests are failing, with the ... in a slightly different place in the output.

https://github.com/ruby/pp/commit/6e5c7d741e
2024-01-11 13:44:03 +00:00
Benoit Daloze 1ed3b60375 [ruby/pp] Fix pretty printing a Data subclass instance when the subclass is anonymous
* It would be "#<data  a=42>" (double space) instead of "#<data a=42>" (like #inspect).

https://github.com/ruby/pp/commit/bed72bfcb8
2024-01-11 13:44:01 +00:00
Benoit Daloze 62382a4345 [ruby/pp] Use .class.members for pretty printing Data
* Data#members might not be defined, instead it might be defined
  on Data subclasses or a module included there. This is notably the
  case on TruffleRuby which defines it there for optimization purposes.
  In fact the mere presence of Data#members implies a megamorphic call
  inside, so it seems best to avoid relying on its existence.

https://github.com/ruby/pp/commit/6a97d36fbb
2024-01-11 13:44:00 +00:00
Benoit Daloze 3b9cc22536 [ruby/pp] Use a proper feature check to check if Data is defined
https://github.com/ruby/pp/commit/ed602b9f2b
2024-01-11 13:44:00 +00:00
Hiroya Fujinami 80f1c1e293
Remove a unused variable in i_print_name_entry (#9468)
A warning for this is shown when `ONIG_DEBUG_COMPILE` is enabled.
2024-01-11 22:38:44 +09:00
Nobuyoshi Nakada 3d3bc029c5
Reject encodings determined at runtime as source code encodings
The encodings determined at runtime are affected by the runtime
environment, such as the OS and locale, while the file contents are
not.
2024-01-11 18:46:51 +09:00
Nobuyoshi Nakada 0480c07344
Remove printf z modifier check [ci skip]
VC2013 is no longer supported.
2024-01-11 18:28:53 +09:00
Nobuyoshi Nakada 7cc8d58cc9
Remove duplicate function `nd_st_key_val` 2024-01-11 17:46:09 +09:00
Nobuyoshi Nakada d6741572ef [ruby/rdoc] Undo accidentally deleted lines
https://github.com/ruby/rdoc/commit/4e14158255
2024-01-11 08:39:52 +00:00
Hiroshi SHIBATA b10aa7757e
Disable to add latest label when running with --no-dry-run option 2024-01-11 17:36:51 +09:00
Yusuke Endoh 78cd5b3657 Prevent syntax warnings in test/ruby/test_regexp.rb 2024-01-11 17:04:13 +09:00
Yusuke Endoh 60844ecf2e Prevent a warning: ambiguous first argument 2024-01-11 17:03:22 +09:00
dependabot[bot] 4088280643 Bump actions/upload-artifact from 3.1.3 to 4.0.0
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3.1.3 to 4.0.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](a8a3f3ad30...c7d193f32e)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-11 16:12:23 +09:00
dependabot[bot] 563f61102b Bump actions/cache in /.github/actions/setup/directories
Bumps [actions/cache](https://github.com/actions/cache) from 3.3.1 to 3.3.2.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](88522ab9f3...704facf57e)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-10 22:57:05 -08:00
Nobuyoshi Nakada 7558625be1 [ruby/rdoc] Respect modeline to detect parser
https://github.com/ruby/rdoc/commit/485468f06f
2024-01-11 06:55:39 +00:00
dependabot[bot] c26fdce9ec Bump ruby/setup-ruby from 1.160.0 to 1.165.1
Bumps [ruby/setup-ruby](https://github.com/ruby/setup-ruby) from 1.160.0 to 1.165.1.
- [Release notes](https://github.com/ruby/setup-ruby/releases)
- [Commits](036ef458dd...360dc864d5)

---
updated-dependencies:
- dependency-name: ruby/setup-ruby
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-10 22:41:37 -08:00
dependabot[bot] 1a66828a7e Bump lewagon/wait-on-check-action from 1.3.1 to 1.3.3
Bumps [lewagon/wait-on-check-action](https://github.com/lewagon/wait-on-check-action) from 1.3.1 to 1.3.3.
- [Release notes](https://github.com/lewagon/wait-on-check-action/releases)
- [Commits](e106e5c43e...595dabb3ac)

---
updated-dependencies:
- dependency-name: lewagon/wait-on-check-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-10 22:37:40 -08:00
Hiroshi SHIBATA 505ac323e3
Try to fixup ad3db6711c
directory value may be not support glob files from subdirectories
2024-01-11 15:21:45 +09:00
Hiroshi SHIBATA 0ebc3f7969
Revert "Update files under .github other than workflows"
This reverts commit ad3db6711c.

  Above commit break dependabot update since Nov, 2023.
2024-01-11 15:02:13 +09:00
David Rodríguez f4a347b90f [rubygems/rubygems] Fix Bundler daily CI
There is another place artifice usage was making the copy of vendored
http in ruby-core be loaded instead of the one under test.

Remove unnecessary usage of artifice.

https://github.com/rubygems/rubygems/commit/d2488199b0
2024-01-11 13:51:52 +09:00
David Rodríguez 0156b7416c [rubygems/rubygems] Always avoid "Updating rubygems-update" message
The fact that under the hood the upgrade is done through a
rubygems-update gem is an implementation detail that does not really
help users to know.

Plus, it reads a bit weird.

https://github.com/rubygems/rubygems/commit/0fa5c50258
2024-01-11 13:51:52 +09:00
David Rodríguez 3980cebda5 [rubygems/rubygems] Make `gem update --system` respect ruby version constraints
https://github.com/rubygems/rubygems/commit/36052abbe2
2024-01-11 13:51:52 +09:00
David Rodríguez aa908aa065 [rubygems/rubygems] Remove old condition no longer necessary
https://github.com/rubygems/rubygems/commit/701980b240
2024-01-11 13:51:52 +09:00
David Rodríguez ef0705b3c2 [rubygems/rubygems] Fix development dependency not being added if introduced by two gemspecs
https://github.com/rubygems/rubygems/commit/adc05bf1c3
2024-01-11 13:51:52 +09:00
David Rodríguez b8f859f0bf Complete missing specs for platforms after resolution
If two platform specific variants have different dependencies, then
resolution may fallback to the non platform specific variant. However,
the platform specific variants that have the same dependencies as the
non specific one can still be kept.

Do a pass to complete those after resolution.
2024-01-11 13:51:52 +09:00