summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-06-14* 2022-06-14 [ci skip]git
2022-06-14[ruby/fileutils] [DOC] Clarify path arguments ↵Burdette Lamar
(https://github.com/ruby/fileutils/pull/85) https://github.com/ruby/fileutils/commit/5f9ef9ddc8
2022-06-13[ruby/fileutils] [DOC] Enhanced Rdoc (https://github.com/ruby/fileutils/pull/84)Burdette Lamar
Treats: ::chown_R ::touch ::commands ::options ::have_option? ::options_of ::collect_method https://github.com/ruby/fileutils/commit/5df0324f52
2022-06-13[ruby/reline] Revert "Merge pull request #441 from ↵st0012
nevans/workaround-linker-script-so" This reverts commit https://github.com/ruby/reline/commit/4ccf128ffa18, reversing changes made to https://github.com/ruby/reline/commit/a2651419e9a0. https://github.com/ruby/reline/commit/51053138a4
2022-06-13Enable "make annocheck" on platforms other than Linux.Jun Aruga
The annocheck supports ELF format binaries compiled for any OS and for any architecture. It can work in not only Linux but also FreeBSD and Solaris. It is designed to be independent of the host OS and the architecture. Even in Mac, as the binaries are Mach-O foramt, the annocheck fails correctly with the message. e.g. Test binaries compiled for Mac OSX 10.13.6 (target_os: darwin17) in Fedora 35. ``` $ cat /etc/fedora-release Fedora release 35 (Thirty Five) $ file ruby ruby: Mach-O 64-bit x86_64 executable, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|WEAK_DEFINES|BINDS_TO_WEAK|PIE> $ annocheck ruby annocheck: Version 10.66. annocheck: Warning: ruby: is not an ELF format file. ``` See <https://sourceware.org/bugzilla/show_bug.cgi?id=29173> for details. Notes: Merged: https://github.com/ruby/ruby/pull/5916
2022-06-13compile.c (add_adjust_info): Remove `insns_info_index > 0`Yusuke Endoh
... because insns_info_index could not be zero here. Also it adds an invariant check for that. This change will prevent the following warning of GCC 12.1 http://rubyci.s3.amazonaws.com/arch/ruby-master/log/20220613T000004Z.log.html.gz ``` compile.c:2230:39: warning: array subscript 2147483647 is outside array bounds of ‘struct iseq_insn_info_entry[2147483647]’ [-Warray-bounds] 2230 | insns_info[insns_info_index-1].line_no != adjust->line_no) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ ``` Notes: Merged: https://github.com/ruby/ruby/pull/6008
2022-06-13cont.c: prevent a warning of GCC 12.1Yusuke Endoh
... by assigning a dummy value to the allocated stack. http://rubyci.s3.amazonaws.com/arch/ruby-master/log/20220613T000004Z.log.html.gz ``` cont.c: In function ‘cont_restore_0.constprop’: cont.c:1489:28: warning: ‘*sp’ may be used uninitialized [-Wmaybe-uninitialized] 1489 | space[0] = *sp; | ^~~ ``` Also it adds some comments about the hack of dummy stack allocation. Notes: Merged: https://github.com/ruby/ruby/pull/6010
2022-06-13Handle case where write result is zero.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/6009
2022-06-13[ruby/reline] Check the ambiguous char width only on ttyNobuyoshi Nakada
It sent the char to check even to non-tty, e.g., pipe. This causes `unknown command: "\xE2\x96\xBDstart ` warnings on ruby's parallel test on Windows, where non-standard FDs cannot be passed to child processes. https://github.com/ruby/reline/commit/0d373647fb
2022-06-13Prevent a "warning: `*' interpreted as argument prefix"Yusuke Endoh
2022-06-13* 2022-06-13 [ci skip]git
2022-06-13Prevent a warning: assigned but unused variable - outYusuke Endoh
http://rubyci.s3.amazonaws.com/ubuntu1804/ruby-master/log/20220613T003003Z.log.html.gz ``` /home/chkbuild/chkbuild/tmp/build/20220613T003003Z/ruby/test/ruby/test_yjit_exit_locations.rb:96: warning: assigned but unused variable - out /home/chkbuild/chkbuild/tmp/build/20220613T003003Z/ruby/test/ruby/test_yjit_exit_locations.rb:96: warning: assigned but unused variable - err /home/chkbuild/chkbuild/tmp/build/20220613T003003Z/ruby/test/ruby/test_yjit_exit_locations.rb:96: warning: assigned but unused variable - status ```
2022-06-12* 2022-06-12 [ci skip]git
2022-06-12[rubygems/rubygems] Don't on gemspecs with invalid `require_paths`, just warnDavid Rodríguez
These gemspecs already work most of the times. When they are installed normally, the require_paths in the gemspec stub line becomes actually correct, and the incorrect value in the real gemspec is ignored. It only becomes an issue in standalone mode. In Ruby 3.2, `Kernel#=~` has been removed, and that means that it becomes harder for us to gracefully deal with this error in standalone mode, because it now happens earlier due to calling `Array#=~` for this invalid gemspec (since require_paths is incorrectly an array of arrays). The easiest way to fix this is to actually make this just work instead by automatically fixing the issue when reading the packaged gemspec. https://github.com/rubygems/rubygems/commit/d3f2fe6d26
2022-06-11Fix typo in yjit.c comments [ci skip]Takayoshi Nishida
Notes: Merged: https://github.com/ruby/ruby/pull/6007 Merged-By: nobu <nobu@ruby-lang.org>
2022-06-11[rubygems/rubygems] Reuse package from the installer for extracting the ↵David Rodríguez
specification Previously we would instantiate two different packages and extract the specification from the package twice for each gem installed. We can reuse the installer for this so that we just need to do it once. https://github.com/rubygems/rubygems/commit/e454f850b1
2022-06-11[rubygems/rubygems] Move security exception handling to the only place using itDavid Rodríguez
https://github.com/rubygems/rubygems/commit/ba975b3b7f
2022-06-11[rubygems/rubygems] Swapping should not raise any errorsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/600a9ac658
2022-06-11[rubygems/rubygems] Remove unclear commentDavid Rodríguez
This is the explanation of why we do the swapping, not of why we download the gem. https://github.com/rubygems/rubygems/commit/1a25eb7e7b
2022-06-11[rubygems/rubygems] `Gem::Specification.loaded_from` is already set by the ↵David Rodríguez
installer https://github.com/rubygems/rubygems/commit/796eebfdbf
2022-06-11[rubygems/rubygems] Refactor some more duplicated logicDavid Rodríguez
https://github.com/rubygems/rubygems/commit/9bd389e1b6
2022-06-11[rubygems/rubygems] Move `no_install` setting check to a more sensible placeDavid Rodríguez
It's only related to the `bundle cache` command, so it should be checked there. https://github.com/rubygems/rubygems/commit/cf749f8ffa
2022-06-11[rubygems/rubygems] No need to redownload if package already thereDavid Rodríguez
https://github.com/rubygems/rubygems/commit/285ccbc07e
2022-06-11[rubygems/rubygems] No need to overwrite path when there's a remoteDavid Rodríguez
https://github.com/rubygems/rubygems/commit/d86fb2c316
2022-06-11[rubygems/rubygems] Remove another unnecessary requireDavid Rodríguez
https://github.com/rubygems/rubygems/commit/04e6a5ae31
2022-06-11[rubygems/rubygems] Simplify `Gem::Security::Exception` handlingDavid Rodríguez
These days all these errors are raised as `Gem::Security::Exception` so there's no need to do any matching on the exception message. https://github.com/rubygems/rubygems/commit/bd3403da57
2022-06-11[rubygems/rubygems] Remove unnecessary requireDavid Rodríguez
The `security_policies` method already requires it. https://github.com/rubygems/rubygems/commit/d19b088f2f
2022-06-11[rubygems/rubygems] Remove unnecessary `spec.remote` guardDavid Rodríguez
It's checked before calling the method already. https://github.com/rubygems/rubygems/commit/4eb00e9586
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