1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test/ruby
nagachika 63d9ab33fe merge revision(s) 62934,63210,63215,63309: [Backport #14634]
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-23 14:14:25 +00:00
..
enc merge revision(s) 65954,65955,65958: [Backport #15337] 2018-11-28 13:36:08 +00:00
allpairs.rb
beginmainend.rb
bug-11928.rb
bug-13526.rb test/ruby/bug-13526.rb: should wait until all threads are stopped 2017-11-21 00:56:09 +00:00
lbtest.rb Remove unnecessary require 'thread' 2017-10-08 07:00:01 +00:00
marshaltestlib.rb
sentence.rb
test_alias.rb test/ruby: tweaked heredocs 2017-08-29 07:11:52 +00:00
test_argf.rb io.c: encoding of ARGF.inplace_mode 2017-10-10 12:30:42 +00:00
test_arity.rb
test_array.rb merge revision(s) 66756: [Backport #15479] 2019-01-10 15:02:21 +00:00
test_assignment.rb
test_autoload.rb merge revision(s) 62934,63210,63215,63309: [Backport #14634] 2019-01-23 14:14:25 +00:00
test_backtrace.rb Remove unnecessary require 'thread' 2017-10-08 07:00:01 +00:00
test_basicinstructions.rb
test_beginendblock.rb test/ruby: tweaked heredocs 2017-08-29 07:11:52 +00:00
test_bignum.rb Handle exception explicitly in TestBignum#test_interrupt_during_to_s 2017-12-12 19:48:32 +00:00
test_call.rb test_call.rb: refine test_safe_call 2017-10-02 11:43:36 +00:00
test_case.rb
test_class.rb Add FrozenError as a subclass of RuntimeError 2017-12-12 00:46:34 +00:00
test_clone.rb
test_comparable.rb
test_complex.rb merge revision(s) 62107: [Backport #14420] 2018-02-22 21:41:46 +00:00
test_complex2.rb
test_complexrational.rb
test_condition.rb
test_const.rb
test_continuation.rb Fix test-all tests to avoid creating report_on_exception warnings 2017-12-12 18:44:49 +00:00
test_defined.rb merge revision(s) 62071: [Backport #14407] 2018-02-25 00:36:43 +00:00
test_dir.rb dir.c: check NUL bytes 2018-03-28 09:26:04 +00:00
test_dir_m17n.rb High Sierra's APFS cannot use invalid filenames [Bug #13816] 2017-08-15 21:33:43 +00:00
test_econv.rb
test_encoding.rb test/ruby: tweaked heredocs 2017-08-29 07:11:52 +00:00
test_enum.rb merge revision(s) 64014: [Backport #14926] 2018-09-01 02:31:27 +00:00
test_enumerator.rb merge revision(s) 62731,62735: [Backport #14495] 2018-07-02 08:30:36 +00:00
test_env.rb test/ruby/test_env.rb: suppress a warning 2017-12-13 10:43:21 +00:00
test_eval.rb Add FrozenError as a subclass of RuntimeError 2017-12-12 00:46:34 +00:00
test_exception.rb merge revision(s) 65554: [Backport #15282] 2018-11-06 15:52:16 +00:00
test_fiber.rb merge revision(s) 64589,64593: [Backport #15041] 2019-01-14 09:23:45 +00:00
test_file.rb merge revision(s) 62606,62607: [Backport #14557] 2018-03-02 08:25:51 +00:00
test_file_exhaustive.rb merge revision(s) 62952: [Backport #14638] 2018-08-17 16:27:13 +00:00
test_fixnum.rb
test_flip.rb
test_float.rb merge revision(s) 63334: [Backport #14729] 2019-01-20 09:17:59 +00:00
test_fnmatch.rb Revert "Dir.glob with FNM_EXTGLOB is optimized [Feature #13873]" 2017-10-27 08:40:40 +00:00
test_gc.rb Revert "Revert "Manage AST NODEs out of GC"" 2017-10-27 16:44:57 +00:00
test_hash.rb merge revision(s) 62042,62044: [Backport #14380] 2018-03-22 07:00:17 +00:00
test_ifunless.rb
test_integer.rb numeric.c: use NUM2DBL 2017-09-22 03:05:02 +00:00
test_integer_comb.rb Integer#allbits?, Integer#anybits?, Integer#nobits? [Feature #12753] 2017-12-12 09:12:14 +00:00
test_io.rb test/ruby/test_io.rb (test_select_leak): extend timeout for Arch Linux[Backport 14929] 2018-09-02 03:43:25 +00:00
test_io_m17n.rb io.c: read BOM only for reading 2017-11-23 07:10:56 +00:00
test_iseq.rb conceptually partial backport from r63103, r65567. 2018-12-09 06:46:44 +00:00
test_iterator.rb check break target correctly. 2017-06-08 04:13:51 +00:00
test_keyword.rb merge revision(s) 64786: [Backport #15087] 2018-11-06 14:49:59 +00:00
test_lambda.rb
test_lazy_enumerator.rb merge revision(s) 62731,62735: [Backport #14495] 2018-07-02 08:30:36 +00:00
test_literal.rb Add FrozenError as a subclass of RuntimeError 2017-12-12 00:46:34 +00:00
test_m17n.rb
test_m17n_comb.rb
test_marshal.rb merge revision(s) 61616: [Backport #14314] 2018-02-16 08:34:45 +00:00
test_math.rb
test_metaclass.rb
test_method.rb merge revision(s) 63067,63068: [Backport #14658] 2018-10-09 14:39:16 +00:00
test_mixed_unicode_escapes.rb merge revision(s) 61862: [Backport #14368] 2018-02-22 22:04:35 +00:00
test_module.rb merge revision(s) 63696: [Backport #14853] 2018-07-02 08:53:52 +00:00
test_not.rb
test_notimp.rb apply timeout scale 2017-05-27 02:01:41 +00:00
test_numeric.rb merge revision(s) 61517: [Backport #14259] 2018-01-05 20:40:12 +00:00
test_object.rb Add FrozenError as a subclass of RuntimeError 2017-12-12 00:46:34 +00:00
test_objectspace.rb
test_optimization.rb merge revision(s) 63040: [Backport #14553] 2018-12-02 07:13:22 +00:00
test_pack.rb merge revision(s) 65125: 2018-10-17 15:06:18 +00:00
test_parse.rb merge revision(s) 61523: [Backport #14261] 2018-02-21 05:42:42 +00:00
test_path.rb
test_pipe.rb
test_primitive.rb
test_proc.rb merge revision(s) 61625,61626,61627: 2018-01-05 20:40:54 +00:00
test_process.rb extend timeout limit. 2017-12-20 00:24:19 +00:00
test_rand.rb Add FrozenError as a subclass of RuntimeError 2017-12-12 00:46:34 +00:00
test_range.rb Add FrozenError as a subclass of RuntimeError 2017-12-12 00:46:34 +00:00
test_rational.rb merge revision(s) 62555: [Backport #14547] 2018-02-24 07:19:48 +00:00
test_rational2.rb
test_readpartial.rb
test_refinement.rb merge revision(s) 61484: [Backport #14232] 2018-02-21 06:16:32 +00:00
test_regexp.rb Revert r61192 and r61193 2017-12-12 23:41:34 +00:00
test_require.rb load.c: real path to load 2017-09-21 07:29:20 +00:00
test_rubyoptions.rb merge revision(s) 64900: [Backport #15190] 2018-10-09 14:25:37 +00:00
test_rubyvm.rb
test_settracefunc.rb merge revision(s) 63727: [Backport #14865] 2018-08-18 05:04:31 +00:00
test_signal.rb remove ruby_kill() introduced for [Bug #7951]. 2017-06-12 04:52:25 +00:00
test_sleep.rb
test_sprintf.rb error.c: KeyError#receiver and KeyError#key 2017-09-18 08:05:53 +00:00
test_sprintf_comb.rb
test_string.rb merge revision(s) 65954,65955,65958: [Backport #15337] 2018-11-28 13:36:08 +00:00
test_stringchar.rb
test_struct.rb struct.c: show keyword_init: true on inspect 2017-12-12 15:03:45 +00:00
test_super.rb merge revision(s) 61603: [Backport #14279] 2018-02-16 07:32:11 +00:00
test_symbol.rb Suppress warning: method redefined; discarding old == 2017-07-03 08:08:29 +00:00
test_syntax.rb merge revision(s) 65460: [Backport #15271] 2018-11-06 15:31:15 +00:00
test_system.rb
test_thread.rb merge revision(s) 62668: [Backport #14578] 2018-03-20 02:08:27 +00:00
test_threadgroup.rb Remove unnecessary require 'thread' 2017-10-08 07:00:01 +00:00
test_time.rb merge revision(s) 65974: [Backport #15340] 2019-01-16 15:32:54 +00:00
test_time_tz.rb merge revision(s) 63823,63839: [Backport #14890] 2019-01-10 14:46:41 +00:00
test_trace.rb
test_transcode.rb Add FrozenError as a subclass of RuntimeError 2017-12-12 00:46:34 +00:00
test_undef.rb
test_unicode_escape.rb
test_variable.rb Add FrozenError as a subclass of RuntimeError 2017-12-12 00:46:34 +00:00
test_vm_dump.rb test_vm_dump.rb: skip if gcc 2017-12-16 00:36:31 +00:00
test_weakmap.rb skip tests temporarily 2017-10-27 18:55:28 +00:00
test_whileuntil.rb
test_yield.rb
ut_eof.rb