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

78961 Коммитов

Автор SHA1 Сообщение Дата
Kunshan Wang aeff31168a No computing embed_capa_max in ary_make_partial
ary_make_partial now uses the actual embed_capa of an allocated heap
array to guide whether make an embedded copy or a slice view.
2023-08-03 08:34:24 -04:00
Nobuyoshi Nakada 5336b2f0db
Move a local variable declaration after the protected region 2023-08-03 13:43:04 +09:00
Nobuyoshi Nakada 8f2bbbbcaf
Add assertion in `RHASH_AR_TABLE_BOUND` 2023-08-03 13:17:41 +09:00
Nobuyoshi Nakada fe977314d5
Check if reader members are set 2023-08-03 09:51:52 +09:00
Peter Zhu 4b6c584023 Remove --disable-gems for assert_separately
assert_separately adds --disable=gems so we don't need to add
--disable-gems when calling assert_separately.
2023-08-03 09:11:08 +09:00
git 29fd05036b * remove trailing spaces. [ci skip] 2023-08-02 23:43:29 +00:00
Takashi Kokubun 192ed8e70f gdb.py: Add -a option to dump all frames [ci skip] 2023-08-02 16:43:12 -07:00
Takashi Kokubun 5f5cc22b5f gdb.py: Print Env based on EP instead of BP
because EP could be escaped.
2023-08-02 16:23:55 -07:00
Stan Lo 32e828bb4a [ruby/irb] Deprecate multi-irb commands
(https://github.com/ruby/irb/pull/654)

* Deprecate multi-irb commands

- Print deprecated message when any of the commands are used
- Put related commands under `Multi-irb` category with a deprecated
  label

* Update readme

https://github.com/ruby/irb/commit/861731ac12
2023-08-02 18:35:08 +00:00
Stan Lo 8ecd300e1e [ruby/irb] Extract integration testing helpers out of debug command
tests
(https://github.com/ruby/irb/pull/660)

The ability to run a test case in a subprocess is useful for testing
many other features, like nested IRB sessions. So I think it's worth
extracting them into a new test case class.

https://github.com/ruby/irb/commit/73b7a895f8
2023-08-02 18:33:43 +00:00
Benoit Daloze dc54574ade Update to ruby/spec@9e278f5 2023-08-02 18:53:03 +02:00
Jean byroot Boussier e20f1e443f
YJIT: Fallback setivar if the receiver isn't T_OBJECT (#8160)
Followup: https://github.com/ruby/ruby/pull/8152

If the receiver is a T_MODULE or T_CLASS and has a lot of
ivars, `get_next_shape_internal` will return `NULL`.

Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
2023-08-02 11:33:12 -04:00
Benoit Daloze 3c41a04b6c Fix encoding switches when RUBYOPT is empty or only spaces
* Follow-up of dbbc3583ba which broke this.
2023-08-02 17:13:38 +02:00
Nobuyoshi Nakada a502cd80a5
Fix wrong assignment 2023-08-02 23:55:07 +09:00
Takashi Kokubun 81c198b5cf
YJIT: Distinguish exit and fallback reasons for send (#8159) 2023-08-02 10:19:39 -04:00
Takashi Kokubun 452debba22
YJIT: Fix --yjit-dump-disasm coloring on less(1) (#8158) 2023-08-02 10:16:37 -04:00
Takashi Kokubun d405410e3c
YJIT: Move ROBJECT_OFFSET_* to yjit.c (#8157) 2023-08-02 10:15:29 -04:00
Peter Zhu 1d096c1e53 Fix crash in NoMethodError for dummy frames
[Bug #19793]

Dummy frames are created at the top level when requiring another file.
While requiring a file, it will try to convert using encodings. Some of
these encodings will not respond to to_str. If method_missing is
redefined on Object, then it will call method_missing and attempt raise
an error. However, the iseq is invalid as it's a dummy frame so it will
write an invalid iseq to the created NoMethodError.

The following script crashes:

```
GC.stress = true

class Object
  public :method_missing
end

File.write("/tmp/empty.rb", "")
require "/tmp/empty.rb"
```

With the following backtrace:

```
frame #0: 0x00000001000fa8b8 miniruby`RVALUE_MARKED(obj=4308637824) at gc.c:1638:12
frame #1: 0x00000001000fb440 miniruby`RVALUE_BLACK_P(obj=4308637824) at gc.c:1763:12
frame #2: 0x00000001000facdc miniruby`gc_writebarrier_incremental(a=4308637824, b=4308332208, objspace=0x000000010180b000) at gc.c:8822:9
frame #3: 0x00000001000faad8 miniruby`rb_gc_writebarrier(a=4308637824, b=4308332208) at gc.c:8864:17
frame #4: 0x000000010016aff0 miniruby`rb_obj_written(a=4308637824, oldv=36, b=4308332208, filename="../iseq.c", line=1279) at gc.h:804:9
frame #5: 0x0000000100162a60 miniruby`rb_obj_write(a=4308637824, slot=0x0000000100d09888, b=4308332208, filename="../iseq.c", line=1279) at gc.h:837:5
frame #6: 0x0000000100165b0c miniruby`iseqw_new(iseq=0x0000000100d09880) at iseq.c:1279:9
frame #7: 0x0000000100165a64 miniruby`rb_iseqw_new(iseq=0x0000000100d09880) at iseq.c:1289:12
frame #8: 0x00000001000d8324 miniruby`name_err_init_attr(exc=4309777920, recv=4304780496, method=827660) at error.c:1830:35
frame #9: 0x00000001000d1b80 miniruby`name_err_init(exc=4309777920, mesg=4308332496, recv=4304780496, method=827660) at error.c:1869:12
frame #10: 0x00000001000d1bd4 miniruby`rb_nomethod_err_new(mesg=4308332496, recv=4304780496, method=827660, args=4308332448, priv=0) at error.c:1957:5
frame #11: 0x000000010039049c miniruby`rb_make_no_method_exception(exc=4304914512, format=4308332496, obj=4304780496, argc=1, argv=0x000000016fdfab00, priv=0) at vm_eval.c:959:16
frame #12: 0x00000001003b3274 miniruby`raise_method_missing(ec=0x0000000100b06f40, argc=1, argv=0x000000016fdfab00, obj=4304780496, last_call_status=MISSING_NOENTRY) at vm_eval.c:999:15
frame #13: 0x00000001003945d4 miniruby`rb_method_missing(argc=1, argv=0x000000016fdfab00, obj=4304780496) at vm_eval.c:944:5
...
frame #23: 0x000000010038f5e4 miniruby`rb_vm_call_kw(ec=0x0000000100b06f40, recv=4304780496, id=2865, argc=1, argv=0x000000016fdfab00, me=0x0000000100cbfcf0, kw_splat=0) at vm_eval.c:326:12
frame #24: 0x00000001003c18e4 miniruby`call_method_entry(ec=0x0000000100b06f40, defined_class=4304927952, obj=4304780496, id=2865, cme=0x0000000100cbfcf0, argc=1, argv=0x000000016fdfab00, kw_splat=0) at vm_method.c:2720:20
frame #25: 0x00000001003c440c miniruby`check_funcall_exec(v=6171896792) at vm_eval.c:589:12
frame #26: 0x00000001000dec00 miniruby`rb_vrescue2(b_proc=(miniruby`check_funcall_exec at vm_eval.c:587), data1=6171896792, r_proc=(miniruby`check_funcall_failed at vm_eval.c:596), data2=6171896792, args="Pȗ") at eval.c:919:18
frame #27: 0x00000001000deab0 miniruby`rb_rescue2(b_proc=(miniruby`check_funcall_exec at vm_eval.c:587), data1=6171896792, r_proc=(miniruby`check_funcall_failed at vm_eval.c:596), data2=6171896792) at eval.c:900:17
frame #28: 0x000000010039008c miniruby`check_funcall_missing(ec=0x0000000100b06f40, klass=4304923536, recv=4304780496, mid=3233, argc=0, argv=0x0000000000000000, respond=-1, def=36, kw_splat=0) at vm_eval.c:666:15
frame #29: 0x000000010038fa60 miniruby`rb_check_funcall_default_kw(recv=4304780496, mid=3233, argc=0, argv=0x0000000000000000, def=36, kw_splat=0) at vm_eval.c:703:21
frame #30: 0x000000010038fb04 miniruby`rb_check_funcall(recv=4304780496, mid=3233, argc=0, argv=0x0000000000000000) at vm_eval.c:685:12
frame #31: 0x00000001001c469c miniruby`convert_type_with_id(val=4304780496, tname="String", method=3233, raise=0, index=-1) at object.c:3061:15
frame #32: 0x00000001001c4a4c miniruby`rb_check_convert_type_with_id(val=4304780496, type=5, tname="String", method=3233) at object.c:3153:9
frame #33: 0x00000001002d59f8 miniruby`rb_check_string_type(str=4304780496) at string.c:2571:11
frame #34: 0x000000010014b7b0 miniruby`io_encoding_set(fptr=0x0000000100d09ca0, v1=4304780496, v2=4, opt=4) at io.c:11655:19
frame #35: 0x0000000100139a58 miniruby`rb_io_set_encoding(argc=1, argv=0x000000016fdfb450, io=4308334032) at io.c:13497:5
frame #36: 0x00000001003c0004 miniruby`ractor_safe_call_cfunc_m1(recv=4308334032, argc=1, argv=0x000000016fdfb450, func=(miniruby`rb_io_set_encoding at io.c:13487)) at vm_insnhelper.c:3271:12
...
frame #43: 0x0000000100390b08 miniruby`rb_funcall(recv=4308334032, mid=16593, n=1) at vm_eval.c:1137:12
frame #44: 0x00000001002a43d8 miniruby`load_file_internal(argp_v=6171899936) at ruby.c:2500:5
...
```
2023-08-02 09:08:12 -04:00
Nobuyoshi Nakada 85ee4a65a2
Allow to override environment variables for debug 2023-08-02 19:55:31 +09:00
Nobuyoshi Nakada ffe0f9eb6c
`EnvUtil.invoke_ruby` also passes ASAN options 2023-08-02 19:55:30 +09:00
Hiroshi SHIBATA 28c2136722 [rubygems/rubygems] Replaced remained local to lockfile
https://github.com/rubygems/rubygems/commit/6ed69223d4
2023-08-02 09:56:13 +00:00
Jean byroot Boussier fd8dd71996
Implement StringIO#pread (#56)
Both for being closer to real IOs and also because it's a convenient API
in multithreaded scenarios.

Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2023-08-02 18:18:17 +09:00
Stan Lo 201fd57518 [ruby/irb] Drop src_encoding.rb
(https://github.com/ruby/irb/pull/634)

Its method `IRB.default_src_encoding` was only used in `magic-file.rb`,
which has been removed.

https://github.com/ruby/irb/commit/ed98983b1f
2023-08-02 18:17:27 +09:00
Sutou Kouhei fe25527781 [ruby/fiddle] Include stdbool.h explicitly
https://github.com/ruby/fiddle/commit/c313a74632
2023-08-02 18:17:20 +09:00
Sutou Kouhei 673f4493b0 [ruby/fiddle] Include stdbool.h explicitly
https://github.com/ruby/fiddle/commit/69ff680bf6
2023-08-02 18:17:19 +09:00
Sutou Kouhei 15e8cf7ad9 [ruby/fiddle] Add support for bool
GitHub: fix https://github.com/ruby/fiddle/pull/130

Reported by Benoit Daloze. Thanks!!!

https://github.com/ruby/fiddle/commit/bc6c66bbb9
2023-08-02 18:17:18 +09:00
Sutou Kouhei 10588fa121 [ruby/fiddle] Use ifdef
https://github.com/ruby/fiddle/commit/6cdf53726d
2023-08-02 18:17:16 +09:00
Hiroshi SHIBATA fd782dcd1e
Revert "YJIT: implement `expandarray_rhs_too_small` case (#8153)"
This reverts commit 3b88a0bee8.

  This commit break aarch64 platform and Apple Silicon
2023-08-02 14:25:16 +09:00
Nobuyoshi Nakada c5abe0d08f
Tests to move between size pools are flaky on Windows too [ci skip]
Needs more investigations.
2023-08-02 14:19:44 +09:00
Nobuyoshi Nakada e4fcac42d2
Find paths of tools [ci skip]
Recent GitHub Actions Windows containers seem having Strawberry tools.
2023-08-02 13:48:43 +09:00
Nobuyoshi Nakada 15b2e91230 Remove `kprintf` in addr2line.c
According to @naruse, this `kprintf` was to avoid some segfaults, but
turned out it seemed another issue after all.
2023-08-02 13:21:20 +09:00
Nobuyoshi Nakada 31d1226763 Avoid aborting inside addr2line.c 2023-08-02 13:21:20 +09:00
Takashi Kokubun df6071c49f Do not auto-cancel builds on pull requests
For some reason, there was a pull request that contains a YJIT change
but did not run Cirrus CI, which ended up failing Cirrus CI on master.

This `auto_cancellation` config seems suspicious. Now that we have
`only_if`, I don't think we need an extra guard besides that.
2023-08-01 15:36:27 -07:00
Takashi Kokubun 5ff1c00e17
YJIT: Let local yjit-bindgen exit successfully (#8156) 2023-08-01 14:46:14 -07:00
Maxime Chevalier-Boisvert 3b88a0bee8
YJIT: implement `expandarray_rhs_too_small` case (#8153)
* YJIT: handle expandarray_rhs_too_small case

* YJIT: fix csel bug in x86 backend, add test

* Remove commented out lines
2023-08-01 15:58:00 -04:00
Takashi Kokubun 16b91a346f
YJIT: Fallback setivar if the next shape is too complex (#8152) 2023-08-01 11:43:32 -07:00
Nobuyoshi Nakada 1642e0c392
Remove unnecessarily copied document [ci skip] 2023-08-01 22:49:37 +09:00
Koichi Sasada d68c01fd31 support `rescue` event for TracePoint
fix [Feature #19572]
2023-08-01 22:46:17 +09:00
Stan Lo f11ac06337 [ruby/irb] Add workspace category
(https://github.com/ruby/irb/pull/661)

* Create a new Workspace command category

* Update readme

https://github.com/ruby/irb/commit/310650c213
2023-08-01 12:51:30 +00:00
Nobuyoshi Nakada 382678d411 [Bug #19788] Use the result of `tCOLON2` event 2023-08-01 19:00:31 +09:00
Koichi Sasada 6a5c548218 remove strange line event
```ruby
  def helper_cant_rescue
    begin
      raise SyntaxError
    rescue
      cant_rescue # here
    end
  end
```

on this case, a line event is reported on `cant_rescue` line
because of node structure. it should not be reported.
2023-08-01 18:06:25 +09:00
Nobuyoshi Nakada 0622c78869
[DOC] Update warning categories
- Fix indentations of labeled lists.
- Mention performance category.
2023-08-01 14:54:16 +09:00
Burdette Lamar 533dcb8e52
RDoc for module Process (#8141) 2023-07-31 21:44:56 -04:00
Shugo Maeda 0b8045c9c9
Supress warnings by Refinement#refined_class in test code 2023-08-01 09:48:47 +09:00
Hiroshi SHIBATA de91ce980a [rubygems/rubygems] Use Kernel.singleton_class
https://github.com/rubygems/rubygems/commit/9be984f281
2023-08-01 00:31:22 +00:00
Kazuhiro NISHIYAMA 3f010d48fc
[DOC] Fix a link [ci skip] 2023-08-01 09:27:25 +09:00
Peter Zhu ec0e6809f9 Skip flaky test on Solaris
This test is flaky on "SPARC Solaris 10 (gcc)" CI with this message:

TestGCCompact#test_moving_objects_between_size_pools [test/ruby/test_gc_compact.rb:378]:
Expected 499 to be >= 500.
2023-07-31 20:02:32 -04:00
Kevin Newton 04f4e0aeb2 [ruby/yarp] Document building, more macro changes
https://github.com/ruby/yarp/commit/4214f262d2
2023-07-31 20:10:23 +00:00
Stan Lo 5d78ec8a94 [ruby/irb] Decouple `edit` and `show_source` commands
(https://github.com/ruby/irb/pull/658)

* Decouple `edit` command from `show_source`

2 commands should not depend on each other. If `edit` command also needs
to find a source, the source finding logic should be extracted into a
separate class.

* Return nil if is not an actual file path

* Refactor SourceFinder

https://github.com/ruby/irb/commit/9790517a0c
2023-07-31 19:57:36 +00:00
Peter Zhu c01b17f7fc Fix default value of global_init_slots
Not setting a value to global_init_slots causes get_envparam_size to
output a broken default value.
2023-07-31 15:12:20 -04:00