------------------------------------------------------------------------
r67812 | nagachika | 2019-10-01 20:01:01 +0900 (Tue, 01 Oct 2019) | 1 line

add tag v2_6_5
------------------------------------------------------------------------
r67810 | nagachika | 2019-10-01 19:59:35 +0900 (Tue, 01 Oct 2019) | 4 lines

lib/shell/command-processor.rb (Shell#[]): prevent unknown command

`FileTest.send(command, ...)` allows to call not only FileTest-related
methods but also any method that belongs to Kernel, Object, etc.
------------------------------------------------------------------------
r67808 | nagachika | 2019-10-01 19:57:43 +0900 (Tue, 01 Oct 2019) | 9 lines

merge revision(s) 3ce238b5f9795581eb84114dcfbdf4aa086bfecc:

	WEBrick: prevent response splitting and header injection

	This is a follow up to d9d4a28f1cdd05a0e8dabb36d747d40bbcc30f16.
	The commit prevented CRLR, but did not address an isolated CR or an
	isolated LF.

	Co-Authored-By: NARUSE, Yui <naruse@airemix.jp>
------------------------------------------------------------------------
r67807 | nagachika | 2019-10-01 19:56:49 +0900 (Tue, 01 Oct 2019) | 6 lines

merge revision(s) 36e057e26ef2104bc2349799d6c52d22bb1c7d03:

	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.
------------------------------------------------------------------------
r67806 | nagachika | 2019-10-01 19:56:11 +0900 (Tue, 01 Oct 2019) | 6 lines

merge revision(s) a0a2640b398cffd351f87d3f6243103add66575b:

	Fix for wrong fnmatch patttern

	* dir.c (file_s_fnmatch): ensure that pattern does not contain a
	  NUL character.  https://hackerone.com/reports/449617
------------------------------------------------------------------------
r67805 | nagachika | 2019-09-28 13:32:46 +0900 (Sat, 28 Sep 2019) | 8 lines

merge revision(s) 8b3774be3dd9f472bddd99e84e3c9fe2ff99d7ac: [Backport #15935]

	Fix memory leak

	* string.c (str_make_independent_expand): free independent buffer.
	  [Bug# 15935]

	Co-Authored-By: luke-gru (Luke Gruber) <luke.gru@gmail.com>
------------------------------------------------------------------------
r67804 | nagachika | 2019-09-27 20:23:18 +0900 (Fri, 27 Sep 2019) | 15 lines

merge revision(s) 93faa011d393bb4b5cf31a0cbb46922f0a5e7cdc: [Backport #16151]

	Tag string shared roots to fix use-after-free

	The buffer deduplication codepath in rb_fstring can be used to free the buffer
	of shared string roots, which leads to use-after-free.

	Introudce a new flag to tag strings that at one point have been a shared root.
	Check for it in rb_fstring to avoid freeing buffers that are shared by
	multiple strings. This change is based on nobu's idea in [ruby-core:94838].

	The included test case test for the sequence of calls to internal functions
	that lead to this bug. See attached ticket for Ruby level repros.

	[Bug #16151]
------------------------------------------------------------------------
r67803 | nagachika | 2019-09-14 11:24:58 +0900 (Sat, 14 Sep 2019) | 15 lines

merge revision(s) ade1283ca276f7d589ffd3539fbc7b9817f682d5: [Backport #16136]

	Fix a use-after-free bug by avoiding rb_str_new_frozen

	`str2 = rb_str_new_frozen(str1)` seems to make str1 a shared string that
	refers to str2, but str2 is not marked as STR_IS_SHARED_M nor
	STR_NOFREE.
	`rb_fstring(str2)` frees str2's ptr because it is not marked, and the
	free'ed pointer is the same as str1's ptr.
	After that, accessing str1 may cause use-after-free memory corruption.

	I guess this is a bug of rb_str_new_frozen, but I'm completely unsure
	what it should be; the string states and flags are not documented.
	So, this is a workaround for [Bug #16136].  I confirmed that rspec of
	activeadmin runs gracefully.
------------------------------------------------------------------------
r67802 | nagachika | 2019-09-13 20:21:17 +0900 (Fri, 13 Sep 2019) | 15 lines

merge revision(s) 547887138f19959f649b1c0dbcde5659ae3878ed:

	test/ruby/test_fiber.rb: reduce the count of object creation to cause
	 GC

	The test consistently fails on OpenBSD.

	https://rubyci.org/logs/rubyci.s3.amazonaws.com/openbsd-current/ruby-master/log/20190903T010009Z.fail.html.gz
	```
	  1) Failure:
	TestFiber#test_fork_from_fiber [/home/chkbuild/chkbuild/tmp/build/20190903T010009Z/ruby/test/ruby/test_fiber.rb:327]:
	[ruby-core:41456].
	<0> expected but was
	<1>.
	```
------------------------------------------------------------------------
r67801 | nagachika | 2019-09-13 20:17:07 +0900 (Fri, 13 Sep 2019) | 8 lines

merge revision(s) b0b0ded5aa2cf7c4574b057d8326ed4e1c172c12:

	webrick/test_utils.rb: loosen timeout severity

	to stabilize CI failure like:
	https://rubyci.org/logs/rubyci.s3.amazonaws.com/osx1013/ruby-trunk/log/20181228T114501Z.fail.html.gz

	git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
------------------------------------------------------------------------
r67799 | nagachika | 2019-08-29 20:50:49 +0900 (Thu, 29 Aug 2019) | 1 line

bump up teeny version to 2.6.5.
------------------------------------------------------------------------
r67797 | nagachika | 2019-08-28 16:36:31 +0900 (Wed, 28 Aug 2019) | 7 lines

merge revision(s) f308ab2131ee675000926540cbb8c13c91dc3be5,989e8ad322afdfa3aa06e74b89fc42aef42895d0:

	Remove jquery.js


	Remove debug print [ci skip]

------------------------------------------------------------------------
r67792 | nagachika | 2019-08-28 14:41:10 +0900 (Wed, 28 Aug 2019) | 7 lines

merge revision(s) 4e038a7e64a9d52eed59b8f05647d4e58d265ec3: [Backport #5400]

	Revert "parse.y: Deprecate flip-flops"

	This reverts commit bae638ad5b782c44c80efe33834cb9039279af46.

	[Feature #5400]
------------------------------------------------------------------------
r67782 | nagachika | 2019-08-27 22:00:48 +0900 (Tue, 27 Aug 2019) | 1 line

bump up teeny version to 2.6.4.
------------------------------------------------------------------------
r67780 | nagachika | 2019-08-27 21:54:19 +0900 (Tue, 27 Aug 2019) | 1 line

Update rdoc version from 6.1.0 to 6.1.2.
------------------------------------------------------------------------
r67750 | nagachika | 2019-08-22 20:39:49 +0900 (Thu, 22 Aug 2019) | 6 lines

merge revision(s) fd0e3bd2497d4e796b719c7b7154dc3c945f87b1: [Backport #14834]

	fix VC 2013 compile error

	It seems the compiler does not support VLAs.
	See also: https://ci.appveyor.com/project/ruby/ruby/builds/26392589/job/px6nuiuw4e78weg1
------------------------------------------------------------------------
r67749 | nagachika | 2019-08-22 20:28:30 +0900 (Thu, 22 Aug 2019) | 4 lines

merge revision(s) 9557069299ac3b96691040a541afa65761a724ad: [Backport #15992]

	Avoid creating Hash objects per each mon_synchronize call (#2393)

------------------------------------------------------------------------
r67747 | nagachika | 2019-08-18 16:22:19 +0900 (Sun, 18 Aug 2019) | 7 lines

merge revision(s) d5c33364e3c0efb15e11df417c925afee2cdb9c9: [Backport #16105]

	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]
------------------------------------------------------------------------
r67746 | nagachika | 2019-08-18 15:53:02 +0900 (Sun, 18 Aug 2019) | 6 lines

merge revision(s) 5b1bf8dd2d08ae7371ecf025967376bb794ed651: [Backport #16099]

	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]
------------------------------------------------------------------------
r67745 | nagachika | 2019-08-18 15:10:46 +0900 (Sun, 18 Aug 2019) | 18 lines

merge revision(s) 5d33f787169bcc3594d2264726695d58c4a06899,8b162ce9d1003e4e469d8f48cb9a2076fd45b47c: [Backport #14834]

	fix tracepoint + backtrace SEGV

	PC modification in gc_event_hook_body was careless.  There are (so
	to say) abnormal iseqs stored in the cfp.  We have to check sanity
	before we touch the PC.

	This has not been fixed because there was no way to (ab)use the
	setup from pure-Ruby.  However by using our official C APIs it is
	possible to touch such frame(s), resulting in SEGV.

	Fixes [Bug #14834].

	Fix assertion failure when VM_CHECK_MODE

	Some VM frames (dummy and top pushed by `rb_vm_call_cfunc`) has
	iseq but has no pc.
------------------------------------------------------------------------
r67744 | nagachika | 2019-08-18 14:21:34 +0900 (Sun, 18 Aug 2019) | 12 lines

merge revision(s) df317151a5b4e0c5a30fcc321a9dc6abad63f7ed: [Backport #16019]

	should not free local hook_list here.

	exec_hooks_postcheck() clean executed hook_list if it is needed.
	list_exec is freed if there are no events and this list is local
	event (connected to specific iseq). However, iseq keeps to point
	this local hook_list, freed list. To prevent this situation,
	do not free hook_list here even if it has no events.

	This issue is reported by @joker1007.
	https://twitter.com/joker1007/status/1153649170797830144
------------------------------------------------------------------------
r67743 | nagachika | 2019-08-18 14:07:50 +0900 (Sun, 18 Aug 2019) | 10 lines

merge revision(s) f1b76ea63ce40670071a857f408a4747c571f1e9,1d1f98d49c9908f4e3928e582d31fd2e9f252f92: [Backport #16024]

	Occupy match data

	* string.c (rb_str_split_m): occupy match data not to be modified
	  during yielding the block.  [Bug #16024]

	Reuse match data

	* string.c (rb_str_split_m): reuse occupied match data.  [Bug #16024]
------------------------------------------------------------------------
r67742 | nagachika | 2019-08-18 13:32:59 +0900 (Sun, 18 Aug 2019) | 8 lines

merge revision(s) f91879a7b548284c93743168acfd11e3d2aeefac: [Backport #15992]

	handle_interrupt to defend monitor state [Bug #15992]

	If an exception is raised from another thread for example Timeout
	and this thread is just after `mon_exit`'s `@mon_owner = nil`,
	the exception breaks the state of MonitorMixin. To prevent that situation,
	it need to block interruption in mon_enter and mon_exit.
------------------------------------------------------------------------
r67741 | nagachika | 2019-08-11 21:17:58 +0900 (Sun, 11 Aug 2019) | 12 lines

merge revision(s) 8aecc90974ab1ac87056f77e2cb3406c5c041504,2f6cc15cdb3d64135b29cfd5ee376a5a03ebbee7: [Backport #15965]

	Hoisted out WIDE_ENCODINGS


	Fixed String#grapheme_clusters with wide encodings

	* string.c (get_reg_grapheme_cluster): make regexp from properly
	  encoded sources fro wide-char encodings.  [Bug #15965]

	* regparse.c (node_extended_grapheme_cluster): suppress false
	  duplicated range warning for the time being.
------------------------------------------------------------------------
r67740 | nagachika | 2019-08-09 23:28:00 +0900 (Fri, 09 Aug 2019) | 13 lines

merge revision(s) 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
------------------------------------------------------------------------
r67739 | nagachika | 2019-08-09 22:42:26 +0900 (Fri, 09 Aug 2019) | 6 lines

merge revision(s) 8f51da5d41f0642d5a971e4223d1ba14643c6398: [Backport #15946]

	Get rid of undefined behavior

	* string.c (rb_str_sub_bang): str and repl can be same.
	  [Bug #15946]
------------------------------------------------------------------------
r67738 | nagachika | 2019-08-09 22:41:04 +0900 (Fri, 09 Aug 2019) | 11 lines

merge revision(s) 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]
------------------------------------------------------------------------
r67737 | nagachika | 2019-08-08 01:30:37 +0900 (Thu, 08 Aug 2019) | 21 lines

merge revision(s) 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
------------------------------------------------------------------------
r67736 | nagachika | 2019-08-07 22:05:00 +0900 (Wed, 07 Aug 2019) | 15 lines

merge revision(s) 5931857281ce45c1c277aa86d1588119ab00a955,76e2370f132f83c16c9de39a0a9356579f364527: [Backport #16041]

	Fix dangling path name from fstring

	* parse.y (yycompile): make sure in advance that the `__FILE__`
	  object shares a fstring, to get rid of dangling path name.
	  Fixed up 53e9908d8afc7f03109b0aafd1698ab35f512b05.  [Bug #16041]

	* vm_eval.c (eval_make_iseq): ditto.

	Fix dangling path name from fstring

	* load.c (rb_require_internal): make sure in advance that the path
	  to be loaded shares a fstring, to get rid of dangling path name.
	  Fixed up 5931857281ce45c1c277aa86d1588119ab00a955.  [Bug #16041]
------------------------------------------------------------------------
r67735 | nagachika | 2019-08-07 21:38:15 +0900 (Wed, 07 Aug 2019) | 12 lines

merge revision(s) 1e54903684aa3c9ea3fe54520157846a1b1f07be: [Backport #16051]

	test/openssl: Support OpenSSL 1.1.1

	OpenSSL 1.1.1 rejects some shorter keys, which caused some failures of
	`make test-all TESTS=openssl`.

	https://rubyci.org/logs/rubyci.s3.amazonaws.com/debian/ruby-master/log/20190606T003005Z.fail.html.gz

	This change merges 6bbc31ddd1 and 63fb3a36d1 in
	https://github.com/ruby/openssl.
	Reference: https://github.com/ruby/openssl/pull/217
------------------------------------------------------------------------
r67734 | nagachika | 2019-08-07 21:25:24 +0900 (Wed, 07 Aug 2019) | 6 lines

merge revision(s) 43730256e800dd8e0c5cc482e9861868590ae037:

	open-uri: Regenerate server certificates for tests

	OpenSSL 1.1.1 requires 2048 bits or more.  This change will fix:
	https://rubyci.org/logs/rubyci.s3.amazonaws.com/debian/ruby-master/log/20190527T003004Z.fail.html.gz#test%2Fopen-uri
------------------------------------------------------------------------
r67733 | nagachika | 2019-08-07 21:23:48 +0900 (Wed, 07 Aug 2019) | 25 lines

merge revision(s) 9dec4e8fc3a6018261834b5ac9b9877f787b97ca: [Backport #15934]

	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]
------------------------------------------------------------------------
r67732 | nagachika | 2019-08-07 21:03:52 +0900 (Wed, 07 Aug 2019) | 15 lines

merge revision(s) 53e9908d8afc7f03109b0aafd1698ab35f512b05: [Backport #15916]

	Fix memory leak

	* string.c (str_replace_shared_without_enc): free previous buffer
	  before replaced.

	* parse.y (gettable): make sure in advance that the `__FILE__`
	  object shares a fstring, to get rid of replacement with the
	  fstring later.
	  TODO: this hack may be needed in other places.

	[Bug #15916]

	Co-Authored-By: luke-gru (Luke Gruber) <luke.gru@gmail.com>
------------------------------------------------------------------------
r67731 | nagachika | 2019-08-07 20:45:24 +0900 (Wed, 07 Aug 2019) | 80 lines

merge revision(s) 3f9562015e651735bfc2fdd14e8f6963b673e22a,c06ddfee878524168e4af07443217ed2f8d0954b,3b3b4a44e57dfe03ce3913009d69a33d6f6100be: [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

------------------------------------------------------------------------
r67730 | nagachika | 2019-08-07 19:52:38 +0900 (Wed, 07 Aug 2019) | 1 line

Update Xcode or Homebrew (apply https://github.com/nobu/ruby/commit/c86b74dc431d4cbdeb7d3c3fe5ac0693dc731bb1) [Bug #16032]
------------------------------------------------------------------------
r67729 | nagachika | 2019-08-05 23:05:59 +0900 (Mon, 05 Aug 2019) | 5 lines

merge revision(s) 5e018214e7435030727a97ac49db038d96438e74: [Backport #15720]

	Fix SystemStackError when calling a method in an unused refinement

	Fixes [Bug #15720]
------------------------------------------------------------------------
r67728 | nagachika | 2019-08-05 22:53:03 +0900 (Mon, 05 Aug 2019) | 5 lines

merge revision(s) c1d78a7f0ece2004822193a0c1f1fd3dc38c2fdf: [Backport #15360]

	do_mutex_lock: release mutex before checking for interrupts (fixes
	 issue 15360)

------------------------------------------------------------------------
r67727 | nagachika | 2019-08-05 22:39:48 +0900 (Mon, 05 Aug 2019) | 6 lines

merge revision(s) 2403f9ac3af170ce0107a709a9cb510fe0501648:

	Expand the timeout of
	 `test_pstore_files_are_accessed_as_binary_files`

	Sometimes causes timeout error on mswin CI
------------------------------------------------------------------------
r67726 | nagachika | 2019-08-04 23:29:17 +0900 (Sun, 04 Aug 2019) | 10 lines

merge revision(s) 66977: [Backport #15578]

	Revert r63383, r63248 "compile.c: copy a short insn with leave"

	When copying `leave` insn, TRACE also should be copied if it is
	present, but this optimization is trivial and not worth the
	complexity.  [ruby-core:91366] [Bug #15578]

	4cae5353c03009beb1e0a1619422072773580609
	5afd479de63b6609ddcd1510da94d2c1ac384f7f
------------------------------------------------------------------------
r67725 | nagachika | 2019-08-03 21:27:02 +0900 (Sat, 03 Aug 2019) | 22 lines

merge revision(s) 1ef39d8d099f145222b9352423af16a2bab6e05b: [Backport #15798]

	Fix process not waking up on signals on OpenBSD

	When using UBF_TIMER_PTHREAD (the UBF handler on OpenBSD), the
	timer_pthread_fn function will not signal the main thread with
	SIGVTALRM in cases where timer_pthread is armed before
	consume_communication_pipe is called.  This is because
	consume_communication_pipe will unarm the timer.

	Fix this by checking the return value of consume_communication_pipe.
	If it returns TRUE and the timer_pthread is disarmed, then signal
	the main thread with SIGVTALRM.

	On OpenBSD, this fixes TestThread#test_thread_timer_and_interrupt, and
	fixes hangs in TestProcess#test_execopts_redirect_open_fifo_interrupt_raise
	and TestProcess#test_execopts_redirect_open_fifo_interrupt_print.
	It also fixes the use of Ctrl+C/SIGINT in irb on OpenBSD. It does not
	cause any test failures on Linux when UBF_TIMER_PTHREAD is forced as
	the UBF handler.

	Fixes [Bug #15798]
------------------------------------------------------------------------
r67724 | nagachika | 2019-08-01 22:56:16 +0900 (Thu, 01 Aug 2019) | 14 lines

merge revision(s) 6375c68f8851e1e0fee8a95afba91c4555097127,c05eaa93258ddc01e685b6cc3a0da82998a2af48: [Backport #15839]

	parse.y: function parser_mixed_error & parser_mixed_escape

	git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

	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]
------------------------------------------------------------------------
r67723 | nagachika | 2019-08-01 22:18:27 +0900 (Thu, 01 Aug 2019) | 7 lines

merge revision(s) 5bab1304af25a843728dbcd2f3594913740aecb0: [Backport #15847]

	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]
------------------------------------------------------------------------
r67721 | nagachika | 2019-07-31 23:47:34 +0900 (Wed, 31 Jul 2019) | 9 lines

merge revision(s) ea42423908ed055f9039b1dce6e9a232a3b2dd90: [Backport #15887]

	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]
------------------------------------------------------------------------
r67720 | nagachika | 2019-07-31 23:32:43 +0900 (Wed, 31 Jul 2019) | 10 lines

merge revision(s) b165bedcbd41d791a85fc1ce90b57a0d0525f319,ac00bdc8a8ac2c62a94dd36a7784d15bbcb7df19: [Backport #15821]

	skip a test to pass CIs.

	I'm debugging [Bug #15821] but my patch introduces another issue.
	So I simply skip this test and re-enable it later.

	Do not modify shared array

	[Bug #15821]
------------------------------------------------------------------------
r67719 | nagachika | 2019-07-31 23:14:59 +0900 (Wed, 31 Jul 2019) | 5 lines

merge revision(s) 374c8f4ebab1a740990330c732b9de965c5e8d10: [Backport #15823]

	Fixed about ARGF.lineno

	[Bug #15823]
------------------------------------------------------------------------
r67718 | nagachika | 2019-07-31 23:10:09 +0900 (Wed, 31 Jul 2019) | 12 lines

merge revision(s) 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]
------------------------------------------------------------------------
r67716 | nagachika | 2019-07-28 23:16:53 +0900 (Sun, 28 Jul 2019) | 5 lines

merge revision(s) a6a26e42b15c46f117f4fce07a2050e9d727355d: [Backport #15906]

	compile.c: Partially revert r63870 which caused wrong optimization

	[Bug #15906]
------------------------------------------------------------------------
r67715 | nagachika | 2019-07-28 23:02:10 +0900 (Sun, 28 Jul 2019) | 4 lines

merge revision(s) dcb6a6ae3e2b8a3e298e7f0d4a3e7f8ff102a30e: [Backport #15845]

	Windows simply causes an error to open invalid path

------------------------------------------------------------------------
r67714 | nagachika | 2019-07-26 08:17:08 +0900 (Fri, 26 Jul 2019) | 5 lines

merge revision(s) b72623012d74abdb06210153ed48c9e2fa075bbd: [Backport #15775]

	Update broken URL in Float documentation.

	  [Misc #15775][ruby-core:92332]
------------------------------------------------------------------------
r67713 | nagachika | 2019-07-26 08:11:57 +0900 (Fri, 26 Jul 2019) | 18 lines

merge revision(s) a15f7dd1fb1148c3d586238ee6907875f2e40379: [Backport #15803]

	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]
------------------------------------------------------------------------
r67712 | nagachika | 2019-06-22 10:56:07 +0900 (Sat, 22 Jun 2019) | 4 lines

merge revision(s) 5e23b1138f16af0defb184d7deeffadfd2ce3c04: [Backport #15820]

	Fix potential memory leak

------------------------------------------------------------------------
r67711 | nagachika | 2019-06-16 12:20:55 +0900 (Sun, 16 Jun 2019) | 7 lines

merge revision(s) af1e487e9bb763b939dc6704c9a343c9eafa1637,6f8ac2cb28f99a4b2588c59ec44eff6ed38c4d3b: [Backport #15801]

	Updated marked commits for ChangeLog


	Include the beginning commit in ChangeLog

------------------------------------------------------------------------
r67710 | nagachika | 2019-06-13 21:23:01 +0900 (Thu, 13 Jun 2019) | 119 lines

merge revision(s) 7b7043e5da8589e01b94575d4ed647e909e5c875: [Backport #15793]

	eliminate use of freed memory

	rb_io_fptr_finalize_internal frees the memory region.

	=================================================================
	==85264==ERROR: AddressSanitizer: heap-use-after-free on address 0x610000000d8c at pc 0x5608e38077f7 bp 0x7ffee12d5440 sp 0x7ffee12d5438
	READ of size 4 at 0x610000000d8c thread T0
	    #0 0x5608e38077f6 in rb_io_memsize io.c:4749:24
	    #1 0x5608e37a0481 in obj_memsize_of gc.c:3547:14
	    #2 0x5608e37a4f30 in check_rvalue_consistency gc.c:1107:2
	    #3 0x5608e37a2624 in RVALUE_OLD_P gc.c:1218:5
	    #4 0x5608e37a5bae in rb_gc_force_recycle gc.c:6652:18
	    #5 0x5608e38191f9 in rb_f_backquote io.c:9021:5
	    #6 0x5608e3d8aa14 in call_cfunc_1 vm_insnhelper.c:2058:12
	    #7 0x5608e3d6e23d in vm_call_cfunc_with_frame vm_insnhelper.c:2211:11
	    #8 0x5608e3d54a35 in vm_call_cfunc vm_insnhelper.c:2229:12
	    #9 0x5608e3d5253b in vm_call_method_each_type vm_insnhelper.c:2564:9
	    #10 0x5608e3d51f50 in vm_call_method vm_insnhelper.c:2701:13
	    #11 0x5608e3cf2de4 in vm_call_general vm_insnhelper.c:2734:12
	    #12 0x5608e3d79918 in vm_sendish vm_insnhelper.c:3627:11
	    #13 0x5608e3d06cf5 in vm_exec_core insns.def:789:11
	    #14 0x5608e3d43700 in rb_vm_exec vm.c:1892:22
	    #15 0x5608e3d47cbf in rb_iseq_eval_main vm.c:2151:11
	    #16 0x5608e37620ca in ruby_exec_internal eval.c:262:2
	    #17 0x5608e376198b in ruby_exec_node eval.c:326:12
	    #18 0x5608e37617d0 in ruby_run_node eval.c:318:25
	    #19 0x5608e35c9486 in main main.c:42:9
	    #20 0x7f62e9421b96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
	    #21 0x5608e3522289 in _start (miniruby+0x15f289)

	0x610000000d8c is located 76 bytes inside of 192-byte region [0x610000000d40,0x610000000e00)
	freed by thread T0 here:
	    #0 0x5608e359a2ed in free (miniruby+0x1d72ed)
	    #1 0x5608e37af421 in objspace_xfree gc.c:9591:5
	    #2 0x5608e37af3da in ruby_sized_xfree gc.c:9687:2
	    #3 0x5608e3799ac8 in ruby_xfree gc.c:9694:5
	    #4 0x5608e380746d in rb_io_fptr_finalize_internal io.c:4728:5
	    #5 0x5608e38191ed in rb_f_backquote io.c:9020:5
	    #6 0x5608e3d8aa14 in call_cfunc_1 vm_insnhelper.c:2058:12
	    #7 0x5608e3d6e23d in vm_call_cfunc_with_frame vm_insnhelper.c:2211:11
	    #8 0x5608e3d54a35 in vm_call_cfunc vm_insnhelper.c:2229:12
	    #9 0x5608e3d5253b in vm_call_method_each_type vm_insnhelper.c:2564:9
	    #10 0x5608e3d51f50 in vm_call_method vm_insnhelper.c:2701:13
	    #11 0x5608e3cf2de4 in vm_call_general vm_insnhelper.c:2734:12
	    #12 0x5608e3d79918 in vm_sendish vm_insnhelper.c:3627:11
	    #13 0x5608e3d06cf5 in vm_exec_core insns.def:789:11
	    #14 0x5608e3d43700 in rb_vm_exec vm.c:1892:22
	    #15 0x5608e3d47cbf in rb_iseq_eval_main vm.c:2151:11
	    #16 0x5608e37620ca in ruby_exec_internal eval.c:262:2
	    #17 0x5608e376198b in ruby_exec_node eval.c:326:12
	    #18 0x5608e37617d0 in ruby_run_node eval.c:318:25
	    #19 0x5608e35c9486 in main main.c:42:9
	    #20 0x7f62e9421b96 in __libc_start_main
	/build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310

	previously allocated by thread T0 here:
	    #0 0x5608e359a56d in malloc (miniruby+0x1d756d)
	    #1 0x5608e37aed12 in objspace_xmalloc0 gc.c:9416:5
	    #2 0x5608e37aebe7 in ruby_xmalloc0 gc.c:9600:12
	    #3 0x5608e37aea8b in ruby_xmalloc_body gc.c:9609:12
	    #4 0x5608e37a6d64 in ruby_xmalloc gc.c:11469:12
	    #5 0x5608e380e4b4 in rb_io_fptr_new io.c:8040:19
	    #6 0x5608e380e446 in rb_io_make_open_file io.c:8077:10
	    #7 0x5608e3850ea0 in pipe_open io.c:6707:5
	    #8 0x5608e384edb4 in pipe_open_s io.c:6772:12
	    #9 0x5608e381910b in rb_f_backquote io.c:9014:12
	    #10 0x5608e3d8aa14 in call_cfunc_1 vm_insnhelper.c:2058:12
	    #11 0x5608e3d6e23d in vm_call_cfunc_with_frame vm_insnhelper.c:2211:11
	    #12 0x5608e3d54a35 in vm_call_cfunc vm_insnhelper.c:2229:12
	    #13 0x5608e3d5253b in vm_call_method_each_type vm_insnhelper.c:2564:9
	    #14 0x5608e3d51f50 in vm_call_method vm_insnhelper.c:2701:13
	    #15 0x5608e3cf2de4 in vm_call_general vm_insnhelper.c:2734:12
	    #16 0x5608e3d79918 in vm_sendish vm_insnhelper.c:3627:11
	    #17 0x5608e3d06cf5 in vm_exec_core insns.def:789:11
	    #18 0x5608e3d43700 in rb_vm_exec vm.c:1892:22
	    #19 0x5608e3d47cbf in rb_iseq_eval_main vm.c:2151:11
	    #20 0x5608e37620ca in ruby_exec_internal eval.c:262:2
	    #21 0x5608e376198b in ruby_exec_node eval.c:326:12
	    #22 0x5608e37617d0 in ruby_run_node eval.c:318:25
	    #23 0x5608e35c9486 in main main.c:42:9
	    #24 0x7f62e9421b96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310

	SUMMARY: AddressSanitizer: heap-use-after-free io.c:4749:24 in
	rb_io_memsize
	Shadow bytes around the buggy address:
	  0x0c207fff8160: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
	  0x0c207fff8170: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
	  0x0c207fff8180: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
	  0x0c207fff8190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
	  0x0c207fff81a0: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
	=>0x0c207fff81b0: fd[fd]fd fd fd fd fd fd fd fd fd fd fd fd fd fd
	  0x0c207fff81c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
	  0x0c207fff81d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
	  0x0c207fff81e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
	  0x0c207fff81f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
	  0x0c207fff8200: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
	Shadow byte legend (one shadow byte represents 8 application bytes):
	  Addressable:           00
	  Partially addressable: 01 02 03 04 05 06 07
	  Heap left redzone:       fa
	  Freed heap region:       fd
	  Stack left redzone:      f1
	  Stack mid redzone:       f2
	  Stack right redzone:     f3
	  Stack after return:      f5
	  Stack use after scope:   f8
	  Global redzone:          f9
	  Global init order:       f6
	  Poisoned by user:        f7
	  Container overflow:      fc
	  Array cookie:            ac
	  Intra object redzone:    bb
	  ASan internal:           fe
	  Left alloca redzone:     ca
	  Right alloca redzone:    cb
	  Shadow gap:              cc
	==85264==ABORTING
------------------------------------------------------------------------
r67571 | svn | 2019-04-16 09:02:01 +0900 (Tue, 16 Apr 2019) | 1 line

* 2019-04-16
------------------------------------------------------------------------
r67570 | knu | 2019-04-16 09:02:00 +0900 (Tue, 16 Apr 2019) | 1 line

Mention SNI support in Net::IMAP
------------------------------------------------------------------------
r67567 | naruse | 2019-04-15 23:42:35 +0900 (Mon, 15 Apr 2019) | 6 lines

merge revision(s) 67561:

	Import CSV 3.0.9

	This fixes test failures on Windows.

------------------------------------------------------------------------
r67565 | naruse | 2019-04-15 22:36:58 +0900 (Mon, 15 Apr 2019) | 14 lines

merge revision(s) 67560,67561:

        Import CSV 3.0.8

        This includes performance improvements and backward incompatibility
        fixes.


        Import CSV 3.0.9

        This fixes test failures on Windows.

Note that r67562's commit message is wrong.

------------------------------------------------------------------------
r67564 | naruse | 2019-04-15 22:27:53 +0900 (Mon, 15 Apr 2019) | 9 lines

merge revision(s) 67563:

	Support SNI (Reapplying r67488)

	This fixes connecting using TLS 1.3 to imap.gmail.com

	[Fix GH-2077] [Feature #15594]

	From: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
------------------------------------------------------------------------
r67562 | naruse | 2019-04-15 18:22:11 +0900 (Mon, 15 Apr 2019) | 8 lines

merge revision(s) 66720:

        separate downloading of Unicode property files and auxiliary files

        Separate downloading of Unicode property files in ucd and in ucd/auxiliary.
        This is needed because we need information from separate index.html files
        to discover the exact file names of property files during a beta period.

------------------------------------------------------------------------
r67529 | naruse | 2019-04-14 07:18:20 +0900 (Sun, 14 Apr 2019) | 7 lines

merge revision(s) 66720:

	separate downloading of Unicode property files and auxiliary files

	Separate downloading of Unicode property files in ucd and in ucd/auxiliary.
	This is needed because we need information from separate index.html files
	to discover the exact file names of property files during a beta period.
------------------------------------------------------------------------
r67528 | naruse | 2019-04-14 07:04:51 +0900 (Sun, 14 Apr 2019) | 45 lines

merge revision(s) 66737,66738,67413,67445,67446,67447,67448,67450,67451,67454:

	add logic to handle Unicode beta period file names

	In downloader.rb, add logic to handle file names of the form
	UnicodeData-12.0.0d6.txt. To find the right file, we download
	the index of the directory. Then we download the files by finding
	the file names from the index. Files are always checked for changes,
	because changes might be frequent during the beta period.
	We also check whether any index.html files are left when we are not
	in the beta period. This would indicate that we might have stale
	data from the beta period rather than the actual release data.

	simplify filename-related code

	(Thanks to Nobuyoshi Nakada for the hint!)

	downloader.rb: keep linked file newer than cached file

	* tool/downloader.rb (Downloader.save_cache): keep linked file
	  newer than cached file, so that GNU make triggers when the
	  content is updated.  it uses the timestamp of symlink itself
	  instead of the target.

	add puts statements to debug Unicode file download (temporary)

	Unicode file download doesn't work with Visual Studio, see e.g.
	https://ci.appveyor.com/project/ruby/ruby/builds/23614399/job/f8vya2l7fjdfcye4
	We temporarily produce more output for debugging.

	* remove trailing spaces.

	output more debug information in downloader.rb (temporary)

	Unicode file download doesn't work with Visual Studio, we need more debug output.

	downloader.rb: quote base name

	downloader.rb: fix typo, extra %

	revert r67445, (r67446,) r67447

	Debugging output is no longer needed because the problem has been fixed with r67449.

	appveyor.yml: Use pre-generated headers and tables
------------------------------------------------------------------------
r67527 | naruse | 2019-04-14 00:14:02 +0900 (Sun, 14 Apr 2019) | 31 lines

merge revision(s) 66745,67397,67398,67399,67400,67409,67410,67411,67412,67425,67426,67473,67474: [Backport #15742]

	Bump version to date-2.0.0.

	  I forgot to change it when Ruby 2.6.0 was released.

	date_parse.c: extract Japanese era initials

	* expand tabs.

	date_parse.c: removed 'r' which is not in JIS X 0301 yet

	Added tests for end of Heisei

	date: use del_hash to extract an element destructively

	* expand tabs.

	date_parse.c: renamed JAPANESE prefix as JISX0301

	date_parse.c: name JISX0301_DEFAULT_ERA

	date: make zone a substring to copy encoding and taintedness

	* expand tabs.

	date_core.c: [DOC] Heisei will be assumed if no-era [ci skip]

	date: support for Reiwa, new Japanese era

	[Feature #15742]
------------------------------------------------------------------------
r67526 | svn | 2019-04-14 00:01:42 +0900 (Sun, 14 Apr 2019) | 1 line

* 2019-04-14
------------------------------------------------------------------------
r67525 | naruse | 2019-04-14 00:01:39 +0900 (Sun, 14 Apr 2019) | 32 lines

merge revision(s) 67439,67441,67453,67476: [Backport #15740]

        change lib/unicode_normalize/tables.rb to single item per line to make diffs shorter

        * template/unicode_norm_gen.tmpl: Change formatting of output to produce only a
          single item (or range) for each line to make future diffs shorter and easier
          to understand and check.

        * lib/unicode_normalize/tables.rb: output of the above

        update to Unicode Version 12.1.0 (beta)

        Unicode Version 12.1.0 adds one single character, U+32FF SQUARE ERA NAME REIWA,
        for the new Japanese era starting on May 1st. 12.1.0 will be finalized only on
        May 7th, so we go with the beta version because further changes in the data we
        need are highly unlikely, and we want to make sure Ruby is ready for the new era.

        * common.mk: change UNICODE_VERSION to 12.1.0, UNICODE_BETA to YES

        * enc/unicode/12.1.0, enc/unicode/12.1.0/casefold.h, enc/unicode/12.1.0/name2ctype.h:
          add directory and generated data files for new version

        * lib/unicode_normalize/tables.rb: update for new character

        * test/ruby/test_regexp.rb: add test for character property age=12.1

