1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test
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
..
-ext- Fix rb_profile_frame_classpath to handle module singletons 2020-05-07 08:46:36 -07:00
base64
benchmark
bigdecimal
cgi need to restore $stdin. 2020-03-02 13:14:38 +09:00
coverage
csv Removed trailing spaces [ci skip] 2020-05-14 19:57:39 +09:00
date Fixed misspellings 2019-12-20 12:19:45 +09:00
dbm
did_you_mean Revert "Sync did_you_mean" 2020-05-12 16:27:25 +09:00
digest test/digest/test_digest.rb: Apply EnvUtil.apply_timeout_scale to timeout 2020-03-27 15:32:52 +09:00
drb Skip test_06_timeout for --jit-wait CI 2020-03-08 22:34:33 -07:00
dtrace
erb
etc test/etc/test_etc.rb: skip some tests on Android 2020-02-12 17:28:29 +09:00
excludes Revert "Skip interruptible raw mode test on Travis-CI" 2019-12-18 00:08:21 +09:00
fiber Move test/scheduler -> test/fiber [Bug #16892][ruby-core:98366]. 2020-05-15 13:26:23 +12:00
fiddle Dir.glob always returns an array 2020-04-01 12:48:56 +09:00
fileutils
gdbm
io Use %w instead of %i not to create unused IDs 2020-05-09 20:13:30 +09:00
irb Fix typos 2020-05-09 14:22:04 +09:00
json test/json/test_helper.rb: Do not add a relative path to $LOAD_PATH 2020-03-24 10:45:52 +09:00
lib test/lib/jit_support.rb: Let JIT tests skip on centos8 2020-05-12 17:48:31 +09:00
logger Fixed misspellings 2019-12-20 12:19:45 +09:00
matrix [ruby/matrix] Add Matrix#adjoint [#14] 2020-05-01 03:25:15 -04:00
mkmf
monitor
net [ruby/net-ftp] Added guard condition for the old ruby versions 2020-04-08 15:51:18 +09:00
nkf
objspace
open-uri
openssl [ruby/openssl] ssl: temporarily remove SSLContext#add_certificate_chain_file 2020-05-13 15:47:51 +09:00
optparse
ostruct Prefer dedicated assertion method 2020-02-25 17:47:17 +09:00
pathname brace the fact that lchmod(2) can EOPNOTSUPP 2020-01-24 10:49:35 +09:00
psych Fix remove warning & support multi-run test for test/psych/visitors/test_to_ruby.rb 2020-02-13 11:01:15 +09:00
racc Fixed misspellings 2019-12-20 12:19:45 +09:00
rdoc Fix failures of test/rdoc/test_rdoc_ri_paths.rb 2020-04-26 16:14:14 +09:00
readline Restore class variable setting for tests 2020-05-14 12:27:33 +09:00
reline [ruby/reline] Add a test of autowrap for yamatanooroti 2020-05-17 19:26:53 +09:00
resolv MinGW on Actions (#2791) 2019-12-30 23:19:31 -08:00
rinda test/rinda/test_rinda.rb: Increase the timeout 2020-01-25 14:14:05 +09:00
ripper Removed unnecessary RLIMIT_AS 2020-04-28 23:36:16 +09:00
ruby Fix origin iclass pointer for modules 2020-05-22 20:31:23 -07:00
rubygems Run rb_syswait on exec failure 2020-05-10 00:59:55 -07:00
sdbm
socket Thread scheduler for light weight concurrency. 2020-05-14 22:10:55 +12:00
stringio [ruby/stringio] StringIO#initialize default to the source string encoding 2020-03-15 18:43:01 +09:00
strscan
syslog
uri Fakes IPSocket.getaddress in the whole method 2020-05-06 16:06:25 +09:00
webrick restore server[:DocumentRootOptions] setting. 2020-02-29 00:43:41 +09:00
win32ole
yaml
zlib
runner.rb
test_abbrev.rb
test_delegate.rb Fix SimpleDelegator respond_to? regression 2020-02-03 08:16:22 -08:00
test_extlibs.rb
test_find.rb
test_forwardable.rb [ruby/forwardable] Make def_*_delegator return name of method defined (Fixes #10) 2019-12-11 20:23:53 +09:00
test_ipaddr.rb
test_mutex_m.rb
test_observer.rb
test_open3.rb
test_pp.rb Mask RubyVM-specific test 2020-03-05 16:49:27 -06:00
test_prettyprint.rb
test_prime.rb [ruby/prime] Fix Prime.include? 2020-03-06 20:54:33 +09:00
test_pstore.rb
test_pty.rb
test_rbconfig.rb Make RbConfig::CONFIG values mutable [Bug #16738] 2020-03-25 22:09:28 +09:00
test_securerandom.rb
test_set.rb Call initialize_clone with freeze: false if clone called with freeze: false 2020-01-03 20:13:09 -08:00
test_shellwords.rb
test_singleton.rb
test_syslog.rb Update some syslog tests to absurb the format change of FreeBSD syslog 2020-03-12 15:30:20 +09:00
test_tempfile.rb
test_time.rb
test_timeout.rb
test_tmpdir.rb
test_tracer.rb
test_tsort.rb
test_unicode_normalize.rb
test_weakref.rb
test_win32api.rb