aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* merge revision(s) 5d815542815fe8b939239750bba7f8f0b79c97d6: [Backport #18154]NAKAMURA Usaku2021-11-243-2/+12
| | | | | | | | | | | [Bug #18154] Fix memory leak in String#initialize String#initialize can leak memory when called on a string that is marked with STR_NOFREE because it does not unset the STR_NOFREE flag. --- string.c | 2 +- test/ruby/test_string.rb | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-)
* merge revision(s) d795f494a89e0d9498dfedc54b8a98acc2bc4d7b: [Backport #17794]NAKAMURA Usaku2021-11-242-1/+3
| | | | | | | | | Avoid `free(3)`ing invalid pointer Fixes [Bug #17794] --- addr2line.c | 2 ++ 1 file changed, 2 insertions(+)
* merge revision(s) 345db8f2aa373a31c619c8f85bd372f0a20829c1: [Backport #10902]NAKAMURA Usaku2021-11-242-2/+7
| | | | | | | | | | | | | | | | | | | | | Avoid pointless attempts to open .so file if already required When attempting to require a file without an extension that has already been required or provided with an .so extension, only look for files with an .rb extension. There is no point in trying to find files with an .so extension, since we already know one has been loaded. Previously, attempting to require such a file scanned the load path twice, once for .rb and once for .so. Now it only scans once for .rb. The scan once for .rb cannot be avoided, since the .rb file would take precedence and should be loaded if it exists. Fixes [Bug #10902] --- load.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
* merge revision(s) b360588cd3cbac5fb4f004aa53a8fdc715906719: [Backport #15856]NAKAMURA Usaku2021-11-242-8/+46
| | | | | | | | | | | | | | | Sort feature index arrays by the priority of file types [Bug #15856] When looking for libraries to load with a feature name without extension, `.rb` files are given priority. However, since the feature index arrays were not in that order of priority, but in the order in which they were loaded, a lower priority extension library might be returned. In that case, the `.rb` file had to be searched for again from the `$LOAD_PATH`, resulting in poor performance. --- load.c | 52 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 7 deletions(-)
* merge revision(s) ↵NAKAMURA Usaku2021-11-242-18/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 25e56fe374478a2266ac25f22a07bb3c6a423c83,8758b07b1e4fd636dffb4b442388a3033c63d4b5,791e8eec66d3aebcee36c1369b0bf52bc3815e94: [Backport #18016] [ruby/fiddle] Fix Win32Types for Windows 64-bit (#63) https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types https://github.com/ruby/fiddle/commit/28ee5b1608 --- ext/fiddle/lib/fiddle/types.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) [ruby/fiddle] Fix more Win32Types definitions https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types https://github.com/ruby/fiddle/commit/805c1a595a --- ext/fiddle/lib/fiddle/types.rb | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) [ruby/fiddle] win32types: sort https://github.com/ruby/fiddle/commit/35dec6c5a5 --- ext/fiddle/lib/fiddle/types.rb | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-)
* Merge date-3.0.3Hiroshi SHIBATA2021-11-246-102/+401
|
* Fix clang -Wcompound-token-split-by-macro warning in ruby.hDimitry Andric2021-11-241-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Building certain ruby gem native extensions (such as thrift), with clang 12.0.0 or later fails, because they have -Werror in their CFLAGS, resulting in complaints about the expansion of the `rb_intern()` macro: ``` current directory: /wrkdirs/usr/ports/devel/rubygem-thrift/work/stage/usr/local/lib/ruby/gems/2.7/gems/thrift-0.14.0/ext make "DESTDIR=" compiling binary_protocol_accelerated.c binary_protocol_accelerated.c:404:68: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro] VALUE thrift_binary_protocol_class = rb_const_get(thrift_module, rb_intern("BinaryProtocol")); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/include/ruby-2.7/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ binary_protocol_accelerated.c:404:68: note: '{' token is here VALUE thrift_binary_protocol_class = rb_const_get(thrift_module, rb_intern("BinaryProtocol")); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/include/ruby-2.7/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/include/ruby-2.7/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' { \ ^ ``` Part of the `rb_intern()` macro expands to `(RUBY_CONST_ID_CACHE((ID), (str)))`, and in turn `RUBY_CONST_ID_CACHE()` expands to a brace enclosed compound statement. The intended effect is to get a gcc statement expression, which is normally delimited by `({ ... })`. However, clang 12.0.0 and later have a warning enabled by default, about pasting together the `(` and `{` tokens via different macros (see <https://github.com/llvm/llvm-project/commit/0e00a95b4fad5e72851de012d3a0b2c2d01f8685>). To work around this warning: * Add `RUBY_CONST_ID_CACHE_NB()` (i.e. no-brace) which contains the code itself, without any braces * `RUBY_CONST_ID_CACHE()` which uses `RUBY_CONST_ID_CACHE_NB()`, but puts braces around it (so no existing code using this macro breaks) * Finally, change `rb_intern()` so the `__extension__` directly creates a gcc statement expression, using the `RUBY_CONST_ID_CACHE_NB()` macro
* Backport mutexes for socket and connection lists on win32 #4212Andrew Aladjev2021-11-242-40/+105
|
* merge revision(s) c15cddd1d515c5bd8dfe8fb2725e3f723aec63b8: [Backport #16787]Alan D. Salewski2021-11-241-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow Dir.home to work for non-login procs when $HOME not set Allow the 'Dir.home' method to reliably locate the user's home directory when all three of the following are true at the same time: 1. Ruby is running on a Unix-like OS 2. The $HOME environment variable is not set 3. The process is not a descendant of login(1) (or a work-alike) The prior behavior was that the lookup could only work for login-descended processes. This is accomplished by looking up the user's record in the password database by uid (getpwuid_r(3)) as a fallback to the lookup by name (getpwname_r(3)) which is still attempted first (based on the name, if any, returned by getlogin_r(3)). If getlogin_r(3), getpwnam_r(3), and/or getpwuid_r(3) is not available at compile time, will fallback on using their respective non-*_r() variants: getlogin(3), getpwnam(3), and/or getpwuid(3). The rationale for attempting to do the lookup by name prior to doing it by uid is to accommodate the possibility of multiple login names (each with its own record in the password database, so each with a potentially different home directory) being mapped to the same uid (as is explicitly allowed for by POSIX; see getlogin(3posix)). Preserves the existing behavior for login-descended processes, and adds the new capability of having Dir.home being able to find the user's home directory for non-login-descended processes. Fixes [Bug #16787] Related discussion: https://bugs.ruby-lang.org/issues/16787 https://github.com/ruby/ruby/pull/3034
* Do not allow Module#include to insert modules before the origin in the ↵PikachuEXE2021-11-242-1/+16
| | | | | | | | | | | | | | lookup chain Module#include should only be able to insert modules after the origin, otherwise it ends up working like Module#prepend. This fixes the case where one of the modules in the included module chain is included in a module that is already prepended to the receiver. Fixes [Bug #7844] Backport of https://github.com/ruby/ruby/pull/3796 to 2.7
* openssl: import v2.1.3Kazuki Yamaguchi2021-11-2419-160/+439
| | | | | | | | | | | Bring the local copy of ruby/openssl in sync with the upstream gem release v2.1.3. The commits happened in the upstream repository can be found at: https://github.com/ruby/openssl/compare/v2.1.2...v2.1.3 Note that many of these have already been applied to ruby.git and don't appear in the file changes of this commit.
* tool/sync_default_gems.rb: fix path for opensslKazuki Yamaguchi2021-11-241-1/+1
|
* * 2021-11-24 [ci skip]git2021-11-241-2/+2
|
* Removed the accidental files at ↵Hiroshi SHIBATA2021-11-248-958/+0
| | | | https://github.com/ruby/ruby/commit/931815bfd86df603337194f3fcefb46bfe3e7940
* merge revision(s) b8386f7f7f6d7a7d76481e02d389d0f5211f0f2c [Backport #18161]NAKAMURA Usaku2021-09-192-7/+4
| | | | | | | Prepend DebugSystem to VCS class only And revert 24e5f1c982966c379220b1bbb26b4e0320180fa1, pepending to Kernel did not affect the top level methods before 3.0.
* Fix SortedSet not being sorted the first time when rbtree is usedJeremy Evans2021-07-311-2/+9
| | | | Fixes [Bug #17841]
* * 2021-07-31 [ci skip]git2021-07-311-1/+1
|
* Ignore timeout option to Addrinfo.getaddrinfoJeremy Evans2021-07-311-3/+1
| | | | | | | | | | This was already ignored on platforms that do not implement getaddrinfo_a. Using getaddrinfo_a causes issues with many calls to Addrinfo.getaddrinfo and also when using Addrinfo.getaddrinfo with fork. I would have updated the documentation for this, but the option was already not documented.
* Fix StartTLS stripping vulnerabilityYusuke Endoh2021-07-073-2/+39
| | | | | | Reported by Alexandr Savca in https://hackerone.com/reports/1178562 Co-authored-by: Shugo Maeda <shugo@ruby-lang.org>
* Ignore IP addresses in PASV responses by default, and add new option use_pasv_ipYusuke Endoh2021-07-073-7/+173
| | | | | | | This fixes CVE-2021-81810. Reported by Alexandr Savca. Co-authored-by: Shugo Maeda <shugo@ruby-lang.org>
* merge revision(s) 9edc162583a4f685332239f6249745ad9b518cbe: [Backport #17781]NAKAMURA Usaku2021-06-022-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | [ruby/resolv] Fix confusion of received response message This is a follow up for commit 33fb966197f1 ("Remove sender/message_id pair after response received in resolv", 2020-09-11). As the @senders instance variable is also used for tracking transaction ID allocation, simply removing an entry without releasing the ID would eventually deplete the ID space and cause Resolv::DNS.allocate_request_id to hang. It seems the intention of the code was to check that the received DNS message is actually the response for the question made within the method earlier. Let's have it actually do so. [Bug #12838] https://bugs.ruby-lang.org/issues/12838 [Bug #17748] https://bugs.ruby-lang.org/issues/17748 https://github.com/ruby/resolv/commit/53ca9c9209 --- lib/resolv.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
* bump the verion of RDoc for previous mergeNAKAMURA Usaku2021-05-311-1/+1
|
* merge revision(s) a7f5d6ab88 c9ab8fe2 [Backport#17877]NAKAMURA Usaku2021-05-313-2/+15
| | | | a fix of RDoc for CVE-2021-31799
* bump patchlevel for previous merge commitNAKAMURA Usaku2021-05-311-1/+1
|
* Fix 2.7 build (#4359)Nobuyoshi Nakada2021-05-3116-164/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * merge revision(s) fcc88da5eb162043adcba552646677d2ab5adf55: configure.ac: fix for upcoming autoconf-2.70 The failure initially noticed on `autoconf-2.69d` (soon to become 2.70): ``` $ ./configure ./configure: line 8720: syntax error near unexpected token `fi' ./configure: line 8720: `fi' ``` Before the change generated `./configure ` snippet looked like: ``` if ! $CC -E -xc - <<SRC >/dev/null then : #if defined __APPLE_CC__ && defined __clang_major__ && __clang_major__ < 3 #error premature clang #endif SRC as_fn_error $? "clang version 3.0 or later is required" "$LINENO" 5 fi ``` Note the newline that breaks here-document syntax. After the change the snippet does not use here-document. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> --- configure.ac | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) * merge revision(s) 0df67a469561fab80b78478b99703ed893c4db07: Signal handler type should be void --- configure.ac | 1 - include/ruby/internal/intern/signal.h | 3 +-- signal.c | 14 +++++++------- vm_core.h | 2 +- win32/Makefile.sub | 1 - 5 files changed, 9 insertions(+), 12 deletions(-) * merge revision(s) 4d2ad8d737c55c3efd4c75131687dd1c8db7441b: Removed obsolete autoconf checks Use regular `AC_CHECK_MEMBERS` instead of: * `AC_STRUCT_ST_BLKSIZE` * `AC_STRUCT_ST_BLOCKS` * `AC_STRUCT_ST_RDEV` --- configure.ac | 6 +++--- missing/fileblocks.c | 1 - win32/Makefile.sub | 1 - 3 files changed, 3 insertions(+), 5 deletions(-) delete mode 100644 missing/fileblocks.c * merge revision(s) 3b7c05ef8dc15371316e5254d33af12928183971: Fixed RUBY_RM_RECURSIVE when autoconf met the required version Before 9189cf5793cd527a86b711d15d5fd0633ec082e1 the result of `m4_version_compare` was compared to -1, however the `$2` of `m4_version_prereq` has different meaning and is expanded when the required version met. --- tool/m4/ruby_rm_recursive.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) * merge revision(s) c32375883a696fcf8e9e99875f1339ee5474a255,48bb0329eb325bc5b77c222f45b8dc97a208d986: Update for autoconf 2.70 --- configure.ac | 232 +++++++++++++++++------------------ tool/m4/ruby_check_builtin_setjmp.m4 | 8 +- tool/m4/ruby_check_printf_prefix.m4 | 9 +- tool/m4/ruby_check_setjmp.m4 | 6 +- tool/m4/ruby_check_sysconf.m4 | 6 +- tool/m4/ruby_cppoutfile.m4 | 4 +- tool/m4/ruby_decl_attribute.m4 | 4 +- tool/m4/ruby_dtrace_available.m4 | 2 +- tool/m4/ruby_dtrace_postprocess.m4 | 2 +- tool/m4/ruby_mingw32.m4 | 4 +- tool/m4/ruby_stack_grow_direction.m4 | 4 +- tool/m4/ruby_try_cflags.m4 | 2 +- tool/m4/ruby_try_cxxflags.m4 | 2 +- tool/m4/ruby_try_ldflags.m4 | 2 +- 14 files changed, 143 insertions(+), 144 deletions(-) Revert AC_PROG_CC_C99 for -std=gnu99 option to gcc 4.8 --- configure.ac | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) Co-authored-by: Sergei Trofimovich <slyfox@gentoo.org>
* merge revision(s) d8a13e504992a45d52063f7c925408d7aad3595a: [Backport #17780]NAKAMURA Usaku2021-05-313-4/+17
| | | | | | | | | | | | [Bug #17780] Fix Method#super_method for module alias Method#super_method crashes for aliased module methods because they are not defined on a class. This bug was introduced in c60aaed1856b2b6f90de0992c34771830019e021 as part of bug #17130. --- proc.c | 2 +- test/ruby/test_method.rb | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-)
* merge revision(s) fbbc37dc1d5b329777e6d9716118db528ab70730: [Backport #17802]NAKAMURA Usaku2021-04-163-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | test/drb/test_drb.rb: Specify the host of DRbServer to try fixing the following error. http://rubyci.s3.amazonaws.com/opensuseleap/ruby-master/log/20210407T063004Z.log.html.gz ``` [ 605/21105] DRbTests::TestDRbSSLAry#test_06_next/home/chkbuild/chkbuild/tmp/build/20210407T063004Z/ruby/lib/drb/drb.rb:1138:in `method_missing': undefined method `regist' for [1, 2, "III", 4, "five", 6]:Array (NoMethodError) from /home/chkbuild/chkbuild/tmp/build/20210407T063004Z/ruby/lib/drb/extserv.rb:21:in `block in initialize' from /home/chkbuild/chkbuild/tmp/build/20210407T063004Z/ruby/.ext/common/monitor.rb:202:in `synchronize' from /home/chkbuild/chkbuild/tmp/build/20210407T063004Z/ruby/.ext/common/monitor.rb:202:in `mon_synchronize' from /home/chkbuild/chkbuild/tmp/build/20210407T063004Z/ruby/lib/drb/extserv.rb:20:in `initialize' from /home/chkbuild/chkbuild/tmp/build/20210407T063004Z/ruby/test/drb/ut_array_drbssl.rb:35:in `new' from /home/chkbuild/chkbuild/tmp/build/20210407T063004Z/ruby/test/drb/ut_array_drbssl.rb:35:in `<main>' = 100.05 s ``` Here is my analysis: The test of drb used both `druby://:0` and `druby://localhost:0` for DRbServer. However, the former listens on IPv4, and the latter does on IPv6, depending on environments. The port 0 is automatically assigned, but sometimes the same port is used to both because they are different protocols (IPv4 and IPv6). In this case, their URIs are resolved to the completely same one (`druby://localhost:port`), which confuses the method `DRb.here?` which determines the DRbObject is remote or local. This changeset uses `druby://localhost:0` consistently. --- test/drb/test_drb.rb | 4 ++-- test/drb/test_drbssl.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
* bump teeny version to 2.7.4.nagachika2021-04-051-2/+2
|
* merge revision(s) 856a9701fd13edbb9d5f0fa773082d312195df90:nagachika2021-04-052-7/+7
| | | | | | | | Get rid of multibyte prefix to tmpdir --- test/ruby/test_require.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
* Backport a tmpdir fix.nagachika2021-04-053-2/+6
| | | | | Remove other then alphanumeric and some punctuations considered filesystem-safe, instead of removing some unsafe chars only.
* Backport rexml upstream bug fixes.nagachika2021-04-0511-81/+608
|
* I gave up tentatively to support autoconf 2.70 in ruby_2_7 and remove ↵nagachika2021-03-211-155/+0
| | | | failing build on GitHub Actions MinGW
* * 2021-03-21 [ci skip]git2021-03-211-1/+1
|
* Revert "merge revision(s) c32375883a696fcf8e9e99875f1339ee5474a255:"nagachika2021-03-2114-129/+128
| | | | This reverts commit cfd1a17292ae37db4d09c1452a4a84e7fd58e7cf.
* merge revision(s) c32375883a696fcf8e9e99875f1339ee5474a255:nagachika2021-03-2114-128/+129
| | | | | | | | | | | | | | | | | | | | | Update for autoconf 2.70 --- configure.ac | 232 +++++++++++++++++------------------ tool/m4/ruby_check_builtin_setjmp.m4 | 8 +- tool/m4/ruby_check_printf_prefix.m4 | 9 +- tool/m4/ruby_check_setjmp.m4 | 6 +- tool/m4/ruby_check_sysconf.m4 | 6 +- tool/m4/ruby_cppoutfile.m4 | 4 +- tool/m4/ruby_decl_attribute.m4 | 4 +- tool/m4/ruby_dtrace_available.m4 | 2 +- tool/m4/ruby_dtrace_postprocess.m4 | 2 +- tool/m4/ruby_mingw32.m4 | 4 +- tool/m4/ruby_stack_grow_direction.m4 | 4 +- tool/m4/ruby_try_cflags.m4 | 2 +- tool/m4/ruby_try_cxxflags.m4 | 2 +- tool/m4/ruby_try_ldflags.m4 | 2 +- 14 files changed, 143 insertions(+), 144 deletions(-)
* merge revision(s) 737da8d383e116c83fb356386322626f039deb06:nagachika2021-03-202-2/+2
| | | | | | | | Add another missing cast --- iseq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
* Partially merged 79df14c04b452411b9d17e26a398e491bca1a811 to suppress ↵nagachika2021-03-203-1/+5
| | | | compiler warning.
* merge revision(s) a85ed626f18d1014d09fb37eb0a703976c3d2b53: [Backport #17731]nagachika2021-03-203-2/+4
| | | | | | | | | Fix Enumerable#inject with high negative fixnums [Bug #17731] --- enum.c | 2 +- test/ruby/test_enum.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
* merge revision(s) f748b911c9157a0bb86f38280ddfba72a55049b6: [Backport #17729]nagachika2021-03-203-2/+16
| | | | | | | | | | | | | Fix infinite loop at illegal sequence [Bug #17729] As mblen returns -1 on failure, skip the first byte and try the succeeding bytes in that case. Close https://github.com/ruby/ruby/pull/4281 --- eval_intern.h | 11 ++++++++++- test/ruby/test_rubyoptions.rb | 5 +++++ 2 files changed, 15 insertions(+), 1 deletion(-)
* merge revision(s) 58660e943488778563b9e41005a601e9660ce21f: [Backport #17519]nagachika2021-03-203-4/+37
| | | | | | | | | | | | | | Skip refined method when exporting methods with changed visibility Previously, attempting to change the visibility of a method in a singleton class for a class/module that is prepended to and refined would raise a NoMethodError. Fixes [Bug #17519] --- test/ruby/test_module.rb | 23 +++++++++++++++++++++++ vm_method.c | 14 +++++++++++--- 2 files changed, 34 insertions(+), 3 deletions(-)
* merge revision(s) 0dc95266e8c36dbc3bfdcb88d820cb7f897166d7:nagachika2021-03-202-1/+5
| | | | | | | | Fix the failing test with XDG_CONFIG_HOME --- test/irb/test_init.rb | 4 ++++ 1 file changed, 4 insertions(+)
* merge revision(s) 4bff8e84232594ecb9914e2a8437b7c40a63b799: [Backport #16814]nagachika2021-03-202-1/+2
| | | | | | | | | | Ensure that the head of the vacancy list is correctly inserted into the linked list. See <https://bugs.ruby-lang.org/issues/16814> for more details. --- cont.c | 1 + 1 file changed, 1 insertion(+)
* merge revision(s) ↵nagachika2021-03-206-44/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 254bed302752a401b5fcc3b6c65a9c93711d91d6,fad3023e94c45e7f03478732f7641b6f39ba9d12,3156fb0f2c3ebf8229f392c8502c08fe165ab181: [Backport #17218] Renamed `nurat_sub` compliant with `rb_rational_plus` --- internal/rational.h | 1 + rational.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) Fix ArithmeticSequence#last and ArithmeticSequence#each for non-integer sequences (#3870) [Bug #17218] [ruby-core:100312] --- common.mk | 2 + enumerator.c | 99 ++++++++++++++++++++++++++++++++--- internal/numeric.h | 2 + internal/rational.h | 2 + numeric.c | 53 ++++++++++--------- rational.c | 28 +++++++--- test/ruby/test_arithmetic_sequence.rb | 10 ++++ 7 files changed, 156 insertions(+), 40 deletions(-) test/ruby/test_arithmetic_sequence.rb: remove a duplicated test There is another "test_last_bug17218" --- test/ruby/test_arithmetic_sequence.rb | 5 ----- 1 file changed, 5 deletions(-)
* merge revision(s) ↵nagachika2021-03-203-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | e0dd072978e6c2c8180e75617e7ee37830caefa3,85f99f4b715a5954124d5014002c16652995b128: Fix errors when XDG_CONFIG_HOME points to non-writable directory `$HOME/.config` is not writable on CI because I think tests should not corrupt user's data. And GitHub Actions CI sets `XDG_CONFIG_HOME` since `Version: 20210309.1`. https://github.com/ruby/actions/runs/2130811016?check_suite_focus=true#step:16:301 ``` Errno::EACCES: Permission denied @ dir_s_mkdir - /home/runner/.config/irb ``` --- test/irb/test_cmd.rb | 2 ++ 1 file changed, 2 insertions(+) Try to fix errors in TestIRB::TestHistory too https://github.com/ruby/actions/runs/2137935523?check_suite_focus=true#step:9:562 ``` 1) Error: TestIRB::TestHistory#test_history_concurrent_use: Errno::EACCES: Permission denied @ dir_s_mkdir - /home/runner/.config/irb /home/runner/work/actions/actions/ruby/lib/fileutils.rb:253:in `mkdir' /home/runner/work/actions/actions/ruby/lib/fileutils.rb:253:in `fu_mkdir' /home/runner/work/actions/actions/ruby/lib/fileutils.rb:231:in `block (2 levels) in mkdir_p' /home/runner/work/actions/actions/ruby/lib/fileutils.rb:229:in `reverse_each' /home/runner/work/actions/actions/ruby/lib/fileutils.rb:229:in `block in mkdir_p' /home/runner/work/actions/actions/ruby/lib/fileutils.rb:211:in `each' /home/runner/work/actions/actions/ruby/lib/fileutils.rb:211:in `mkdir_p' /home/runner/work/actions/actions/ruby/lib/irb/init.rb:355:in `rc_file_generators' /home/runner/work/actions/actions/ruby/lib/irb/init.rb:330:in `rc_file' /home/runner/work/actions/actions/ruby/test/irb/test_history.rb:170:in `block in assert_history' /home/runner/work/actions/actions/ruby/lib/tmpdir.rb:96:in `mktmpdir' /home/runner/work/actions/actions/ruby/test/irb/test_history.rb:168:in `assert_history' /home/runner/work/actions/actions/ruby/test/irb/test_history.rb:133:in `test_history_concurrent_use' ``` --- test/irb/test_history.rb | 2 ++ 1 file changed, 2 insertions(+)
* merge revision(s) 15e23312f6abcbf1afc6fbbf7917a57a0637f680: [Backport #16809]nagachika2021-03-202-20/+41
| | | | | | | | Rework the order of operations to avoid stack smashing. --- coroutine/copy/Context.c | 59 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 19 deletions(-)
* merge revision(s) ↵nagachika2021-03-203-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | 276f6a225d18561cbe5282b798cb4e416c66079f,95bef7b69a6fb42687a6200b338060be307259f5: [Backport #17352] Don't double fractional seconds when passing timezone object to Time.new I found that fractional seconds were doubled when using the timezone feature of Time in Sequel's named_timezones extension (which uses TZInfo for the timezone object), and traced the problem to this code. There is no subsecx being modified in the utc_to_local call below this, and I'm not sure why you would want to add in the fractional seconds unless you assumed the timezone conversion would drop the existing fractional seconds (TZInfo doesn't drop fractional seconds). --- test/ruby/test_time_tz.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) Subsecond of Time::tm should be 0 --- time.c | 1 + 1 file changed, 1 insertion(+)
* merge revision(s) ebb96fa8808317ad53a4977bff26cf755d68077e: [Backport #17321]nagachika2021-03-203-10/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix singleton class cloning Before this commit, `clone` gave different results depending on whether the original object had an attached singleton class or not. Consider the following setup: ``` class Foo; end Foo.singleton_class.define_method(:foo) {} obj = Foo.new obj.singleton_class if $call_singleton clone = obj.clone ``` When `$call_singleton = false`, neither `obj.singleton_class.singleton_class` nor `clone.singleton_class.singleton_class` own any methods. However, when `$call_singleton = true`, `clone.singleton_class.singleton_class` would own a copy of `foo` from `Foo.singleton_class`, even though `obj.singleton_class.singleton_class` does not. The latter case is unexpected and results in a visibly different clone, depending on if the original object had an attached class or not. Co-authored-by: Ufuk Kayserilioglu <ufuk.kayserilioglu@shopify.com> --- class.c | 31 ++++++++++++++++++++++--------- test/ruby/test_class.rb | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 9 deletions(-)
* merge revision(s) 511b55bcefc81c036294dc9a544d14bd342acd3b: [Backport #17215]nagachika2021-03-208-4/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable arm64 optimizations that exist for power/x86 (#3393) * Enable unaligned accesses on arm64 64-bit Arm platforms support unaligned accesses. Running the string benchmarks this change improves performance by an average of 1.04x, min .96x, max 1.21x, median 1.01x * arm64 enable gc optimizations Similar to x86 and powerpc optimizations. | |compare-ruby|built-ruby| |:------|-----------:|---------:| |hash1 | 0.225| 0.237| | | -| 1.05x| |hash2 | 0.110| 0.110| | | 1.00x| -| * vm_exec.c: improve performance for arm64 | |compare-ruby|built-ruby| |:------------------------------|-----------:|---------:| |vm_array | 26.501M| 27.959M| | | -| 1.06x| |vm_attr_ivar | 21.606M| 31.429M| | | -| 1.45x| |vm_attr_ivar_set | 21.178M| 26.113M| | | -| 1.23x| |vm_backtrace | 6.621| 6.668| | | -| 1.01x| |vm_bigarray | 26.205M| 29.958M| | | -| 1.14x| |vm_bighash | 504.155k| 479.306k| | | 1.05x| -| |vm_block | 16.692M| 21.315M| | | -| 1.28x| |block_handler_type_iseq | 5.083| 7.004| | | -| 1.38x| --- gc.c | 13 +++++++++++++ gc.h | 2 ++ include/ruby/internal/config.h | 2 ++ regint.h | 2 +- siphash.c | 2 +- st.c | 2 +- vm_exec.c | 8 ++++++++ 7 files changed, 28 insertions(+), 3 deletions(-)
* merge revision(s) c15cddd1d515c5bd8dfe8fb2725e3f723aec63b8: [Backport #16787]nagachika2021-03-205-18/+312
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow Dir.home to work for non-login procs when $HOME not set Allow the 'Dir.home' method to reliably locate the user's home directory when all three of the following are true at the same time: 1. Ruby is running on a Unix-like OS 2. The $HOME environment variable is not set 3. The process is not a descendant of login(1) (or a work-alike) The prior behavior was that the lookup could only work for login-descended processes. This is accomplished by looking up the user's record in the password database by uid (getpwuid_r(3)) as a fallback to the lookup by name (getpwname_r(3)) which is still attempted first (based on the name, if any, returned by getlogin_r(3)). If getlogin_r(3), getpwnam_r(3), and/or getpwuid_r(3) is not available at compile time, will fallback on using their respective non-*_r() variants: getlogin(3), getpwnam(3), and/or getpwuid(3). The rationale for attempting to do the lookup by name prior to doing it by uid is to accommodate the possibility of multiple login names (each with its own record in the password database, so each with a potentially different home directory) being mapped to the same uid (as is explicitly allowed for by POSIX; see getlogin(3posix)). Preserves the existing behavior for login-descended processes, and adds the new capability of having Dir.home being able to find the user's home directory for non-login-descended processes. Fixes [Bug #16787] Related discussion: https://bugs.ruby-lang.org/issues/16787 https://github.com/ruby/ruby/pull/3034 --- configure.ac | 5 + file.c | 51 +++++++--- internal/process.h | 6 ++ process.c | 266 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 311 insertions(+), 17 deletions(-)
* merge revision(s) abe2e7de4d1f2d5861d7c9ab9c7e778f2ee1dcd2: [Backport #16774]nagachika2021-03-202-3/+3
| | | | | | | | | | | | | | Don't require sub-word atomics On some architectures (like RISC-V) sub-word atomics are only available when linking against -latomic, but the configure script doesn't do that, causing the atomic checks to fail and the resulting ruby binary is non-functional. Ruby does not use sub-word atomic operations, rb_atomic_t is defined to unsigned int, so use unsigned int when checking for atomic operations. --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)