aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge openssl-2.1.4ky/ruby_2_7-openssl-2.1.4Kazuki Yamaguchi2022-09-204-5/+15
| | | | | | The changes can be found at: https://github.com/ruby/openssl/compare/v2.1.3...v2.1.4
* * 2022-09-20 [ci skip]git2022-09-201-1/+1
|
* update ubuntu 18.04 for github actionsHiroshi SHIBATA2022-09-201-1/+1
|
* zlib-1.2.11 is removed at zlib.netHiroshi SHIBATA2022-09-201-1/+1
|
* The tzdata 2022c removed Amsterdam Mean TimeNobuyoshi Nakada2022-09-201-0/+2
|
* Use autoreconf -i instead of autoconfHiroshi SHIBATA2022-09-203-3/+3
|
* * 2022-09-16 [ci skip]git2022-09-161-2/+2
|
* Backport https://github.com/ruby/ruby/pull/6193Hiroshi SHIBATA2022-09-167-6/+44
| | | | Co-authored-by: Yuta Saito <kateinoigakukun@gmail.com>
* Fix dtoa buffer overrunNAKAMURA Usaku2022-04-123-3/+22
|
* * 2022-04-07 [ci skip]git2022-04-071-2/+2
|
* merge revision(s) 496591de96b261b8789332c7f8b2bfbd17658955: [Backport #18578]NAKAMURA Usaku2022-03-193-2/+14
| | | | | | | | | | | | | | | | | | | st.c: Do not clear entries_bound when calling Hash#shift for empty hash tab->entries_bound is used to check if the bins are full in rebuild_table_if_necessary. Hash#shift against an empty hash assigned 0 to tab->entries_bound, but didn't clear the bins. Thus, the table is not rebuilt even when the bins are full. Attempting to add a new element into full-bin hash gets stuck. This change stops clearing tab->entries_bound in Hash#shift. [Bug #18578] --- st.c | 1 - test/ruby/test_hash.rb | 13 +++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-)
* merge revision(s) c79d2e54748f52c5023b0a1ee441561df9826c17: [Backport #18562]NAKAMURA Usaku2022-03-193-2/+23
| | | | | | | | | | | | | | | | Fix TAG_THROW through require [Bug #18562] Previously this was being incorrectly swapped with TAG_RAISE in the next line. This would end up checking the T_IMEMO throw_data to the exception handling (which calls Module#===). This happened to not break existing tests because Module#=== returned false when klass is NULL. This commit handles throw from require correctly by jumping to the tag retaining the TAG_THROW state. --- load.c | 2 +- test/ruby/test_exception.rb | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-)
* merge revision(s) b555e659c4974acc423083b71b1bd5ec6a926046: [Backport #18388]NAKAMURA Usaku2022-03-193-1/+20
| | | | | | | | | | | Do not use `fcopyfile` if appending to non-empty file [Bug #18388] `fcopyfile` appends `src` to `to` and then truncates `to` to it's original size. --- io.c | 7 +++++++ test/ruby/test_io.rb | 12 ++++++++++++ 2 files changed, 19 insertions(+)
* merge revision(s) ↵NAKAMURA Usaku2022-03-194-2/+39
| | | | | | | | | | | | | | | | | | | | | | | 7ff1bf317887c0d7b21e91ad548d07b9f05c540c,e89d80702bd98a8276243a7fcaa2a158b3bfb659: [Backport #18516] An alias can suppress method redefinition warning --- test/ruby/test_alias.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) Fix memory leak at the same named alias [Bug #18516] When aliasing a method to the same name method, set a separate bit flag on that method definition, instead of the reference count increment. Although this kind of alias has no actual effect at runtime, is used as the hack to suppress the method re-definition warning. --- method.h | 1 + test/ruby/test_alias.rb | 18 ++++++++++++++++++ vm_method.c | 9 ++++++++- 3 files changed, 27 insertions(+), 1 deletion(-)
* merge revision(s) 6a6227e0168b059c3ed34c9f0ace2e5dc2364221: [Backport #18517]NAKAMURA Usaku2022-03-192-1/+3
| | | | | | | | Shifting zero always results in zero [Bug #18517] --- numeric.c | 2 ++ 1 file changed, 2 insertions(+)
* merge revision(s) ↵NAKAMURA Usaku2022-03-193-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | 5c7af72304d0ad33cd3f21b24a4bc44e8acd5b2c,d650b17686d49c2ce8e6a87039861154e93d4621: [Backport #18497] Assuming EXIT_SUCCESS equals 0 is not portable --- test/ruby/test_fiber.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) `rb_fiber_terminate` must not return [Bug #18497] In a forked process from a fiber, the fiber becomes the only fiber, `fiber_switch` does nothing as there is no other fibers, `rb_fiber_terminate` does not terminate the fiber. In that case, reaches the end of `fiber_entry` finaly, which is declared as "COROUTINE" and should never return. --- cont.c | 3 ++- eval_intern.h | 2 +- test/fiber/test_process.rb | 15 +++++++++++++++ test/ruby/test_fiber.rb | 5 +++++ 4 files changed, 23 insertions(+), 2 deletions(-) note that only backported a part of above patch because of incompatibility of ruby_2_7.
* merge revision(s) ae5458f228a5477383e9c00425d85d50a3867817: [Backport #18475]NAKAMURA Usaku2022-03-193-2/+17
| | | | | | | | | | thread.c: Convert TAG_BREAK to a normal exception at thread top-level [Bug #18475] --- test/ruby/test_enum.rb | 11 +++++++++++ thread.c | 3 +++ 2 files changed, 14 insertions(+)
* merge revision(s) c51b92c18deb850d2cea3a7c9020db23b364ab72: [Backport #18358]NAKAMURA Usaku2022-03-053-42/+87
| | | | | | | | | | | | | | [ruby/zlib] [Bug #18358] Fix crash in zlib when in progress When Zlib::Inflate#inflate or Zlib::Deflate#deflate is called recursively inside the block, a crash can occur because of an use-after-free bug. https://github.com/ruby/zlib/commit/50fb8a0338 --- ext/zlib/zlib.c | 117 ++++++++++++++++++++++++++++++++----------------- test/zlib/test_zlib.rb | 10 ++++- 2 files changed, 85 insertions(+), 42 deletions(-)
* merge revision(s) b3d62a77d928eff01268ca7fa1c1c0966702926d [Backport #17803]NAKAMURA Usaku2022-03-053-5/+91
| | | | | | | | | | | | | | | | | | | | | | [ruby/zlib] Synchronize access to zstream to prevent segfault in multithreaded use I'm not sure whether this handles all multithreaded use cases, but this handles the example that crashes almost immediately and does 10,000,000 total deflates using 100 separate threads. To prevent the tests from taking forever, the committed test for this uses only 10,000 deflates across 10 separate threads, which still causes a segfault in the previous implementation almost immediately. Fixes [Bug #17803] https://github.com/ruby/zlib/commit/4b1023b3f2 --- ext/zlib/zlib.c | 33 ++++++++++++++++++++++++++- test/zlib/test_zlib.rb | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+), 1 deletion(-)
* merge revision(s) 0c5f8c62766afe4605172800063e63fe36996658: [Backport #10961]NAKAMURA Usaku2021-12-312-1/+7
| | | | | | | | [ruby/zlib] Resume zstream if available [Bug #10961] --- ext/zlib/zlib.c | 6 ++++++ 1 file changed, 6 insertions(+)
* merge revision(s) ↵NAKAMURA Usaku2021-12-313-10/+19
| | | | | | | | | | | | | | | | | | 0846c2da457e7523819236ac7da492029b3ef73d,6c7cb00c094332a208cf36e5cd723a9ba60c41b8: [Backport #16376] Check backref number buffer overrun [Bug #16376] --- regcomp.c | 21 ++++++++++++--------- test/ruby/test_regexp.rb | 6 ++++++ 2 files changed, 18 insertions(+), 9 deletions(-) test/ruby/test_regexp.rb: Avoid "ambiguity between regexp and two divisions" --- test/ruby/test_regexp.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
* merge revision(s) fdf39963490cf2cf95b30d91bb9b35964c2c2350: [Backport #18421]NAKAMURA Usaku2021-12-313-3/+28
| | | | | | | | | | Empty and return the buffer if zero size is given [Bug #18421] In `IO#readpartial` and `IO#read_nonblock`, as well as `IO#read`. --- io.c | 8 ++++++-- test/ruby/test_io.rb | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-)
* merge revision(s) ↵NAKAMURA Usaku2021-12-313-7/+33
| | | | | | | | | | | | | | | | | | | a2d4e1cda68a49980a4f9f353f400efbde7e7884,d6c5a30cfdf658280338dbb8c8b17fab3190b928: [Backport #18392] Fixed the check order in wmap_live_p [Bug #18392] Check if the object is a pointer to heap before check the flag in that object. --- gc.c | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) ObjectSpace::WeakMap#inspect: check if living object [Bug #18392] --- gc.c | 29 +++++++++++++++++++++++------ test/ruby/test_weakmap.rb | 9 +++++++++ 2 files changed, 32 insertions(+), 6 deletions(-)
* merge revision(s) 43a3c88187dcd54ba008834a865e50eb28a78de9: [Backport #18372]NAKAMURA Usaku2021-12-312-1/+3
| | | | | | | | | | | [win32] get rid of redefinition of reserved macro ``` warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored ``` --- win32/Makefile.sub | 2 ++ 1 file changed, 2 insertions(+)
* merge revision(s) 9f8a50723f8a84b3e4755b418570148f422d1b28: [Backport #17836]NAKAMURA Usaku2021-12-312-4/+5
| | | | | | | | | Specify -c to emit pch with clang (#4423) [Bug #17836] --- mjit_worker.c | 1 + 1 file changed, 1 insertion(+)
* merge some parts of CGI 0.1.1NAKAMURA Usaku2021-11-245-4/+9
| | | | | | | | | | Fix integer overflow Make use of the check in rb_alloc_tmp_buffer2. When parsing cookies, only decode the values Bump version
* merge revision(s) e83c02a768af61cd0890a75e90bcae1119d8bd93: [Backport #18289]NAKAMURA Usaku2021-11-243-2/+7
| | | | | | | | | | Delegate keywords from Enumerable#to_a to #each Fixes [Bug #18289] --- enum.c | 2 +- test/ruby/test_enum.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-)
* merge revision(s) a4d5ee4f31bf3ff36c1a8c8fe3cda16aa1016b12: [Backport #18264]NAKAMURA Usaku2021-11-243-2/+12
| | | | | | | | | | | [Bug #18264] Fix memory leak in TracePoint TracePoint leaks memory because it allocates a `rb_tp_t` struct without ever freeing it (it is created with `RUBY_TYPED_NEVER_FREE`). --- test/ruby/test_settracefunc.rb | 10 ++++++++++ vm_trace.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-)
* merge revision(s) ↵NAKAMURA Usaku2021-11-244-23/+65
| | | | | | | | | | | | | | | | | | | | | | | | 89242279e61b023a81c58065c62a82de8829d0b3,529fc204af84f825f98f83c34b004acbaa802615: [Backport #18141] Marshal.load: do not call the proc until strings have their encoding Ref: https://bugs.ruby-lang.org/issues/18141 --- marshal.c | 7 +++- spec/ruby/core/marshal/shared/load.rb | 62 +++++++++++++++++++++++------------ test/ruby/test_marshal.rb | 17 ++++++++++ 3 files changed, 64 insertions(+), 22 deletions(-) marshal.c: don't call the proc with partially initialized objects. (#4866) For cyclic objects, it requires to keep a st_table of the partially initialized objects. --- marshal.c | 75 ++++++++++++++++++++--------------- spec/ruby/core/marshal/shared/load.rb | 75 ++++++++++++++++++++--------------- test/ruby/test_marshal.rb | 12 ++++++ 3 files changed, 97 insertions(+), 65 deletions(-)
* merge revision(s) ddb32e66160ab50849419ef7c7ac584913b79c34: [Backport #18173]NAKAMURA Usaku2021-11-243-1/+19
| | | | | | | | | | | | | [Bug #18173] Update loaded_features_index If $LOADED_FEATURES is changed in the just required file, also the index table needs to be updated before loaded_features_snapshot is reset. If the snapshot is reset without updating the table, the name of the added feature will not be found. --- load.c | 1 + test/ruby/test_require.rb | 17 +++++++++++++++++ 2 files changed, 18 insertions(+)
* merge revision(s) 99d8c4832a7133ca52578d015e3ddcfd94820f4a: [Backport #18160]NAKAMURA Usaku2021-11-243-12/+17
| | | | | | | | | Preserve the encoding of the argument in IndexError [Bug #18160] --- re.c | 20 ++++++++++---------- test/ruby/test_regexp.rb | 7 ++++++- 2 files changed, 16 insertions(+), 11 deletions(-)
* 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>