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
Jeremy Evans ad729a1d11 Fix origin iclass pointer for modules
If a module has an origin, and that module is included in another
module or class, previously the iclass created for the module had
an origin pointer to the module's origin instead of the iclass's
origin.

Setting the origin pointer correctly requires using a stack, since
the origin iclass is not created until after the iclass itself.
Use a hidden ruby array to implement that stack.

Correctly assigning the origin pointers in the iclass caused a
use-after-free in GC.  If a module with an origin is included
in a class, the iclass shares a method table with the module
and the iclass origin shares a method table with module origin.

Mark iclass origin with a flag that notes that even though the
iclass is an origin, it shares a method table, so the method table
should not be garbage collected.  The shared method table will be
garbage collected when the module origin is garbage collected.
I've tested that this does not introduce a memory leak.

This change caused a VM assertion failure, which was traced to callable
method entries using the incorrect defined_class.  Update
rb_vm_check_redefinition_opt_method and find_defined_class_by_owner
to treat iclass origins different than class origins to avoid this
issue.

This also includes a fix for Module#included_modules to skip
iclasses with origins.

Fixes [Bug #16736]
2020-05-22 20:31:23 -07:00
..
enc support multi-run for test/ruby/enc/test_regex_casefold.rb 2020-01-29 13:08:40 +09:00
allpairs.rb
beginmainend.rb
bug-11928.rb
bug-13526.rb
lbtest.rb
marshaltestlib.rb
sentence.rb Fixed misspellings 2019-12-20 09:32:42 +09:00
test_alias.rb Merge pull request #2721 from jeremyevans/method-inspect-chain-alias-11188 2020-03-22 09:30:20 -07:00
test_argf.rb Pass keyword arguments to IOs properly [Bug #16639] 2020-02-18 14:35:46 +09:00
test_arithmetic_sequence.rb
test_arity.rb
test_array.rb support multiple run for test/ruby/test_array. 2020-01-28 15:23:51 +09:00
test_assignment.rb Fixed misspellings 2019-12-20 09:32:42 +09:00
test_ast.rb Added test for f38b3e8c70 2020-01-17 16:56:53 +09:00
test_autoload.rb fix for multi-run test. 2020-05-15 14:54:03 +09:00
test_backtrace.rb
test_basicinstructions.rb support multi-run for ruby/test_basicinstructions.rb 2020-01-28 15:23:51 +09:00
test_beginendblock.rb
test_bignum.rb
test_call.rb
test_case.rb
test_class.rb Make yield in singleton class definitions in methods a SyntaxError 2020-02-11 12:44:23 -08:00
test_clone.rb
test_comparable.rb Raise on end-exclusive ranges [Feature #14784] 2019-10-26 12:52:50 +09:00
test_complex.rb Make Kernel#{Pathname,BigDecimal,Complex} return argument if given correct type 2019-09-21 16:10:37 -07:00
test_complex2.rb
test_complexrational.rb
test_condition.rb
test_const.rb refactoring: use Proc and Constant. 2020-01-29 00:54:05 +09:00
test_continuation.rb
test_default_gems.rb Skip test_validate_gemspec when tarball and git installed too 2019-11-23 01:57:19 +09:00
test_defined.rb Fix typo in test name 2020-05-08 07:46:33 +09:00
test_dir.rb Assertions for basic use of encoding: option 2020-04-11 12:59:45 +09:00
test_dir_m17n.rb Make rb_scan_args handle keywords more similar to Ruby methods (#2460) 2019-09-25 11:18:49 -07:00
test_econv.rb Warn when :newline precedes other newline options 2020-01-11 10:42:22 +09:00
test_encoding.rb Get rid of warnings/exceptions at cleanup 2020-02-13 12:46:48 +09:00
test_enum.rb Fix memory corruption in Enumerable#reverse_each [ruby-dev:50867] [Bug #16354] 2019-11-19 15:35:14 -06:00
test_enumerator.rb Make Enumerator::Chain#each treat lambdas as lambda 2019-12-03 23:18:28 +02:00
test_env.rb Environment variable values are not case-insensitive 2020-04-18 23:19:57 +09:00
test_eval.rb support multi-run for test/ruby/test_eval.rb 2020-01-28 15:23:51 +09:00
test_exception.rb eval_error.c: default nil as "reverse" is now false [Feature #8661] 2020-04-21 19:29:16 +09:00
test_fiber.rb Thread scheduler for light weight concurrency. 2020-05-14 22:10:55 +12:00
test_file.rb Use a temporary file for chown test 2019-12-18 13:35:58 +09:00
test_file_exhaustive.rb Revert "Should return "." for File.extname("file.") also on Windows" 2019-12-23 11:54:25 +09:00
test_fixnum.rb
test_flip.rb Revert "Remove warnings of flip-flop deprecation from tests and specs" 2019-08-29 11:10:45 +09:00
test_float.rb numeric.c: optimize float ** 2 case by fastpath 2020-05-12 02:14:27 +09:00
test_fnmatch.rb Fix for wrong fnmatch patttern 2019-10-01 19:19:56 +09:00
test_frozen_error.rb Split test_frozen_error.rb 2019-12-31 19:43:36 +09:00
test_gc.rb Run major GC three times to make sure the minor GC reason 2020-05-22 11:12:40 +09:00
test_gc_compact.rb Moved GC.verify_compaction_references to gc.rb 2020-01-27 10:52:37 +09:00
test_hash.rb Proc made by Hash#to_proc should be a lambda [Bug #12671] 2020-03-16 23:38:26 +09:00
test_ifunless.rb
test_inlinecache.rb fix bug on method cache invalidation. 2020-03-11 02:50:44 +09:00
test_integer.rb bignum.c (estimate_initial_sqrt): prevent integer overflow 2019-10-21 21:24:21 +09:00
test_integer_comb.rb
test_io.rb Suffixed memory leak tests as "memory_leak" 2020-05-07 02:53:39 +09:00
test_io_m17n.rb IO#set_encoding_by_bom should err when encoding is already set 2019-12-15 23:13:16 +09:00
test_iseq.rb Added test for debug_level: option of RubyVM::InstructionSequence.compile 2020-04-15 16:06:48 +09:00
test_iterator.rb
test_jit.rb Test no .dSYM on macOS 2020-05-03 16:49:31 -07:00
test_jit_debug.rb Skip only .dSYM cleanup on macOS 2020-05-03 00:34:03 -07:00
test_key_error.rb
test_keyword.rb Reduce allocations for keyword argument hashes 2020-03-17 12:09:43 -07:00
test_lambda.rb Kernel#lambda: return forwarded block as non-lambda proc 2019-12-21 09:08:52 -05:00
test_lazy_enumerator.rb Fix Enumerator::Lazy#with_index 2019-12-11 04:59:56 +02:00
test_literal.rb Make rb_scan_args handle keywords more similar to Ruby methods (#2460) 2019-09-25 11:18:49 -07:00
test_m17n.rb test/json/test_helper.rb: Do not add a relative path to $LOAD_PATH 2020-03-24 10:45:52 +09:00
test_m17n_comb.rb reroute musl unistd.h weirdness 2020-01-24 10:49:35 +09:00
test_marshal.rb support multi-run for test/ruby/test_marshal.rb 2020-01-28 15:23:51 +09:00
test_math.rb
test_metaclass.rb
test_method.rb Merge pull request #2721 from jeremyevans/method-inspect-chain-alias-11188 2020-03-22 09:30:20 -07:00
test_mixed_unicode_escapes.rb
test_module.rb Fix origin iclass pointer for modules 2020-05-22 20:31:23 -07:00
test_name_error.rb Remove the 65 size limit for name_err_mesg_to_str 2020-05-11 09:15:24 -07:00
test_nomethod_error.rb Split test_nomethod_error.rb 2019-12-31 19:43:36 +09:00
test_not.rb
test_numeric.rb Update tests for full keyword argument separation 2020-01-02 18:40:45 -08:00
test_object.rb Support obj.clone(freeze: true) for freezing clone 2020-03-22 09:30:07 -07:00
test_objectspace.rb ObjectSpace._id2ref should check liveness. 2019-12-23 15:04:56 +09:00
test_optimization.rb test/ruby/test_optimization.rb: Proc creation test should count :T_DATA 2020-05-21 13:27:26 +09:00
test_pack.rb Deprecate taint/trust and related methods, and make the methods no-ops 2019-11-18 01:00:25 +02:00
test_parse.rb Fixed duplicated warning 2020-02-10 14:00:40 +09:00
test_path.rb Revert "Should return "." for File.extname("file.") also on Windows" 2019-12-23 11:54:25 +09:00
test_pattern_matching.rb Suppress an "assigned but unused variable" warning 2020-03-03 20:54:31 +09:00
test_pipe.rb
test_primitive.rb support multi-run for test/ruby/test_primitive.rb 2020-01-28 15:23:51 +09:00
test_proc.rb Do not autosplat when calling procs that accept rest and keywords 2020-03-08 20:49:09 -07:00
test_process.rb Run rb_syswait on exec failure 2020-05-10 00:59:55 -07:00
test_rand.rb Removed useless implementation tests 2020-05-17 19:03:05 +09:00
test_range.rb range.c: Range#min with a beginless one now raise an explicit exception 2019-12-25 13:36:23 +09:00
test_rational.rb
test_rational2.rb
test_readpartial.rb
test_refinement.rb test/ruby/test_refinement.rb: extend the timeout 2020-04-21 00:06:53 +09:00
test_regexp.rb Regexp in MatchData can be nil 2020-01-16 11:32:11 +09:00
test_require.rb Skip TestRequire#test_loading_fifo_fd_leak on Android 2020-04-19 23:14:31 +09:00
test_require_lib.rb Detect started threads when require only 2019-12-06 00:12:58 +09:00
test_rubyoptions.rb Fix inaccuracy in encoding tests 2020-02-04 08:24:59 +09:00
test_rubyvm.rb
test_rubyvm_mjit.rb RubyVM::MJIT.pause(wait: true) should wait 2019-09-26 16:28:34 +09:00
test_settracefunc.rb Don't tweak RubyVM compile options if it's not defined 2020-03-03 08:42:25 -06:00
test_signal.rb Deprecate taint/trust and related methods, and make the methods no-ops 2019-11-18 01:00:25 +02:00
test_sleep.rb
test_sprintf.rb
test_sprintf_comb.rb
test_stack.rb Removed trailing spaces [ci skip] 2020-05-14 19:57:39 +09:00
test_string.rb Warn non-nil $/ [Feature #14240] 2020-02-23 13:37:40 +09:00
test_stringchar.rb
test_struct.rb Classes made from Struct should have default new singleton method. 2020-05-08 04:18:45 -04:00
test_super.rb This test is not testing attr_writer 2020-04-14 23:59:29 -07:00
test_symbol.rb Suffixed memory leak tests as "memory_leak" 2020-05-07 02:53:39 +09:00
test_syntax.rb Fixed argument forwarding in reserved word method [Bug #16854] 2020-05-15 14:59:11 +09:00
test_system.rb
test_thread.rb Disable GC until VM objects get initialized [Bug #16616] 2020-02-09 17:15:55 +09:00
test_thread_cv.rb
test_thread_queue.rb test/ruby/test_thread_queue.rb: add a wait to yield a thread 2020-02-09 21:40:53 +09:00
test_threadgroup.rb
test_time.rb Fixed formatted substring expansion [Bug #16767] 2020-04-08 01:13:03 +09:00
test_time_tz.rb ruby_reset_timezone resets leap_second_info. 2020-01-29 00:01:57 +09:00
test_trace.rb Deprecate taint/trust and related methods, and make the methods no-ops 2019-11-18 01:00:25 +02:00
test_transcode.rb Fixed symbol misused as ID 2020-02-24 15:37:52 +09:00
test_undef.rb
test_unicode_escape.rb
test_variable.rb Supress class variable overtaken warning when original modules are the same 2019-11-29 20:32:03 +02:00
test_vm_dump.rb
test_weakmap.rb Allow non-finalizable objects in ObjectSpace::WeakMap 2019-08-29 20:40:52 +09:00
test_whileuntil.rb
test_yield.rb
ut_eof.rb