summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-06-11[rubygems/rubygems] Refactor ambiguous gems checkDavid Rodríguez
https://github.com/rubygems/rubygems/commit/a00c79a4da
2022-06-10fix typo in dir documentation (#6002)Jaeson Lauritzen
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2022-06-10Make method id explicit in rb_exec_recursive_outerJohn Hawthorn
Previously, because opt_aref and opt_aset don't push a frame, when they would call rb_hash to determine the hash value of the key, the initial level of recursion would incorrectly use the method id at the top of the stack instead of "hash". This commit replaces rb_exec_recursive_outer with rb_exec_recursive_outer_mid, which takes an explicit method id, so that we can make the hash calculation behave consistently. rb_exec_recursive_outer was documented as being internal, so I believe this should be okay to change. Notes: Merged: https://github.com/ruby/ruby/pull/6004
2022-06-10Add mid argument to exec_recursiveJohn Hawthorn
Notes: Merged: https://github.com/ruby/ruby/pull/6004
2022-06-11[ruby/fileutils] Enhanced RDoc (https://github.com/ruby/fileutils/pull/83)Burdette Lamar
Treats ::chmod_R and ::chown. https://github.com/ruby/fileutils/commit/df4ac84bef
2022-06-10Add assertion for embedded to embedded ivar copyJemma Issroff
Notes: Merged: https://github.com/ruby/ruby/pull/6003
2022-06-10Add tests for a variety of string-subclass operations (#5999)Noah Gibbs
This way YJIT has to match CRuby for each of them. Remove unused string_p() Rust function Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2022-06-11* 2022-06-11 [ci skip]git
2022-06-10Don't return a value from jit_guard_known_klass. We never return anything ↵Noah Gibbs
but true at this point and we don't usually check the returned value. (#6000) Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2022-06-10small fix on `setup_debug_log()`Koichi Sasada
* print `ruby_debug_log_mode` at first. * show filters when `ruby_debug_log_mode` is not "disabled". Notes: Merged: https://github.com/ruby/ruby/pull/5996
2022-06-10Remove duplicated rb_yjit_get_stats (#5997)Eileen M. Uchitelle
`rb_yjit_get_stats` is defined twice in yjit.c, it only needs to be defined once. Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2022-06-10Fix nested bmethod TracePoint and memory leakAlan Wu
df317151a5b4e0c5a30fcc321a9dc6abad63f7ed removed the code to free rb_hook_list_t, so repeated targeting of the same bmethod started to leak the hook list. You can observe how the maximum memory use scales with input size in the following script with `/usr/bin/time -v`. ```ruby o = Object.new o.define_singleton_method(:foo) {} trace = TracePoint.new(:return) {} bmethod = o.method(:foo) ARGV.first.to_i.times { trace.enable(target:bmethod){} } 4.times {GC.start} ``` After this change the maximum doesn't grow as quickly. To plug the leak, check whether the hook list is already allocated when enabling the targeting TracePoint for the bmethod. This fix also allows multiple TracePoints to target the same bmethod, similar to other valid TracePoint targets. Finally, free the rb_hook_list_t struct when freeing the method definition it lives on. Freeing in the GC is a good way to avoid lifetime problems similar to the one fixed in df31715. [Bug #18031] Notes: Merged: https://github.com/ruby/ruby/pull/4651
2022-06-09Remove a leftover requireTakashi Kokubun
I thought about using it in 2931957d6ff16b5c095f6e8095384c98130133ad once and then ended up not using it.
2022-06-09Fix exit locations test (#5995)Eileen M. Uchitelle
I originally added the check for RubyVM::YJIT.trace_exit_locations_enabled? to fix errors when these tests run without the stats feature enabled. However I forgot that this will never be true when this test is booting, so nothing was running when the stats feature is turned on. Instead I've decided to make a new hash in the dump file and check if exit locations are enabled there. If they aren't enabled we return early to avoid checking for keys that won't exit in the dumped exit locations. I chose to add this additional enabled check because empty exit locations might not indicate that stats isn't enabled, it could mean the feature is entirely broken. I do want these tests to fail if stats are on and nothing was collected. Followup to #5970 Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2022-06-10[ruby/fileutils] Enhanced RDoc (https://github.com/ruby/fileutils/pull/82)Burdette Lamar
Treats ::chmod; adds Pathname usage to ::install. https://github.com/ruby/fileutils/commit/9db4cb129c
2022-06-09[DOC] Fix markup for `String` (#5984)Alexander Ilyin
* Add missing space for `String#start_with?`. * Add missing pluses for `String#tr` and `Methods for Converting to New String` label. * Move quote into the tag for `Whitespace in Strings` label. Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2022-06-09Add ability to trace exit locations in yjit (#5970)Eileen M. Uchitelle
When running with `--yjit-stats` turned on, yjit can inform the user what the most common exits are. While this is useful information it doesn't tell you the source location of the code that exited or what the code that exited looks like. This change intends to fix that. To use the feature, run yjit with the `--yjit-trace-exits` option, which will record the backtrace for every exit that occurs. This functionality requires the stats feature to be turned on. Calling `--yjit-trace-exits` will automatically set the `--yjit-stats` option. Users must call `RubyVM::YJIT.dump_exit_locations(filename)` which will Marshal dump the contents of `RubyVM::YJIT.exit_locations` into a file based on the passed filename. *Example usage:* Given the following script, we write to a file called `concat_array.dump` the results of `RubyVM::YJIT.exit_locations`. ```ruby def concat_array ["t", "r", *x = "u", "e"].join end 1000.times do concat_array end RubyVM::YJIT.dump_exit_locations("concat_array.dump") ``` When we run the file with this branch and the appropriate flags the stacktrace will be recorded. Note Stackprof needs to be installed or you need to point to the library directly. ``` ./ruby --yjit --yjit-call-threshold=1 --yjit-trace-exits -I/Users/eileencodes/open_source/stackprof/lib test.rb ``` We can then read the dump file with Stackprof: ``` ./ruby -I/Users/eileencodes/open_source/stackprof/lib/ /Users/eileencodes/open_source/stackprof/bin/stackprof --text concat_array.dump ``` Results will look similar to the following: ``` ================================== Mode: () Samples: 1817 (0.00% miss rate) GC: 0 (0.00%) ================================== TOTAL (pct) SAMPLES (pct) FRAME 1001 (55.1%) 1001 (55.1%) concatarray 335 (18.4%) 335 (18.4%) invokeblock 178 (9.8%) 178 (9.8%) send 140 (7.7%) 140 (7.7%) opt_getinlinecache ...etc... ``` Simply inspecting the `concatarray` method will give `SOURCE UNAVAILABLE` because the source is insns.def. ``` ./ruby -I/Users/eileencodes/open_source/stackprof/lib/ /Users/eileencodes/open_source/stackprof/bin/stackprof --text concat_array.dump --method concatarray ``` Result: ``` concatarray (nonexistent.def:1) samples: 1001 self (55.1%) / 1001 total (55.1%) callers: 1000 ( 99.9%) Object#concat_array 1 ( 0.1%) Gem.suffixes callees (0 total): code: SOURCE UNAVAILABLE ``` However if we go deeper to the callee we can see the exact source of the `concatarray` exit. ``` ./ruby -I/Users/eileencodes/open_source/stackprof/lib/ /Users/eileencodes/open_source/stackprof/bin/stackprof --text concat_array.dump --method Object#concat_array ``` ``` Object#concat_array (/Users/eileencodes/open_source/rust_ruby/test.rb:1) samples: 0 self (0.0%) / 1000 total (55.0%) callers: 1000 ( 100.0%) block in <main> callees (1000 total): 1000 ( 100.0%) concatarray code: | 1 | def concat_array 1000 (55.0%) | 2 | ["t", "r", *x = "u", "e"].join | 3 | end ``` The `--walk` option is recommended for this feature as it make it easier to traverse the tree of exits. *Goals of this feature:* This feature is meant to give more information when working on YJIT. The idea is that if we know what code is exiting we can decide what areas to prioritize when fixing exits. In some cases this means adding prioritizing avoiding certain exits in yjit. In more complex cases it might mean changing the Ruby code to be more performant when run with yjit. Ultimately the more information we have about what code is exiting AND why, the better we can make yjit. *Known limitations:* * Due to tracing exits, running this on large codebases like Rails can be quite slow. * On complex methods it can still be difficult to pinpoint the exact cause of an exit. * Stackprof is a requirement to to view the backtrace information from the dump file. Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org> Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org> Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2022-06-10* 2022-06-10 [ci skip]git
2022-06-09Stop ignoring 4th positional argument to IO.#{foreach,readlines}Jeremy Evans
Fixes [Bug #18771] Notes: Merged: https://github.com/ruby/ruby/pull/5953
2022-06-09Skip `NULL` values from `dladdr(3)`xtkoba
Fixes [Bug #17810] Notes: Merged: https://github.com/ruby/ruby/pull/4438
2022-06-09[ruby/timeout] Keep a private reference to `Process.clock_gettime`Jean Boussier
`timeout 0.3.0` broke our test suite because we have some tests that stubs `Process.clock_gettime` making it return a value in the past, causing `Timeout` to trigger almost immediately. I beleive it wasn't a problem before because it was relying on `Process.sleep`. https://github.com/ruby/timeout/commit/e5911a303e
2022-06-09doc/case_mapping.rdoc: Fix references for case mappingYusuke Endoh
The chart (https://www.unicode.org/charts/case) that is currently referred seems to be wrong. Also, use the "latest" redirect and add titles of the section and table. [Bug #18590] Notes: Merged: https://github.com/ruby/ruby/pull/5607
2022-06-08Fix MJIT's ISEQ_BODY macro usage at 5f10bd634fbTakashi Kokubun
2022-06-08MJIT: Ignore existence of .bundle.dSYM on macOSTakashi Kokubun
We could fix it, but removing files in the directory recursively is tedious in C and --mjit-debug is not a concern for users. We have TestMJITDebug for detecting linker problems that are ignored by -O. It's not really for maintaining --mjit-debug itself.
2022-06-09Fix compile errorKazuhiro NISHIYAMA
``` compiling ../debug.c ../debug.c:452:1: error: conflicting types for 'ruby_debug_log_filter' ruby_debug_log_filter(const char *func_name, const char *file_name) ^ ../vm_debug.h:87:6: note: previous declaration is here bool ruby_debug_log_filter(const char *func_name); ^ 1 error generated. make: *** [debug.o] Error 1 ```
2022-06-09[ruby/fileutils] [DOC] Enhanced RDoc (https://github.com/ruby/fileutils/pull/81)Burdette Lamar
https://github.com/ruby/fileutils/commit/b9d5a79e38
2022-06-08MJIT: Directly compile .c to .so (#5987)Takashi Kokubun
I'm planning to redesign the MJIT worker pipeline, and this allows you to simplify the implementation and let it run efficiently except for MinGW. Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2022-06-09func: and file: prefix for `RUBY_DEBUG_LOG_FILTER`Koichi Sasada
`RUBY_DEBUG_LOG_FILTER` specified only function names but this patch also check file names for each log events. If you specify `file:` or `func:` prefix, it's only filter file names or func names (otherwize check both). foo # show log when file or func names are mached with foo func:foo # show log when func name matches foo file:foo # show log when file name matches foo -file:foo,func:bar # show log when file name does not contains foo # and func name matches bar Notes: Merged: https://github.com/ruby/ruby/pull/5988
2022-06-08Fix major GC thrashingPeter Zhu
Only growth heaps are allowed to start major GCs. Before this patch, growth heaps are defined as size pools that freed more slots than had empty slots (i.e. there were more dead objects that empty space). But if the size pool is relatively stable and tightly packed with mostly old objects and has allocatable pages, then it would be incorrectly classified as a growth heap and trigger major GC. But since it's stable, it would not use any of the allocatable pages and forever be classified as a growth heap, causing major GC thrashing. This commit changes the definition of growth heap to require that the size pool to have no allocatable pages. Notes: Merged: https://github.com/ruby/ruby/pull/5993
2022-06-09* 2022-06-09 [ci skip]git
2022-06-08Fix compilation error when USE_RVARGC=0Peter Zhu
force_major_gc_count was not defined when USE_RVARGC=0.
2022-06-08Add key force_major_gc_count to GC.stat_heapPeter Zhu
force_major_gc_count is the number of times the size pool forced major GC to run.
2022-06-08[ruby/fileutils] File trees (https://github.com/ruby/fileutils/pull/80)Burdette Lamar
Adds a note about file tree examples. https://github.com/ruby/fileutils/commit/65ac65067a
2022-06-08Update "Reporting Issues" link in the READMEAlexander Ilyin
This link is broken. Notes: Merged: https://github.com/ruby/ruby/pull/5989
2022-06-07Update the help message on /benchmarkTakashi Kokubun
I wanted to point out there's --output=all.
2022-06-08[DOC] RDoc now accepts other than magic numbers at `rb_attr`Nobuyoshi Nakada
2022-06-07Remove duplicated prototype in header filePeter Zhu
rb_imemo_new is defined again later in the file.
2022-06-07thread_pthread.c: trigger THREAD_EVENT_READY when going throuhg the fast path.Jean Boussier
Notes: Merged: https://github.com/ruby/ruby/pull/5985
2022-06-08* 2022-06-08 [ci skip]git
2022-06-07Add special-case code for the String unary plus operator (#5982)Noah Gibbs
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2022-06-07[rubygems/rubygems] Remove unnecessary string concatenationDaniel Berger
https://github.com/rubygems/rubygems/commit/81ccb3ab89
2022-06-07Remove while loop over heap_preparePeter Zhu
Having a while loop over `heap_prepare` makes the GC logic difficult to understand (it is difficult to understand when and why `heap_prepare` yields a free page). It is also a source of bugs and can cause an infinite loop if `heap_page` never yields a free page. Notes: Merged: https://github.com/ruby/ruby/pull/5907
2022-06-07[rubygems/rubygems] Relax performance spec limitDavid Rodríguez
https://github.com/rubygems/rubygems/commit/eab417d0ce
2022-06-07Refactor TestThreadInstrumentation to investigate CI flakinessJean Boussier
`test_thread_instrumentation_fork_safe` has been failing occasionaly on Ubuntu and Arch. At this stage we're not sure why, all we know is that the child exit with status 1. I suspect that something entirely unrelated cause the forked children to fail on exit, so by using `exit!(0)` and doing assertions in the parent I hope to be resilient to that. Notes: Merged: https://github.com/ruby/ruby/pull/5983
2022-06-07[ruby/error_highlight] Use Exception#detailed_message instead of overriding ↵Yusuke Endoh
#message (https://github.com/ruby/error_highlight/pull/24) See https://bugs.ruby-lang.org/issues/18564. Ref: https://github.com/ruby/did_you_mean/pull/177 https://github.com/ruby/error_highlight/commit/671b7c61b2
2022-06-07Manually merged https://github.com/ruby/did_you_mean/pull/177Hiroshi SHIBATA
2022-06-07Revert "error.c: Let Exception#inspect inspect its message"Yusuke Endoh
This reverts commit 9d927204e7b86eb00bfd07a060a6383139edf741. Notes: Merged: https://github.com/ruby/ruby/pull/5981
2022-06-07[ruby/rdoc] [DOC] Undocument internal constants [ci skip]Nobuyoshi Nakada
https://github.com/ruby/rdoc/commit/6d7bf24bb8
2022-06-07error.c: Let Exception#inspect inspect its messageYusuke Endoh
... only when the message string has a newline. `p StandardError.new("foo\nbar")` now prints `#<StandardError: "foo\nbar">' instead of: #<StandardError: bar> [Bug #18170] Notes: Merged: https://github.com/ruby/ruby/pull/4857
2022-06-07[ruby/rdoc] Allow boolean arguments to `rb_attr` and `rb_define_attr`Nobuyoshi Nakada
Currently only literal `0` and `1` are accepted as `read`/`write` flags. This patch allows other boolean arguments, C macros (`FALSE`/`TRUE`), Ruby `VALUE`s (`Qfalse`/`Qtrue`), and C99 `bool`s (`false`/`true`), as well. https://github.com/ruby/rdoc/commit/169dc02e3c