summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-08-12Revert "Improve performance of partial backtraces"Jeremy Evans
This reverts commit f2d7461e85053cb084e10999b0b8019b0c29e66e. Some CI machines are reporting issues with backtrace_mark, so I'm going to revert this for now.
2020-08-13* 2020-08-13 [ci skip]git
2020-08-12Improve performance of partial backtracesJeremy Evans
Previously, backtrace_each fully populated the rb_backtrace_t with all backtrace frames, even if caller only requested a partial backtrace (e.g. Kernel#caller_locations(1, 1)). This changes backtrace_each to only add the requested frames to the rb_backtrace_t. To do this, backtrace_each needs to be passed the starting frame and number of frames values passed to Kernel#caller or #caller_locations. backtrace_each works from the top of the stack to the bottom, where the bottom is the current frame. Due to how the location for cfuncs is tracked using the location of the previous iseq, we need to store an extra frame for the previous iseq if we are limiting the backtrace and final backtrace frame (the first one stored) would be a cfunc and not an iseq. To limit the amount of work in this case, while scanning until the start of the requested backtrace, for each iseq, store the cfp. If the first backtrace frame we care about is a cfunc, use the stored cfp to find the related iseq. Use a function pointer to handle the storage of the cfp in the iteration arg, and also store the location of the extra frame in the iteration arg. backtrace_each needs to return int instead of void in order to signal when a starting frame larger than backtrace size is given, as caller and caller_locations needs to return nil and not the empty array in these cases. To handle cases where a range is provided with a negative end, and the backtrace size is needed to calculate the result to pass to rb_range_beg_len, add a backtrace_size static function to calculate the size, which copies the logic from backtrace_each. As backtrace_each only adds the backtrace lines requested, backtrace_to_*_ary can be simplified to always operate on the entire backtrace. Previously, caller_locations(1,1) was about 6.2 times slower for an 800 deep callstack compared to an empty callstack. With this new approach, it is only 1.3 times slower. It will always be somewhat slower as it still needs to scan the cfps from the top of the stack until it finds the first requested backtrace frame. Fixes [Bug #17031] Notes: Merged: https://github.com/ruby/ruby/pull/3357
2020-08-12Fix corruption in ARGF.inplacePeter Zhu
Extension string stored in `ARGF.inplace` is created using an api designed for C string constants to create a Ruby string that points at another Ruby string. When the original string is swept, the extension string gets corrupted. Reproduction script (on MacOS): ```ruby #!/usr/bin/ruby -pi.bak BEGIN { GC.start(full_mark: true) arr = [] 1000000.times do |x| arr << "fooo#{x}" end } puts "hello" ``` Co-Authored-By: Matt Valentine-House <31869+eightbitraptor@users.noreply.github.com> Notes: Merged: https://github.com/ruby/ruby/pull/3409 Merged-By: nobu <nobu@ruby-lang.org>
2020-08-12string.c(rb_str_split_m): Handle /\K/ correctlyKasumi Hanazuki
Use BEG(0) instead of the result of rb_reg_search to handle the cases when the separator Regexp contains /\K/ (lookbehind) operator. Fixes [Bug #17113] Notes: Merged: https://github.com/ruby/ruby/pull/3407
2020-08-12* 2020-08-12 [ci skip]git
2020-08-11Test out fix for OpenSSL test flakinessAlan Wu
`OpenSSL::TestX509Store#test_verify` has been failing intermittently on CI about once a day: - http://ci.rvm.jp/results/trunk-random2@phosphorus-docker/3121244 - http://ci.rvm.jp/results/trunk-random1@phosphorus-docker/3117661 - http://ci.rvm.jp/results/trunk-random1@phosphorus-docker/3111684 According to the test: > OpenSSL uses time(2) while Time.now uses clock_gettime(CLOCK_REALTIME), > and there may be difference. This difference is could be the cause for the flaky failures. Let's see if giving the certificate more room solves the problem. In any case, I will revert this in a week. I think changes to these should go to https://github.com/ruby/openssl/? Notes: Merged: https://github.com/ruby/ruby/pull/3406
2020-08-11Enable s390x invokebuiltin JIT test againTakashi Kokubun
2020-08-11Use colorize.rb for non-capable terminalsNobuyoshi Nakada
2020-08-11Add default color for each instanceNobuyoshi Nakada
2020-08-11template/prelude.c.tmpl: suppress clang-12 warning卜部昌平
Clang 12 warns "suspicious concatenation of string literals in an array initialization", which is rather annoying than useful in this context. Notes: Merged: https://github.com/ruby/ruby/pull/3405
2020-08-11.github/workflows/compilers.yml: clang-12卜部昌平
LLVM made release/11.x branch. Its master is now version 12. Notes: Merged: https://github.com/ruby/ruby/pull/3405
2020-08-11tool/prelude.c.tmpl: use RubyVM::CEscape卜部昌平
Do not repeat yourself. Notes: Merged: https://github.com/ruby/ruby/pull/3405
2020-08-11RubyVM::CEscape#rstring2cstr: do not escape '卜部昌平
A single quote "is representable either by itself or by the escape sequence", according to ISO/IEC 9899 (checked all versions). So this is not a bug fix. But the generated output is a bit readable without backslashes. Notes: Merged: https://github.com/ruby/ruby/pull/3405
2020-08-10Add Method Documentation Guide (#3399)Jeremy Evans
This documents how methods for core classes and classes in the standard library should be documented. Co-authored-by: Eric Hodel <drbrain@segment7.net> Notes: Merged-By: jeremyevans <code@jeremyevans.net>
2020-08-11* 2020-08-11 [ci skip]git
2020-08-10Enhanced RDoc for Array (#3400)Burdette Lamar
Methods: drop drop_while any? all? none? one? Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2020-08-10Removed non-ASCII code to suppress warnings by localized compilersNobuyoshi Nakada
2020-08-10Check if C-sources are US-ASCIINobuyoshi Nakada
Encoding of C-sources can not be determined, and non-ASCII code are often warned by localized compilers.
2020-08-10Suppress unused-variable warningNobuyoshi Nakada
`key` is not used outside this assertion.
2020-08-10Suppress unused-function warningsNobuyoshi Nakada
Calls with a constant argument should be optimized away.
2020-08-10* 2020-08-10 [ci skip]git
2020-08-10Adjust indentNobuyoshi Nakada
2020-08-08* 2020-08-08 [ci skip]git
2020-08-07Enhanced RDoc for Array#take and Array#take_while (#3398)Burdette Lamar
Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2020-08-07Enhanced RDoc for Array#product (#3395)Burdette Lamar
Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2020-08-07sync NDEBUG, RUBY_DEBUG, and RUBY_NDEBUG (#3327)卜部昌平
- When NDEBUG is defined that shall be honoured. - When RUBY_DEBUG is defined that shall be honoured. - When both are defined and they conflict, warnings shall be rendered. - When nothing is specified, nothing shall happen. Notes: Merged-By: shyouhei <shyouhei@ruby-lang.org>
2020-08-07Use zlib provided by vcpkg in mswin CI (#3397)Hiroshi SHIBATA
* Revert "mswin build - install src zlib files after checkout" This reverts commit b6175c9e4fe25b978252d8998fe791d65d998fc5. * Revert "mswin build - install src zlib files" This reverts commit bf758ef8b4e2895bf71a611a7ab2a4f236e260ea. Notes: Merged-By: hsbt <hsbt@ruby-lang.org>
2020-08-07* 2020-08-07 [ci skip]git
2020-08-07Add more debug info to test_verifyKazuhiro NISHIYAMA
http://ci.rvm.jp/results/trunk-random1@phosphorus-docker/3111684
2020-08-06Add verbose message to random failed assertionKazuhiro NISHIYAMA
for example: http://ci.rvm.jp/results/trunk-random1@phosphorus-docker/3111251 http://ci.rvm.jp/results/trunk-random1@phosphorus-docker/3109195
2020-08-06[Feature #16513] TracePoint#inspect returns "... file:line" (#3391)Nguyễn Quang Minh
* Fix debug documents to match Thread#to_s change (Feature #16412 ticket) * TracePoint#inspect returns "... file:line" (Feature #16513) * Guard older version of Ruby in Tracepoint inspection tests * Focus on current thread only when running TracePoint inspection test Notes: Merged-By: ko1 <ko1@atdot.net>
2020-08-06Apply timeout-scale to test_thr_kill.Jun Aruga
Notes: Merged: https://github.com/ruby/ruby/pull/3380
2020-08-06* 2020-08-06 [ci skip]git
2020-08-05Enhanced documentation for Array#repeated_combination (#3392)Burdette Lamar
* Enhanced documentation for Array#repeated_combination * Enhanced documentation for Array#repeated_combination Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2020-08-05Enhanced documentation for Array#repeated_permutation (#3390)Burdette Lamar
* Enhanced documentation for Array#repeated_permutation * Enhanced documentation for Array#repeated_permutation Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2020-08-05Fixed the inconsistency gemspec location with net-* gems.Hiroshi SHIBATA
2020-08-05* 2020-08-05 [ci skip]git
2020-08-05[DOC] Use oracle url instead of sun urlS-H-GAMELINKS
[ci skip] Notes: Merged: https://github.com/ruby/ruby/pull/3389
2020-08-03Remove unused struct memberAaron Patterson
I accidentally added this in 35ba2783fe6b3316a6bbc6f00bf975ad7185d6e0, and it's making the size of RVALUE be too big. I'm sorry! orz Notes: Merged: https://github.com/ruby/ruby/pull/3388
2020-08-04* 2020-08-04 [ci skip]git
2020-08-03Don't pin objects if we're just walking the heapAaron Patterson
Walking the heap can inadvertently pin objects. Only mark the object's pin bit if the mark_func_data pointer is NULL (similar to the mark bits) Notes: Merged: https://github.com/ruby/ruby/pull/3387
2020-08-03[ruby/weakref] Use Gemfile instead of ↵Hiroshi SHIBATA
Gem::Specification#add_development_dependency. https://github.com/ruby/weakref/commit/10d547ba12
2020-08-03[ruby/ostruct] Drop to Ruby 2.4Hiroshi SHIBATA
https://github.com/ruby/ostruct/commit/00e8fe3df2
2020-08-03[ruby/net-http] Fix SSL session reuse test with LibreSSL 3.2+Jeremy Evans
https://github.com/ruby/net-http/commit/5ae9620fbc
2020-08-03[ruby/net-http] Switch invalid server name formatJeremy Evans
invalid_servername is not a valid name in an SSL request due to the use of the underscore, and LibreSSL 3.2.0 will raise an exception for this. These tests are not testing the allowed characters in the server name, but how net/http handles cases where the server name provided does not match the IP address you are trying to connect to, so I think it's better to just modify the tests to use a correct format. While here, fix a typo in a test name, and use better code in the ensure block so the same test doesn't issue both a failure and an error. https://github.com/ruby/net-http/commit/0e8dc91120
2020-08-03[ruby/cgi] Drop to Ruby 2.4Hiroshi SHIBATA
https://github.com/ruby/cgi/commit/8a86536e94
2020-08-03net-ftp is under `lib/net` instead of `lib/net/ftp`Hiroshi SHIBATA
2020-08-03Followed up b2d96abb42abbe2e01f010ffc9ac51f0f9a50002 for net-ftp.Hiroshi SHIBATA
2020-08-03* 2020-08-03 [ci skip]git