Граф коммитов

61447 Коммитов

Автор SHA1 Сообщение Дата
Hiroshi SHIBATA d48c92aa04
Rename TestScheduler* to TestFiber for convention of the test directory 2020-05-23 16:44:57 +09:00
Nobuyoshi Nakada 0b2fc4cf37
extlibs.rb: make symlink only if the target exists 2020-05-23 14:56:13 +09:00
Chris Seaton 3015a7aae7 [ruby/fiddle] Improve documentation on how to correctly free memory and free memory in tests (#33)
https://github.com/ruby/fiddle/commit/e59cfd708a
2020-05-23 14:34:07 +09:00
Sutou Kouhei 24b615e82e [ruby/fiddle] Export Fiddle::VERSION
https://github.com/ruby/fiddle/commit/1b93a2d9db
2020-05-23 14:29:16 +09:00
Sutou Kouhei 74a4558c14 [ruby/fiddle] Update file list
https://github.com/ruby/fiddle/commit/b04cb92d7b
2020-05-23 14:29:16 +09:00
Sutou Kouhei d5c0018a9a [ruby/fiddle] Fix a typo
https://github.com/ruby/fiddle/commit/445ca6b501
2020-05-23 14:29:16 +09:00
Sutou Kouhei a0dcdd64c5 [ruby/fiddle] Bump version
https://github.com/ruby/fiddle/commit/f8fb7c4823
2020-05-23 14:29:16 +09:00
Sutou Kouhei 13f64333ea [ruby/fiddle] Add Fiddle::VERSION
https://github.com/ruby/fiddle/commit/9dcf64c096
2020-05-23 14:29:16 +09:00
Sutou Kouhei 5fb7ca33e6 [ruby/fiddle] Add missing spec.extensions
https://github.com/ruby/fiddle/commit/2ce36b1fdc
2020-05-23 14:29:16 +09:00
sinisterchipmunk 77cc13943c [ruby/fiddle] Fix assignment to array within struct (#26)
* Allow access to a struct's underlying memory with `struct[offset, length]`.

https://github.com/ruby/fiddle/commit/24083690a6
2020-05-23 14:29:16 +09:00
sinisterchipmunk 4a835621ce [ruby/fiddle] Make array access override compatible with base class (#25)
* Allow access to a struct's underlying memory with `struct[offset, length]`.

* Make accessing a struct's underlying memory more convenient.

* refactor memory access unit tests for improved clarity


https://github.com/ruby/fiddle/commit/c082c81bb5
2020-05-23 14:29:16 +09:00
sinisterchipmunk aa1d3c7d2c [ruby/fiddle] Initialize memory to 0 when calling Fiddle.malloc(). (#24)
https://github.com/ruby/fiddle/commit/8414239ca3
2020-05-23 14:29:16 +09:00
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
Henrik Nyh and Tomas Skogberg fdb31aa7ab Time.xmlschema: Clarify error and docs
It parses a (date)time, not a date.
2020-05-23 09:43:05 +09:00
BurdetteLamar da484c3187 Enhanced Rdoc for Hash 2020-05-23 12:36:42 +12:00
David Rodríguez f8647343ed Remove a bunch of files that were deleted upstream 2020-05-23 07:28:57 +09:00
git 2ec5f324f4 * 2020-05-23 [ci skip] 2020-05-23 07:28:32 +09:00
Hiroshi SHIBATA 36f29b598a
Fixed wrong usage rm_rf for cleanup the default gems in sync tool 2020-05-23 07:27:42 +09:00
Jeremy Evans 8d798e7c53 Revert "Fix origin iclass pointer for modules"
This reverts commit c745a60634.

This triggers a VM assertion.  Reverting until the issue can be
debugged.
2020-05-22 07:54:34 -07:00
Jeremy Evans c745a60634 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 also includes a fix for Module#included_modules to skip
iclasses with origins.

Fixes [Bug #16736]
2020-05-22 07:36:52 -07:00
Nobuyoshi Nakada ef13558fcd
Revert a commit miss in "Fixed potential memory leak"
This reverts an unintentional change in commit
79d9528ddc.
2020-05-22 21:24:51 +09:00
Hiroshi SHIBATA df5fd1d09c Fixup 1d079a0c5d4d80860a4d6d692344124fe5c562b5 2020-05-22 20:32:30 +09:00
Hiroshi SHIBATA 1d889c9656 Sync Bundler PR #3624 with HEAD commits 2020-05-22 20:32:30 +09:00
Hiroshi SHIBATA 93ebf9643d Revert 1f011cccb1 2020-05-22 20:32:30 +09:00
Hiroshi SHIBATA 26367367ec Marked the failing examples with the current master branch on ruby repository 2020-05-22 20:32:30 +09:00
Hiroshi SHIBATA 9c2752296d Glob the all man files provided by bundler upstream 2020-05-22 20:32:30 +09:00
Hiroshi SHIBATA c7ebeb7eda Sync Bundler PR #3624 2020-05-22 20:32:30 +09:00
Kenta Murata f4f157fc81
Suppress warnings no inline ruby debug (#3107)
* Suppress unused warnings occurred due to -fno-inline

* Suppress warning occurred due to RUBY_DEBUG=1
2020-05-22 13:49:08 +09:00
Burdette Lamar ac395754c7
Enhanced rdoc for Hash (#3129) 2020-05-22 15:05:19 +12:00
S-H-GAMELINKS d707c92a35 add static modifier for rb_hash_keep_if func 2020-05-22 11:51:32 +09:00
S-H-GAMELINKS e5354de9f4 add static modifier for rb_hash_select_bang func 2020-05-22 11:51:32 +09:00
S-H-GAMELINKS 7c4e085938 add static modifier for rb_hash_select func 2020-05-22 11:51:32 +09:00
Koichi Sasada cbd45af2a9 fix memory leak of ccs
rb_callable_method_entry() creates ccs entry in cc_tbl, but this
code overwrite by insert newly created ccs and overwrote ccs never
freed.
[Bug #16900]
2020-05-22 11:23:20 +09:00
Yusuke Endoh 74cd607ca0 Run major GC three times to make sure the minor GC reason
Same as 02705b27be

http://ci.rvm.jp/results/trunk-random1@phosphorus-docker/2955433
```
  1)
TestGc#test_start_full_mark [/tmp/ruby/v3/src/trunk-random1/test/ruby/test_gc.rb:61]:
Expected :oldmalloc to be nil.
```
2020-05-22 11:12:40 +09:00
Nobuyoshi Nakada 79d9528ddc
Fixed potential memory leak
Create a wrapper object first, then buffer allocation which can
fail.
2020-05-22 06:50:29 +09:00
git 38a4f617de * 2020-05-22 [ci skip] 2020-05-22 04:09:15 +09:00
Aaron Patterson a53e2850c5
Unpin and update VM references
This commit just unpins and updates VM references
2020-05-21 12:08:38 -07:00
Nobuyoshi Nakada ba7f4bb0af
Synchronized non-inline version rb_scan_args with the inline version 2020-05-21 13:31:36 +09:00
Nobuyoshi Nakada 62b47196e4
Added UNREACHABLE_RETURN
To get rid of a void function at the end of non-void function.
2020-05-21 13:31:36 +09:00
Yusuke Endoh 3eb3f7bb8c test/ruby/test_optimization.rb: Proc creation test should count :T_DATA
instead of :TOTAL of ObjectSpace.count_objects.

This test had failed very occasionally:

https://rubyci.org/logs/rubyci.s3.amazonaws.com/centos8/ruby-master/log/20200521T033004Z.fail.html.gz
```
  1) Failure:
TestRubyOptimization#test_block_parameter_should_not_create_objects [/home/chkbuild/chkbuild/tmp/build/20200521T033004Z/ruby/test/ruby/test_optimization.rb:713]:
<0> expected but was
<407>.
```

This test of lazy proc creation checks if no object is created during a
method call.  However, calling a method itself increases the count of
objects because method cache is now an object (T_MEMO).
The reason why this test rarely fails is because the test was buggy; it
checked the count of :TOTAL, but :TOTAL count changes only when the GC
heap is expanded.  Creating one object rarely causes heap expansion.
The test must have checked not only :TOTAL but also the count of :FREE.

Instead, this change more directly checks :T_DATA.  Note that a Proc
object is T_DATA.
2020-05-21 13:27:26 +09:00
Nobuyoshi Nakada 6f167da65b
Fixed a variable name [Bug #16903]
Fix up of 0e3b0fcdba

From: fd0 (Daisuke Fujimura)
2020-05-21 10:47:41 +09:00
卜部昌平 43725c6091 rb_scan_args_set: make it slightly readable
This is a pure refactoring that improves understanding of what is going
on.  Not a big win though.
2020-05-21 09:58:54 +09:00
Burdette Lamar 140d4e4a5f
[ci skip] Enhanced rdoc for Hash (#3121) 2020-05-21 10:57:38 +12:00
Aaron Patterson 6e7e7c1e57
Only marked objects should be considered movable
Ruby's GC is incremental, meaning that during the mark phase (and also
the sweep phase) programs are allowed to run.  This means that programs
can allocate objects before the mark or sweep phase have actually
completed.  Those objects may not have had a chance to be marked, so we
can't know if they are movable or not. Something that references the
newly created object might have called the pinning function during the
mark phase, but since the mark phase hasn't run we can't know if there
is a "pinning" relationship.

To be conservative, we must only allow objects that are not pinned but
also marked to move.
2020-05-20 15:00:32 -07:00
git a3e79c1764 * 2020-05-21 [ci skip] 2020-05-21 03:17:08 +09:00
Aaron Patterson 891e253ee7
Use a pinning list for keeping objects alive during assembly.
The GC will not disassemble incomplete instruction sequences.  So it is
important that when instructions are being assembled, any objects the
instructions point at should not be moved.

This patch implements a fixed width array that pins its references.
When the instructions are done being assembled, the pinning array goes
away and the objects inside the iseqs are allowed to move.
2020-05-20 11:16:21 -07:00
S-H-GAMELINKS ff58cbce94 add static modifer for rb_hash_fetch_values func 2020-05-20 23:22:46 +09:00
Nobuyoshi Nakada 2480ef904c
pure_parser.rb: get rid of an error at localed messages 2020-05-20 10:52:32 +09:00
Koichi Sasada 67d259c5dc Use __bultin_assume() from clang-7
We observed combination of multiple __builtin_assume() can cause
strange compile results on clang-6 (-DNDEBUG exposed this issue).
To avoid this problem, __builtin_assume() is from clang-7.
https://github.com/ruby/ruby/pull/3120#issuecomment-630821333
2020-05-20 10:29:38 +09:00
git a6403091a5 * 2020-05-20 [ci skip] 2020-05-20 10:22:34 +09:00