64552 Commits

Author SHA1 Message Date
Nobuyoshi Nakada
288e93bea8
Exclude parenthesized function declarations such as NORETURN
Fixes https://github.com/ruby/ruby/pull/3883
2020-12-11 13:43:18 +09:00
Koichi Sasada
b53ccb9c69 show deprecation warning correctly for lambda(&b)
lambda(&b) where b is given block of method (like: def foo(&b))
should warn correctly.
[Feature #17361]

Also labmda(&labmda_block) or lambda(&:to_s) (Symbol#to_proc)
should not warn (but I'm not sure who cares about it).
2020-12-11 11:57:25 +09:00
Koichi Sasada
ad6573163f add RUNOPT and RUNOPT0 for dev rules.
run, runruby, ... accept RUNOPT and RUNOPT0 configuration to pass
some commandline argument like that:

  $(BTESTRUBY) $(RUNOPT0) $(TESTRUN_SCRIPT) $(RUNOPT)

RUNOPT0 is options for ruby interpreter (-w, -v, ...)
RUNOPT is options for the script (ARGV/ARGF)
2020-12-11 11:57:25 +09:00
Masaki Matsushita
56918578ea Remove unimplemented parameter from comment
:resolv_timeout of TCPSocket.new is not implemented for now.
2020-12-11 11:13:24 +09:00
Koichi Sasada
974e89ae07 revert da3bca513f437b05b3953c3712ff48621fc5e008
It seems introduce critical problems. Now I could not find
out the issue.

http://ci.rvm.jp/results/trunk-test@ruby-sky1/3286048
2020-12-11 09:54:34 +09:00
Kenta Murata
9b0c36b390
Import fiddle-1.0.4 (#3860)
I don't use tool/sync_default_gem.rb because the last sync was incomplete.

Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org>
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
Co-authored-by: sinisterchipmunk <sinisterchipmunk@gmail.com>
Co-authored-by: Sutou Kouhei <kou@clear-code.com>
2020-12-11 09:41:12 +09:00
Takashi Kokubun
6b1d2de6cc
Unfortunately getinstancevariable was still not leaf
https://github.com/ruby/ruby/runs/1533401436
2020-12-10 14:40:29 -08:00
Takashi Kokubun
97868f16ff
Reintroduce the fix again 2020-12-10 13:00:02 -08:00
Takashi Kokubun
4474aadae8
Fix the path properly
😞
2020-12-10 11:48:57 -08:00
Takashi Kokubun
f56ab7a476
Try fixing the -I position
https://github.com/ruby/ruby/runs/1532260149
🤔
2020-12-10 11:18:30 -08:00
Jeremy Evans
dca13e2bf7 Make ruby -We the same as ruby -W -e
This changes the behavior, which I'm not sure is acceptable.
However, it's odd to allow an option to be combined, but change
the behavior of the option when combined.
2020-12-10 10:16:40 -08:00
Jeremy Evans
699608487d Make getinstancevariable a leaf instruction
It can no longer issue a warning.
2020-12-10 10:16:05 -08:00
Jeremy Evans
01b7d5acc7 Remove the uninitialized instance variable verbose mode warning
This speeds up all instance variable access, even when not in
verbose mode.  Uninitialized instance variable warnings were
rarely helpful, and resulted in slower code if you wanted to
avoid warnings when run in verbose mode.

Implements [Feature #17055]
2020-12-10 10:16:05 -08:00
MSP-Greg
4a559aa225
Actions mingw - add tool/test for WEBrick in spec tests (#3882)
Some spec tests require WEBrick, and the spec tests are run from install with the MinGW CI.
2020-12-10 09:27:02 -08:00
Yusuke Endoh
f3c19ddfbc Show C backtrace appropriately at core dump for GCC 8 or later
When ruby is compiled by GCC 8 or later, some frames of C level
backtrace information lacks.

```
$ ./miniruby -e '1.times { Process.kill(:SEGV, $$) }'

...

-- C level backtrace information
-------------------------------------------
/home/mame/work/ruby-gcc-9/miniruby(rb_vm_bugreport+0x611) [0x558a5fdcbc21] ../ruby/vm_dump.c:758
[0x558a5fbc789a]
/home/mame/work/ruby-gcc-9/miniruby(sigsegv+0x4d) [0x558a5fd1eaed] ../ruby/signal.c:959
/lib/x86_64-linux-gnu/libpthread.so.0(__restore_rt+0x0) [0x7f687e6713c0]
/lib/x86_64-linux-gnu/libc.so.6(kill+0xb) [0x7f687e31355b] ../sysdeps/unix/syscall-template.S:78
/home/mame/work/ruby-gcc-9/miniruby(rb_f_kill+0x350) [0x558a5fd1fe60] ../ruby/signal.c:480
[0x558a5fda50d3]
[0x558a5fdb085c]
[0x558a5fdb0fe7]
[0x558a5fdbae1a]
[0x558a5fdaf484]
/home/mame/work/ruby-gcc-9/miniruby(rb_yield_1+0x29f) [0x558a5fdb2fbf] ../ruby/vm.c:1265
/home/mame/work/ruby-gcc-9/miniruby(int_dotimes+0x5c) [0x558a5fc72f2c] ../ruby/numeric.c:5198
[0x558a5fda50d3]
[0x558a5fdb085c]
[0x558a5fdb0fe7]
[0x558a5fdbaf21]
[0x558a5fdaf484]
/home/mame/work/ruby-gcc-9/miniruby(rb_ec_exec_node+0xed) [0x558a5fbcc4fd] ../ruby/eval.c:317
/home/mame/work/ruby-gcc-9/miniruby(ruby_run_node+0x4f) [0x558a5fbd110f] ../ruby/eval.c:375
/home/mame/work/ruby-gcc-9/miniruby(main+0x73) [0x558a5fb2c083] ../ruby/main.c:50
```

By this one-line change, it shows all locations.

```
$ ./miniruby -e '1.times { Process.kill(:SEGV, $$) }'

...

-- C level backtrace information -------------------------------------------
/home/mame/work/ruby-gcc-9/miniruby(rb_print_backtrace+0x11) [0x558247adec21] ../ruby/vm_dump.c:758
/home/mame/work/ruby-gcc-9/miniruby(rb_vm_bugreport) ../ruby/vm_dump.c:956
/home/mame/work/ruby-gcc-9/miniruby(rb_bug_for_fatal_signal+0x15a) [0x5582478da89a] ../ruby/error.c:773
/home/mame/work/ruby-gcc-9/miniruby(sigsegv+0x4d) [0x558247a31aed] ../ruby/signal.c:959
/lib/x86_64-linux-gnu/libpthread.so.0(__restore_rt+0x0) [0x7f82202f73c0]
/lib/x86_64-linux-gnu/libc.so.6(kill+0xb) [0x7f821ff9955b] ../sysdeps/unix/syscall-template.S:78
/home/mame/work/ruby-gcc-9/miniruby(rb_f_kill+0x350) [0x558247a32e60] ../ruby/signal.c:480
/home/mame/work/ruby-gcc-9/miniruby(vm_call_cfunc_with_frame+0x123) [0x558247ab80d3] ../ruby/vm_insnhelper.c:2821
/home/mame/work/ruby-gcc-9/miniruby(vm_call_method_each_type+0x7c) [0x558247ac385c] ../ruby/vm_insnhelper.c:3324
/home/mame/work/ruby-gcc-9/miniruby(vm_call_method+0xc7) [0x558247ac3fe7] ../ruby/vm_insnhelper.c:3428
/home/mame/work/ruby-gcc-9/miniruby(vm_sendish+0x14) [0x558247acde1a] ../ruby/vm_insnhelper.c:4412
/home/mame/work/ruby-gcc-9/miniruby(vm_exec_core) ../ruby/insns.def:789
/home/mame/work/ruby-gcc-9/miniruby(rb_vm_exec+0x1a4) [0x558247ac2484] ../ruby/vm.c:2165
/home/mame/work/ruby-gcc-9/miniruby(rb_yield_1+0x29f) [0x558247ac5fbf] ../ruby/vm.c:1265
/home/mame/work/ruby-gcc-9/miniruby(int_dotimes+0x5c) [0x558247985f2c] ../ruby/numeric.c:5198
/home/mame/work/ruby-gcc-9/miniruby(vm_call_cfunc_with_frame+0x123) [0x558247ab80d3] ../ruby/vm_insnhelper.c:2821
/home/mame/work/ruby-gcc-9/miniruby(vm_call_method_each_type+0x7c) [0x558247ac385c] ../ruby/vm_insnhelper.c:3324
/home/mame/work/ruby-gcc-9/miniruby(vm_call_method+0xc7) [0x558247ac3fe7] ../ruby/vm_insnhelper.c:3428
/home/mame/work/ruby-gcc-9/miniruby(vm_sendish+0x14) [0x558247acdf21] ../ruby/vm_insnhelper.c:4412
/home/mame/work/ruby-gcc-9/miniruby(vm_exec_core) ../ruby/insns.def:770
/home/mame/work/ruby-gcc-9/miniruby(rb_vm_exec+0x1a4) [0x558247ac2484] ../ruby/vm.c:2165
/home/mame/work/ruby-gcc-9/miniruby(rb_ec_exec_node+0xed) [0x5582478df4fd] ../ruby/eval.c:317
/home/mame/work/ruby-gcc-9/miniruby(ruby_run_node+0x4f) [0x5582478e410f] ../ruby/eval.c:375
/home/mame/work/ruby-gcc-9/miniruby(main+0x73) [0x55824783f083] ../ruby/main.c:50
```

Details:

In short, it is an uninitialized variable bug.

Until GCC 7, all function locations are represented by a pair of
DW_AT_low_pc and DW_AT_high_pc in DWARF information.
But since GCC 8, some functions are split to multiple chunks, which are
represented by DW_AT_ranges.
DW_AT_ranges are represented as offsets from a base address.
According to DWARF specification, it is the base address of the
compilation unit, but GCC seems to use zero as default.
The function "di_read_cu" in addr2line.c had a comment about the fact.
However, the base address wasn't initialized as zero.
2020-12-11 01:32:20 +09:00
git
7f4c31d6a3 * 2020-12-11 [ci skip] 2020-12-11 01:19:47 +09:00
Nobuyoshi Nakada
b72f613210
Suppress a "clobbered" warning by gcc on macOS 2020-12-11 01:17:15 +09:00
Kazuhiro NISHIYAMA
673fcb7e9a
Fix a link [ci skip] 2020-12-10 21:48:04 +09:00
Kenta Murata
73db60bdda
include/ruby/memory_view.h: fix the return type of rb_memory_view_prepare_item_desc 2020-12-10 21:41:47 +09:00
Kenta Murata
0fcd478a4e
include/ruby/memory_view.h: fix typo 2020-12-10 21:35:53 +09:00
Kazuhiro NISHIYAMA
d5dfc3f2c8
Use abort(message) instead of puts and exit 2020-12-10 21:06:10 +09:00
Masaki Matsushita
78f188524f Add connect_timeout to TCPSocket
Add connect_timeout to TCPSocket.new in the same way as Socket.tcp.

Closes [Feature #17187]
2020-12-10 20:52:29 +09:00
Hiroshi SHIBATA
658b4ff609
Fixed the test failures called WEBrick.new directly 2020-12-10 18:55:03 +09:00
Koichi Sasada
72f1c43584 ObjectSpace._id2ref should not support unshareable
ObjectSpace._id2ref(id) can return any objects even if they are
unshareable, so this patch raises RangeError if it runs on multi-ractor
mode and the found object is unshareable.
2020-12-10 18:27:44 +09:00
NARUSE, Yui
7856da5fe7 remove bz2 2020-12-10 18:24:43 +09:00
Nobuyoshi Nakada
142f154a0a
Unpoison freelist to chain 2020-12-10 18:16:22 +09:00
Lourens Naudé
9a17437558 Right size literal regular expression buffers on compile 2020-12-10 18:15:26 +09:00
Hiroshi SHIBATA
e7433a3288 Added help message for gem i webrick in rdoc 2020-12-10 18:06:25 +09:00
Hiroshi SHIBATA
4ccc66265c Added help message for gem i webrick in gem server command 2020-12-10 18:06:25 +09:00
Hiroshi SHIBATA
b084f8abcf Completely removed webrick 2020-12-10 18:06:25 +09:00
Hiroshi SHIBATA
880727f037 Added help message for gem i webrick in un.rb 2020-12-10 18:06:25 +09:00
Hiroshi SHIBATA
05cc58c2eb webrick was removed from ruby repo 2020-12-10 18:06:25 +09:00
Hiroshi SHIBATA
0e73b49b4c Promote webrick to bundled gems 2020-12-10 18:06:25 +09:00
Hiroshi SHIBATA
087ac34fb2 Added tool/lib into test-spec loadpath 2020-12-10 18:06:25 +09:00
Hiroshi SHIBATA
5dc786bf86 Move webrick library into internal test toolchain 2020-12-10 18:06:25 +09:00
卜部昌平
46d3ea2c25
.github: reduce (#3876)
Comment out some 50-ish tests.
fix https://bugs.ruby-lang.org/issues/17376
2020-12-10 17:41:39 +09:00
Takashi Kokubun
9e8f732f39
Revert "Revert some recent JIT changes"
This reverts commit b7dc04e51823f9fe8b5355c30a304ecdb11fe5ed.

This should be fine, rather necessary, too.
2020-12-10 00:22:57 -08:00
Takashi Kokubun
12a1a25181
Revert "Revert "Have list_node at the top of rb_mjit_unit""
This reverts commit 73b07c437e24711c23dd2dd01d3ffc5f1012e046.

This was, of course, innocent.
2020-12-10 00:21:33 -08:00
Takashi Kokubun
16c765990c
Use list_for_each_safe when list_del is used inside
list_for_each seems to cause all the SEGVs we've seen.
2020-12-10 00:18:35 -08:00
Koichi Sasada
da3bca513f cache free pages per ractor
Per ractor method cache (GH-#3842) only cached 1 page and this patch
caches several pages to keep at least 512 free slots if available.
If you increase the number of cached free slots, all cached slots
will be collected when the GC is invoked.
2020-12-10 13:05:43 +09:00
Koichi Sasada
554c094977 set min/maximum free slots relative to ractor cnt
A program with multiple ractors can consume more objects per
unit time, so this patch set minimum/maximum free_slots to
relative to ractors count (upto 8).
2020-12-10 13:05:43 +09:00
Koichi Sasada
eafe000af3 lazy sweep tries to collect 2048 slots
Lazy sweep tries to collect free (unused) slots incrementally, and
it only collect a few pages. This patch makes lazy sweep collects
more objects (at least 2048 objects) and GC overhead of multi-ractor
execution will be reduced.
2020-12-10 13:05:43 +09:00
Kenta Murata
2544f7196e
test/ruby/test_arithmetic_sequence.rb: restore test_last_bug17218
And rename the existing `test_last_bug17218` to `test_to_a_bug17218`.
2020-12-10 00:59:00 +09:00
Kenta Murata
bb489aca58
memory_view.c: Add rb_memory_view_get_item and rb_memory_view_prepare_item_desc (#3871) 2020-12-10 00:24:36 +09:00
git
549118b3e2 * 2020-12-10 [ci skip] 2020-12-10 00:17:44 +09:00
Yusuke Endoh
3156fb0f2c test/ruby/test_arithmetic_sequence.rb: remove a duplicated test
There is another "test_last_bug17218"
2020-12-10 00:16:49 +09:00
Kenta Murata
fad3023e94
Fix ArithmeticSequence#last and ArithmeticSequence#each for non-integer sequences (#3870)
[Bug #17218]
[ruby-core:100312]
2020-12-09 18:48:59 +09:00
Marc-Andre Lafortune
cacdf2681d [ruby/matrix] Disable Ractor test 2020-12-09 04:21:00 -05:00
Marc-Andre Lafortune
150dbb656d [ruby/matrix] v0.3.1 2020-12-09 02:15:41 -05:00
Marc-Andre Lafortune
a7dccd08e7 [ruby/matrix] Make frozen matrices Ractor shareable 2020-12-09 02:15:41 -05:00