summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2020-03-30merge revision(s) 4adb2d655dcd54b28366b4d17e86b21e2b622cd1: [Backport #16738]usa
Make RbConfig::CONFIG values mutable [Bug #16738] As `RbConfig.expand` modifies the argument and involved `CONFIG` values, its values should be mutable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2020-03-30merge revision(s) 6e6844320de989cb88a154e2ac75066ccea1bba2: [Backport #16619]usa
Fixed duplicated warning As `command_rhs` is always a "value expression", `command_asgn` does not need the same check. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2020-03-30merge revision(s) 77596fb7a91cc119b25ac9e19b3c8682709765b4: [Backport #16138]usa
Do not turn on keyword_init for Struct subclass if keyword hash is empty This was accidentally turned on because there was no checking for Qundef. Also, since only a single keyword is currently supported, simplify the rb_get_kwargs call. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2020-03-30merge revision(s) 4f19666e8b144600e959e4673f79d63f98bd637d: [Backport #16508]usa
`Regexp` in `MatchData` can be `nil` `String#sub` with a string pattern defers creating a `Regexp` until `MatchData#regexp` creates a `Regexp` from the matched string. `Regexp#last_match(group_name)` accessed its content without creating the `Regexp` though. [Bug #16508] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2020-03-30merge revision(s) ↵usa
d6a2bce64a7fa1099e507e1d36b5f1533f42f60f,c687be4bc01c9ce52ea990945d9304d6fe59fe9b: [Backport #16159] time.c (find_time_t): fix round-to-zero bug `find_time_t` did not work correctly for year older than the Epoch because it used C's integer division (which rounds negative to zero). For example, `TIme.new(1933)` returned a wrong time whose year is 1922 in Asia/Kuala_Lumpur because there is no 00:00:00 1st Jan. 1933 in the time zone. ``` $ TZ=Asia/Kuala_Lumpur ruby -e 'p Time.new(1933)' 1932-12-31 00:00:00 +0700 ``` This change fixes the issue by using `DIV` macro instead of `/`. Now `Time.new(1933)` returns a time in 1933. ``` $ TZ=Asia/Kuala_Lumpur ruby -e 'p Time.new(1933)' 1933-01-01 00:20:00 +0720 ``` [Bug #16159] Added a test for [Bug #16159] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2020-03-30merge revision(s) ↵usa
203b7fa1ae8cc40d41c38d684f70b3fea7fae813,0131fab749fb76800de09e49a6abf910201c5b58,9c0cd5c569ba22bc68d1a77ad6580a275cd99639,c144d7215b3444fa36d28d540b60170a5b30743d: [Backport #16196] Guard static variable first * ext/openssl/ossl_asn1.c (Init_ossl_asn1): register the static variable to grab an internal object, before creating the object. otherwise the just-created object could get collected during the global variable list allocation. [Bug #16196] Slimed down test runtime by stressing openssl.so only [Bug #16196] Prefer rb_gc_register_mark_object * ext/openssl/ossl_asn1.c (Init_ossl_asn1): prefer `rb_gc_register_mark_object`, which is better for constant objects, over `rb_gc_register_address` for global/static variables which can be re-assigned at runtime. [Bug #16196] Skip very time consuming test [Bug #16196] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2020-03-30merge revision(s) ↵usa
c9423b016cfeab852bc5a829e55e0a11f80b3ab7,0b1e26398e018116180bf41cb63887f77d5d1b82,78ee2c245331e353e218b8fac9ca722a2bcd8fea: [Backport #15968] marshal.c: check instance variable count * marshal.c (w_obj_each): ensure that no instance variable was added while dumping other instance variables. [Bug #15968] Hoisted out w_ivar_each marshal.c: check instance variable count * marshal.c (w_ivar_each): ensure that no instance variable was removed while dumping other instance variables. [Bug #15968] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-12-04merge revision(s) 2a477e0e444de6344048101466fb9189b9defddc: [Backport #16353]usa
test_ftp.rb: loosen timeout for Travis osx https://travis-ci.org/ruby/ruby/jobs/454798071 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-10-01lib/shell/command-processor.rb (Shell#[]): prevent unknown commandusa
`FileTest.send(command, ...)` allows to call not only FileTest-related methods but also any method that belongs to Kernel, Object, etc. patched by <mame@ruby-lang.org> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-10-01merge revision(s) 3ce238b5f9795581eb84114dcfbdf4aa086bfeccusa
WEBrick: prevent response splitting and header injection This is a follow up to d9d4a28. The commit prevented CRLR, but did not address an isolated CR or an isolated LF. Co-Authored-By: NARUSE, Yui <naruse@airemix.jp> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-10-01merge revision(s) 36e057e26ef2104bc2349799d6c52d22bb1c7d03usa
Loop with String#scan without creating substrings Create the substrings necessary parts only, instead of cutting the rest of the buffer. Also removed a useless, probable typo, regexp. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-10-01merge revision(s) a0a2640b398cffd351f87d3f6243103add66575busa
Fix for wrong fnmatch patttern * dir.c (file_s_fnmatch): ensure that pattern does not contain a NUL character. https://hackerone.com/reports/449617 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-08-27Skip test_gc_stress_at_startup because it causes SEGV on some platformsusa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-08-26merge revision(s) d5c33364e3c0efb15e11df417c925afee2cdb9c9: [Backport #16105]usa
Fixed heap-use-after-free * string.c (rb_str_sub_bang): retrieves a pointer to the replacement string buffer just before using it, for the case of replacement with the receiver string itself. [Bug #16105] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-08-26merge revision(s) 5b1bf8dd2d08ae7371ecf025967376bb794ed651: [Backport #16099]usa
UTF LE is fixed at least the first 2 bytes * io.c (io_strip_bom): if the first 2 bytes are 0xFF0xFE, it should be a little-endian UTF, 16 or 32. [Bug #16099] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-08-26merge revision(s) ↵usa
ec8e5f5aa64e2a54cf1e303f2b012c98e8d521ba,5a187e26adc8aa32367f294c1496935c7356d386: [Backport #15952] array.c: always check frozenness in Array#unshift. Fixes [Bug #15952] Closes: https://github.com/ruby/ruby/pull/2251 array.c add back shared array optimization to ary_ensure_room_for_unshift Bug fix in commit ec8e5f5aa64e2a [Bug #15952] disabled an optimization in this function. Closes: https://github.com/ruby/ruby/pull/2252 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-08-26merge revision(s) ↵usa
28678997e40869f5591eae60edd9757334426ffb,8797f48373dcfa3ff8e748667732dea8aea4347e: [Backport #15937] Preserve the string content at self-copying * string.c (rb_str_init): preserve the embedded content when self-copying with a capacity. [Bug #15937] New buffer for shared string * string.c (rb_str_init): allocate new buffer if the string is shared. [Bug #15937] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-08-26merge revision(s) ↵usa
ae2a904ce9bffedee7d110dc60fd51c0a2879a5b,165ddfda20f6db8a3149d14c4f431fc242ddab70,fa7a768fdfe5223a29db4fa71b3e6101fb02ad51: [Backport #16051] Update the certificate files to make the test pass on Debian 10 The old certificate files (for example, test/rubygems/ca_cert.pem) were signed by SHA1. This message digest is considered too weak and rejected by OpenSSL 1.1.1 or later. Because of this, the test suite does not pass on Debian 10. https://rubyci.org/logs/rubyci.s3.amazonaws.com/debian/ruby-master/log/20190527T123003Z.fail.html.gz#test%2Frubygems This change regenerates the files. A shell script for the regeneration (util/create_certs.sh) is also added. * remove trailing spaces. Removed inconsistency file from upstream repository of rubygems. followed up ae2a904ce9bffedee7d110dc60fd51c0a2879a5b git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-08-26merge revision(s) 9dec4e8fc3a6018261834b5ac9b9877f787b97ca: [Backport #15934]usa
String#b: Don't depend on dependent string Registering a string that depend on a dependent string as fstring can lead to use-after-free. See c06ddfe and 3f95620 for details. The following script triggers use-after-free on trunk, 2.4.6, 2.5.5 and 2.6.3. Credits to @wanabe for using eval as a cross-version way of registering a fstring. ```ruby a = ('j' * 24).b.b eval('', binding, a) p a 4.times { GC.start } p a ``` - string.c (str_replace_shared_without_enc): when given a dependent string, depend on the root of the dependent string. [Bug #15934] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-08-26merge revision(s) ↵usa
3f9562015e651735bfc2fdd14e8f6963b673e22a,c06ddfee878524168e4af07443217ed2f8d0954b,3b3b4a44e5: [Backport #15792] Get rid of indirect sharing * string.c (str_duplicate): share the root shared string if the original string is already sharing, so that all shared strings refer the root shared string directly. indirect sharing can cause a dangling pointer. [Bug #15792] str_duplicate: Don't share with a frozen shared string This is a follow up for 3f9562015e651735bfc2fdd14e8f6963b673e22a. Before this commit, it was possible to create a shared string which shares with another shared string by passing a frozen shared string to `str_duplicate`. Such string looks like: ``` -------- ----------------- | root | ------ owns -----> | root's buffer | -------- ----------------- ^ ^ ^ ----------- | | | shared1 | ------ references ----- | ----------- | ^ | ----------- | | shared2 | ------ references --------- ----------- ``` This is bad news because `rb_fstring(shared2)` can make `shared1` independent, which severs the reference from `shared1` to `root`: ```c /* from fstr_update_callback() */ str = str_new_frozen(rb_cString, shared2); /* can return shared1 */ if (STR_SHARED_P(str)) { /* shared1 is also a shared string */ str_make_independent(str); /* no frozen check */ } ``` If `shared1` was the only reference to `root`, then `root` can be reclaimed by the GC, leaving `shared2` in a corrupted state: ``` ----------- -------------------- | shared1 | -------- owns --------> | shared1's buffer | ----------- -------------------- ^ | ----------- ------------------------- | shared2 | ------ references ----> | root's buffer (freed) | ----------- ------------------------- ``` Here is a reproduction script for the situation this commit fixes. ```ruby a = ('a' * 24).strip.freeze.strip -a p a 4.times { GC.start } p a ``` - string.c (str_duplicate): always share with the root string when the original is a shared string. - test_rb_str_dup.rb: specifically test `rb_str_dup` to make sure it does not try to share with a shared string. [Bug #15792] Closes: https://github.com/ruby/ruby/pull/2159 Update dependencies git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-08-26merge revision(s) 5e018214e7435030727a97ac49db038d96438e74: [Backport #15720]usa
Fix SystemStackError when calling a method in an unused refinement Fixes [Bug #15720] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-08-26merge revision(s) ↵usa
6375c68f8851e1e0fee8a95afba91c4555097127,c05eaa93258ddc01e685b6cc3a0da82998a2af48: [Backport #15839] parse.y: function parser_mixed_error & parser_mixed_escape Fix mixed encoding in heredoc Heredocs are parsed line-by-line, so we need to keep track of the temporary encoding of the string. Previously, a heredoc would only detect mixed encoding errors if they were on the same line, this changes things so they will be caught on different lines. Fixes [Bug #15839] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-08-26merge revision(s) 5bab1304af25a843728dbcd2f3594913740aecb0: [Backport #15847]usa
fix visibility of SecureRandom.gen_random Aliasing a method preserves its visibility. These aliases turn formerly-public methods into private. Should make them public again. [Bug #15847] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-08-26merge revision(s) ea42423908ed055f9039b1dce6e9a232a3b2dd90: [Backport #15887]usa
Keep vm->orig_progname alive `vm->orig_progname` can be different from `vm->progname` when user code assigns to `$0`. While `vm->progname` is kept alive by the global table, nothing marked `vm->orig_progname`. [Bug #15887] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-08-26merge revision(s) ac00bdc8a8ac2c62a94dd36a7784d15bbcb7df19: [Backport #15821]usa
Do not modify shared array [Bug #15821] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-08-26merge revision(s) ↵usa
d0ba4abf1a00339ebbb5d405db3240a8bdb7b68b,54eac83b2ad77ddea84fa6d66c09e0bb014cf61e: [Backport #15786] Add RB_ID_SERIAL_MAX Hide internal IDs * parse.y (internal_id): number the ID serial for internal use by counting down from the neary maximum value, not to accidentally match permanent IDs. [Bug #15768] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-08-26merge revision(s) a6a26e42b15c46f117f4fce07a2050e9d727355d: [Backport #15906]usa
compile.c: Partially revert r63870 which caused wrong optimization [Bug #15906] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-08-26merge revision(s) a15f7dd1fb1148c3d586238ee6907875f2e40379: [Backport #15803]usa
Always mark the string returned by File.realpath as tainted This string can include elements that were not in either string passed to File.realpath, even if one of the strings is an absolute path, due to symlinks: ```ruby Dir.mkdir('b') unless File.directory?('b') File.write('b/a', '') unless File.file?('b/a') File.symlink('b', 'c') unless File.symlink?('c') path = File.realpath('c/a'.untaint, Dir.pwd.untaint) path # "/home/testr/ruby/b/a" path.tainted? # should be true, as 'b' comes from file system ``` [Bug #15803] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-08-26merge revision(s) d118c84b0b9110462e479487ffaf175a75e5718e: [Backport #15199]usa
Fix IO#scanf on pipes on Windows IO.seek on a pipe on Windows raises Errno::EINVAL instead of Errno::ESPIPE. Fixes Ruby Bug #15199 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-08-26merge revision(s) 179045acaf5de8398c321ada86a76f1afb77a796: [Backport #14539]usa
regparse.c: Suppress duplicated range warning by mere \X * regparse.c (node_extended_grapheme_cluster): as Unicode 10 has added Grapheme_Cluster_Break properties to some characters, remove duplicated ranges for Unicode 9. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-05-30merge revision(s) dcb6a6ae3e2b8a3e298e7f0d4a3e7f8ff102a30e:[Backport #15845]usa
Windows simply causes an error to open invalid path git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-30merge revision(s) 67270: [Backport #15670]usa
dsym should be treated as string [ruby-core:91852] [Bug #15670] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-30merge revision(s) 67467: [Backport #15756]usa
range.c: force hash values fixable * range.c (method_hash): force hash values fixable on LLP64 environment. [ruby-core:92191] [Bug #15756] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-30merge revision(s) 67468: [Backport #15757]usa
range.c: force hash values fixable * range.c (range_hash): force hash values fixable on LLP64 environment. [ruby-core:92194] [Bug #15757] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-30merge revision(s) 67247: [Backport #15666]usa
Guard out the test when it is run under root permission git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-30merge revision(s) 66326,66649: [Backport #15385]usa
Fix infinite loop by ensure * compile.c (iseq_insert_nop_between_end_and_cont): insert nop so that the end of rescue and continuing points are not same, to get rid of infinite loop. [Bug #15385] test_optimization.rb: increase timeout for RubyCI https://rubyci.org/logs/rubyci.s3.amazonaws.com/opensuseleap/ruby-trunk/log/20181230T040002Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-13merge revision(s) 67200: [Backport #15648]nagachika
Add ignored_sp event * ext/ripper/lib/ripper/lexer.rb (Ripper::Lexer): add ignored_sp event which will be fired from Ripper::Lexer#on_heredoc_dedent method. [ruby-core:91727] [Bug #15648] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-13merge revision(s) 66909: [Backport #15555]nagachika
tmpdir.rb: permission of user given directory * lib/tmpdir.rb (Dir.mktmpdir): check if the permission of the parent directory only when using the default temporary directory, and no check against user given directory. the security is the user's responsibility in that case. [ruby-core:91216] [Bug #15555] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-12merge revision(s) 66618: [Backport #15660]nagachika
test_io.rb: increase timeout for RubyCI to stabilize AIX powerpc CI https://rubyci.org/logs/rubyci.s3.amazonaws.com/aix71_ppc/ruby-trunk/log/20181227T113302Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-12merge revision(s) 66436: [Backport #15427]nagachika
should use defined_class. * vm_insnhelper.c (vm_call_method_each_type): we should use me->defined_class instead of me->owner because me->owner doesn't has correct ancestors list. [Bug #15427] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-12merge revision(s) 64234,64252: [Backport #15219]nagachika
net/http, net/ftp: fix session resumption with TLS 1.3 When TLS 1.3 is in use, the session ticket may not have been sent yet even though a handshake has finished. Also, the ticket could change if multiple session ticket messages are sent by the server. Use SSLContext#session_new_cb instead of calling SSLSocket#session immediately after a handshake. This way also works with earlier protocol versions. net/http, net/ftp: skip SSL/TLS session resumption tests Due to a bug in OpenSSL 1.1.0h[1] (it's only in this specific version; it was introduced just before the release and is already fixed in their stable branch), the callback set by SSLContext#session_new_cb= does not get called for clients, making net/http and net/ftp not attempt session resumption. Let's disable the affected test cases for now. Another option would be to fallback to using SSLSocket#session as we did before r64234. But since only a single version is affected and hopefully a new stable version containing the fix will be released in near future, I chose not to add such workaround code to lib/. [1] https://github.com/openssl/openssl/pull/5967 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-12Merge RubyGems 2.7.6.2 patch [Bug #15643]nagachika
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-12Merge RubyGems 2.7.6.1 patch [Bug #15637]nagachika
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-12merge revision(s) 67201: [Backport #15650]nagachika
eval.c: clear internal errinfo * eval.c (ruby_cleanup): clear internal error info when invoking end procs. [ruby-core:91731] [Bug #15650] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-11merge revision(s) 67203: [Backport #15651]nagachika
numeric.c: fix infinite loop * numeric.c (int_pow): fix infinite loop in the case of y equal 1 and power of x does not overflow. [ruby-core:91734] [Bug #15651] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-07merge revision(s) 67167: [Backport #15635]nagachika
string.c: respect the actual encoding * string.c (rb_enc_str_coderange): respect the actual encoding of if a BOM presents, and scan for the actual code range. [ruby-core:91662] [Bug #15635] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-07merge revision(s) 67188: [Backport #15642]nagachika
io.c: chomp CR at the end of read buffer * io.c (rb_io_getline_fast): chomp CR followed by LF but separated by the read buffer boundary. [ruby-core:91707] [Bug #15642] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-11merge revision(s) 62872,62873: [Backport #14621]nagachika
parse.y: unindent continued line * parse.y (tokadd_string): stop at continued line in dedented here documents, to dedent for each lines before removing escaped newlines. [ruby-core:86236] [Bug #14621] parse.y: terminator at continued line * parse.y (here_document): a continuing line is not the terminator. [ruby-core:86283] [Bug #14621] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-23merge revision(s) 62934,63210,63215,63309: [Backport #14634]nagachika
thread_sync.c: avoid reaching across stacks of dead threads rb_ensure is insufficient cleanup for fork and we must reinitialize all waitqueues in the child process. Unfortunately this increases the footprint of ConditionVariable, Queue and SizedQueue by 8 bytes on 32-bit (16 bytes on 64-bit). [ruby-core:86316] [Bug #14634] variable.c: fix thread + fork errors in autoload This is fairly non-intrusive bugfix to prevent children from trying to reach into thread stacks of the parent. I will probably reuse this idea and redo r62934, too (same bug). * vm_core.h (typedef struct rb_vm_struct): add fork_gen counter * thread.c (rb_thread_atfork_internal): increment fork_gen * variable.c (struct autoload_data_i): store fork_gen * variable.c (check_autoload_data): remove (replaced with get_...) * variable.c (get_autoload_data): check fork_gen when retrieving * variable.c (check_autoload_required): use get_autoload_data * variable.c (rb_autoloading_value): ditto * variable.c (rb_autoload_p): ditto * variable.c (current_autoload_data): ditto * variable.c (autoload_reset): reset fork_gen, adjust indent * variable.c (rb_autoload_load): set fork_gen when setting state * test/ruby/test_autoload.rb (test_autoload_fork): new test [ruby-core:86410] [Bug #14634] thread_sync: redo r62934 to use fork_gen Instead of maintaining linked-lists to store all rb_queue/rb_szqueue/rb_condvar structs; store only a fork_gen serial number to simplify management of these items. This reduces initialization costs and avoids the up-front cost of resetting all Queue/SizedQueue/ConditionVariable objects at fork while saving 8 bytes per-structure on 64-bit. There are no savings on 32-bit. * thread.c (rb_thread_atfork_internal): remove rb_thread_sync_reset_all call * thread_sync.c (rb_thread_sync_reset_all): remove * thread_sync.c (queue_live): remove * thread_sync.c (queue_free): remove * thread_sync.c (struct rb_queue): s/live/fork_gen/ * thread_sync.c (queue_data_type): use default free * thread_sync.c (queue_alloc): remove list_add * thread_sync.c (queue_fork_check): new function * thread_sync.c (queue_ptr): call queue_fork_check * thread_sync.c (szqueue_free): remove * thread_sync.c (szqueue_data_type): use default free * thread_sync.c (szqueue_alloc): remove list_add * thread_sync.c (szqueue_ptr): check fork_gen via queue_fork_check * thread_sync.c (struct rb_condvar): s/live/fork_gen/ * thread_sync.c (condvar_free): remove * thread_sync.c (cv_data_type): use default free * thread_sync.c (condvar_ptr): check fork_gen * thread_sync.c (condvar_alloc): remove list_add [ruby-core:86316] [Bug #14634] thread_sync.c (condvar_ptr): reset fork_gen after forking Otherwise the condition variable waiter list will always be empty, which is wrong :x [Bug #14725] [Bug #14634] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@66912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-20merge revision(s) 63334: [Backport #14729]nagachika
object.c: raise on long invalid float string * object.c (rb_cstr_to_dbl_raise): check long invalid float string more precisely when truncating insignificant part. [ruby-core:86800] [Bug #14729] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@66880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e