aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [ruby/rdoc] Move dev dependency of gettext to Gemfileaycabta2021-08-102-1/+1
| | | | https://github.com/ruby/rdoc/commit/a177377b6f
* [ruby/rdoc] Use single quote in Gemfileaycabta2021-08-101-6/+6
| | | | https://github.com/ruby/rdoc/commit/e4b68d414c
* Import copied Gemfile from original RDoc repositoryaycabta2021-08-101-0/+12
|
* Import Gemfile and Rakefile of rdoc by tool/sync_default_gems.rbaycabta2021-08-101-0/+2
|
* VC warns the same attribute used more than onceNobuyoshi Nakada2021-08-091-1/+1
|
* Include ruby.h before internal headers to suppress -Wundef warningsNobuyoshi Nakada2021-08-091-0/+1
|
* Omit on Readline 7.0 because it's wrong behaviour for not TTY envaycabta2021-08-091-0/+1
|
* Rename rb_iterate to get rid of name clash on Sun CNobuyoshi Nakada2021-08-092-3/+3
|
* Extended logging for debugging readline failures.Samuel Williams2021-08-091-4/+7
|
* Suppress a clobbered warningNobuyoshi Nakada2021-08-091-4/+3
|
* Deprecate rb_iterate in C++Nobuyoshi Nakada2021-08-091-0/+2
|
* Suppress deprecated rb_iterate declaration warnings in C++Nobuyoshi Nakada2021-08-092-2/+10
|
* Suppress warnings in C++2aNobuyoshi Nakada2021-08-093-5/+6
| | | | | | | | | * bitwise operation between different enumeration types ('ruby_value_type' and 'ruby_fl_type') is deprecated [-Wdeprecated-enum-enum-conversion] * volatile-qualified parameter type 'volatile int' is deprecated [-Wdeprecated-volatile]
* Suppress unused-function warning when OPT_THREADED_CODE != 1Nobuyoshi Nakada2021-08-091-0/+1
|
* Suppress unused-variable warnings when DEBUG_INTEGER_PACKNobuyoshi Nakada2021-08-091-0/+2
|
* * 2021-08-09 [ci skip]git2021-08-091-1/+1
|
* Rework the readline test to be more robust.Samuel Williams2021-08-091-46/+43
| | | | | | - Capture that the child is started by initial log line. - More robust handling of child status reaping. - Direct exit without sucess mesage if `#readline` receives input.
* Reduce chance to receive EBADF when closing an IO from another thread.Samuel Williams2021-08-081-19/+27
|
* Make bit flags `reason` unsignedNobuyoshi Nakada2021-08-081-26/+26
|
* Use #full_message instead of #backtrace_locationsaycabta2021-08-081-1/+1
|
* Suppress warnings when GC_ENABLE_INCREMENTAL_MARK == 0Nobuyoshi Nakada2021-08-081-8/+7
|
* * 2021-08-08 [ci skip]git2021-08-081-1/+1
|
* Show backtrace locations when I/O timed outaycabta2021-08-081-2/+2
|
* Use TERM=xterm for tests on Solarisaycabta2021-08-071-1/+1
|
* Set TERM env for some CI environmentsaycabta2021-08-072-2/+3
|
* Group commands on GitHub ActionsNobuyoshi Nakada2021-08-075-1/+43
|
* Remove unneeded rb_fiber_transfer_kw declarationS-H-GAMELINKS2021-08-071-2/+0
|
* Suppress unused-result warningsS.H2021-08-071-2/+6
| | | | | | | * Hide read function warning in string_spec_RSTRING_PTR_read function * The type of `read` may be `ssize_t` Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
* Stop force-recycling evacuated array [Bug #18065]Nobuyoshi Nakada2021-08-071-1/+0
|
* Use Rational for Float#round with ndigits > 14Jeremy Evans2021-08-064-0/+19
| | | | | | | | | | | ndigits higher than 14 can result in values that are slightly too large due to floating point limitations. Converting to rational for the calculation and then back to float fixes these issues. Fixes [Bug #14635] Fixes [Bug #17183] Co-authored by: Yusuke Endoh <mame@ruby-lang.org>
* * 2021-08-07 [ci skip]git2021-08-071-1/+1
|
* Make backtrace generation work outward from current frameJeremy Evans2021-08-062-295/+209
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes multiple bugs found in the partial backtrace optimization added in 3b24b7914c16930bfadc89d6aff6326a51c54295. These bugs occurs when passing a start argument to caller where the start argument lands on a iseq frame without a pc. Before this commit, the following code results in the same line being printed twice, both for the #each method. ```ruby def a; [1].group_by { b } end def b; puts(caller(2, 1).first, caller(3, 1).first) end a ``` After this commit and in Ruby 2.7, the lines are different, with the first line being for each and the second for group_by. Before this commit, the following code can either segfault or result in an infinite loop: ```ruby def foo caller_locations(2, 1).inspect # segfault caller_locations(2, 1)[0].path # infinite loop end 1.times.map { 1.times.map { foo } } ``` After this commit, this code works correctly. This commit completely refactors the backtrace handling. Instead of processing the backtrace from the outermost frame working in, process it from the innermost frame working out. This is much faster for partial backtraces, since you only access the control frames you need to in order to construct the backtrace. To handle cfunc frames in the new design, they start out with no location information. We increment a counter for each cfunc frame added. When an iseq frame with pc is accessed, after adding the iseq backtrace location, we use the location for the iseq backtrace location for all of the directly preceding cfunc backtrace locations. If the last backtrace line is a cfunc frame, we continue scanning for iseq frames until the end control frame, and use the location information from the first one for the trailing cfunc frames in the backtrace. As only rb_ec_partial_backtrace_object uses the new backtrace implementation, remove all of the function pointers and inline the functions. This makes the process easier to understand. Restore the Ruby 2.7 implementation of backtrace_each and use it for all the other functions that called backtrace_each other than rb_ec_partial_backtrace_object. All other cases requested the entire backtrace, so there is no advantage of using the new algorithm for those. Additionally, there are implicit assumptions in the other code that the backtrace processing works inward instead of outward. Remove the cfunc/iseq union in rb_backtrace_location_t, and remove the prev_loc member for cfunc. Both cfunc and iseq types can now have iseq and pc entries, so the location information can be accessed the same way for each. This avoids the need for a extra backtrace location entry to store an iseq backtrace location if the final entry in the backtrace is a cfunc. This is also what fixes the segfault and infinite loop issues in the above bugs. Here's Ruby pseudocode for the new algorithm, where start and length are the arguments to caller or caller_locations: ```ruby end_cf = VM.end_control_frame.next cf = VM.start_control_frame size = VM.num_control_frames - 2 bt = [] cfunc_counter = 0 if length.nil? || length > size length = size end while cf != end_cf && bt.size != length if cf.iseq? if cf.instruction_pointer? if start > 0 start -= 1 else bt << cf.iseq_backtrace_entry cf_counter.times do |i| bt[-1 - i].loc = cf.loc end cfunc_counter = 0 end end elsif cf.cfunc? if start > 0 start -= 1 else bt << cf.cfunc_backtrace_entry cfunc_counter += 1 end end cf = cf.prev end if cfunc_counter > 0 while cf != end_cf if (cf.iseq? && cf.instruction_pointer?) cf_counter.times do |i| bt[-i].loc = cf.loc end end cf = cf.prev end end ``` With the following benchmark, which uses a call depth of around 100 (common in many Ruby applications): ```ruby class T def test(depth, &block) if depth == 0 yield self else test(depth - 1, &block) end end def array Array.new end def first caller_locations(1, 1) end def full caller_locations end end t = T.new t.test((ARGV.first || 100).to_i) do Benchmark.ips do |x| x.report ('caller_loc(1, 1)') {t.first} x.report ('caller_loc') {t.full} x.report ('Array.new') {t.array} x.compare! end end ``` Results before commit: ``` Calculating ------------------------------------- caller_loc(1, 1) 281.159k (_ 0.7%) i/s - 1.426M in 5.073055s caller_loc 15.836k (_ 2.1%) i/s - 79.450k in 5.019426s Array.new 1.852M (_ 2.5%) i/s - 9.296M in 5.022511s Comparison: Array.new: 1852297.5 i/s caller_loc(1, 1): 281159.1 i/s - 6.59x (_ 0.00) slower caller_loc: 15835.9 i/s - 116.97x (_ 0.00) slower ``` Results after commit: ``` Calculating ------------------------------------- caller_loc(1, 1) 562.286k (_ 0.8%) i/s - 2.858M in 5.083249s caller_loc 16.402k (_ 1.0%) i/s - 83.200k in 5.072963s Array.new 1.853M (_ 0.1%) i/s - 9.278M in 5.007523s Comparison: Array.new: 1852776.5 i/s caller_loc(1, 1): 562285.6 i/s - 3.30x (_ 0.00) slower caller_loc: 16402.3 i/s - 112.96x (_ 0.00) slower ``` This shows that the speed of caller_locations(1, 1) has roughly doubled, and the speed of caller_locations with no arguments has improved slightly. So this new algorithm is significant faster, much simpler, and fixes bugs in the previous algorithm. Fixes [Bug #18053]
* Make jobserver availableNobuyoshi Nakada2021-08-061-1/+1
|
* Check the result of tigetstrNobuyoshi Nakada2021-08-062-1/+14
|
* Fix caching of curses_dlNobuyoshi Nakada2021-08-061-2/+3
|
* test/reline/test_terminfo.rb: skip when setupterm failsYusuke Endoh2021-08-061-0/+2
| | | | | | | | | | | http://rubyci.s3.amazonaws.com/solaris11-gcc/ruby-master/log/20210806T000008Z.fail.html.gz ``` 1) Error: Reline::Terminfo::Test#test_tigetstr: Reline::Terminfo::TerminfoError: The terminfo database could not be found. /export/home/chkbuild/chkbuild-gcc/tmp/build/20210806T000008Z/ruby/lib/reline/terminfo.rb:84:in `setupterm' /export/home/chkbuild/chkbuild-gcc/tmp/build/20210806T000008Z/ruby/test/reline/test_terminfo.rb:6:in `setup' ```
* Show Readline::VERSION for debuggingaycabta2021-08-061-1/+1
|
* * 2021-08-06 [ci skip]git2021-08-061-1/+1
|
* Omit test_interrupt_in_other_thread with Editlineaycabta2021-08-061-0/+1
|
* Fix reversal of assertion resultaycabta2021-08-061-1/+1
|
* Fix control structure to preperly catch Timeout::Erroraycabta2021-08-061-25/+27
|
* Fix the result of checking the existence of constants being reversedaycabta2021-08-061-1/+1
|
* Build rubyspec CAPI extensionsNobuyoshi Nakada2021-08-051-0/+4
|
* Show log when timed outaycabta2021-08-051-1/+1
|
* Remove an unused variableaycabta2021-08-041-1/+1
|
* Fix a link [ci skip]Kazuhiro NISHIYAMA2021-08-051-0/+1
|
* Show WorkingSetSize as RSS on WindowsNobuyoshi Nakada2021-08-052-6/+18
|
* check GC.enable'd statusKoichi Sasada2021-08-054-12/+38
| | | | | | | Check GC.enable'd status before and after test execution. Write this checker in gc_checker.rb, it was renamed from gc_compact_checker.rb.
* Revert "Removed extinit.o from main programs"Yusuke Endoh2021-08-052-4/+3
| | | | | | This reverts commit ac86fcbfd0bab8667d277aa575bc5b81e5135d3c. This change broke "--disable-shared --with-static-linked-ext".
* Use equivalent `__FILE__`Nobuyoshi Nakada2021-08-051-1/+1
|