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

66436 Коммитов

Автор SHA1 Сообщение Дата
卜部昌平 90cad6e147 prefer cc/gcc over clang on solaris
requested by tankf33der at https://bugs.ruby-lang.org/issues/17949#change-92430
2021-06-14 22:37:17 +09:00
Nobuyoshi Nakada b513fc2fe7
Fixed method names in exception messages
These methods are not !-suffixed, and the messages were very
confusing.
2021-06-14 21:16:43 +09:00
Bruno Sutic 1ab71a5b98 Fix fiber scheduler address resolve solaris tests 2021-06-14 22:09:23 +12:00
Samuel Williams 25921fe1d6 Revert "Suppress gcc11 clobbered warning"
This reverts commit f0f9e77b65.
2021-06-14 22:07:59 +12:00
Samuel Williams 050a895439
Wake up join list within thread EC context. (#4471)
* Wake up join list within thread EC context.

* Consume items from join list so that they are not re-executed.

If `rb_fiber_scheduler_unblock` raises an exception, it can result in a
segfault if `rb_threadptr_join_list_wakeup` is not within a valid EC. This
change moves `rb_threadptr_join_list_wakeup` into the thread's top level EC
which initially caused an infinite loop because on exception will retry. We
explicitly remove items from the thread's join list to avoid this situation.

* Verify the required scheduler interface.

* Test several scheduler hooks methods with broken `unblock` implementation.
2021-06-14 17:56:53 +12:00
Nobuyoshi Nakada 626427c2e0
Removed no longer used variables 2021-06-14 14:11:38 +09:00
Nobuyoshi Nakada 635e1c5282
Pack values to preserve 2021-06-14 14:10:21 +09:00
Nobuyoshi Nakada f0f9e77b65
Suppress gcc11 clobbered warning 2021-06-14 14:09:43 +09:00
Samuel Williams 2792acc8f2
Add scheduler hook `Addrinfo.getaddrinfo`. (#4375)
Co-authored-by: Bruno Sutic <code@brunosutic.com>
2021-06-14 16:21:08 +12:00
Yusuke Endoh 688b217706 time.c: Check if defined(RUBY_MSVCRT_VERSION) to build on Solaris
Fixes [Bug #17947]
2021-06-14 10:40:41 +09:00
git 09ea2bb040 * 2021-06-14 [ci skip] 2021-06-14 10:09:30 +09:00
Yusuke Endoh 70313ec01a parse.y: Fix the location of a target constant of OP_CDECL
```
p RubyVM::AbstractSyntaxTree.parse("::Foo += 1").children
 #=> before: [[], nil, (OP_CDECL@1:0-1:10 (COLON3@1:0-1:10 :Foo) :+ (LIT@1:9-1:10 1))]
 #=> after:  [[], nil, (OP_CDECL@1:0-1:10 (COLON3@1:0-1:5 :Foo) :+ (LIT@1:9-1:10 1))]
```
2021-06-14 10:02:02 +09:00
Nobuyoshi Nakada 32b18fe9d0
Suppress array-parameter warnings by gcc 11 2021-06-13 15:12:45 +09:00
Nobuyoshi Nakada 9ab6d39a66
Added parentheses to silence sizeof-array-div warnings
As well as 2366c68116.
2021-06-13 15:12:45 +09:00
Nobuyoshi Nakada 9ec6c83c97
Removed duplicate include 2021-06-13 15:12:45 +09:00
Nobuyoshi Nakada 122ce52e8f
Check if alternative malloc header can work in C++
jemalloc (5.2.1 at least) cannot compile in C++ on macOS SDK, due
to conflicts on exception specification.
2021-06-13 15:12:45 +09:00
git cba92b3289 * 2021-06-13 [ci skip] 2021-06-13 13:45:07 +09:00
S.H d54f74a48b
Refactor rb_block_call function
rb_block_call and rb_block_call_kw have similar code.
So, using rb_block_kw function in rb_block_call function for refactoring.
2021-06-13 13:44:46 +09:00
git 146721ef6a * 2021-06-12 [ci skip] 2021-06-12 20:17:25 +09:00
nagachika 8366506de1 cont.c: Replace "iff" with "if and only if" 2021-06-12 20:15:08 +09:00
git 9210f8df7f * 2021-06-11 [ci skip] 2021-06-11 08:31:51 +09:00
Aaron Patterson d74e5d5b4f
Crash more nicely when the VM isn't fully set up
If we crash but the VM isn't fully alive, we can get an infinite loop.
2021-06-10 16:31:29 -07:00
Peter Zhu 929cc615a7 Finish GC before calling gc_set_initial_pages
If we are during incremental sweeping when calling gc_set_initial_pages
there is an assertion error. The following patch will artificially
produce the bug:

```
diff --git a/gc.c b/gc.c
index c3157dbe2c..d7282cf8f0 100644
--- a/gc.c
+++ b/gc.c
@@ -404,7 +404,7 @@ int ruby_rgengc_debug;
  * 5: show all references
  */
 #ifndef RGENGC_CHECK_MODE
-#define RGENGC_CHECK_MODE  0
+#define RGENGC_CHECK_MODE  1
 #endif
 // Note: using RUBY_ASSERT_WHEN() extend a macro in expr (info by nobu).
@@ -10821,6 +10821,10 @@ gc_set_initial_pages(void)
 void
 ruby_gc_set_params(void)
 {
+    for (int i = 0; i < 10000; i++) {
+        rb_ary_new();
+    }
+
     /* RUBY_GC_HEAP_FREE_SLOTS */
     if (get_envparam_size("RUBY_GC_HEAP_FREE_SLOTS", &gc_params.heap_free_slots, 0)) {
        /* ok */
```

The crash looks like:

```
Assertion Failed: ../gc.c:2038:heap_add_page:!(heap == heap_eden && heap->sweeping_page)
```
2021-06-10 10:59:32 -04:00
Takashi Kokubun d281fc525d
Add missing dependencies
https://github.com/ruby/ruby/runs/2791163586?check_suite_focus=true
2021-06-10 00:53:28 -07:00
Takashi Kokubun 474f79958b
Cast jit_func for Windows
https://ci.appveyor.com/project/ruby/ruby/builds/39542385/job/8b7aq951f9t01x4x
2021-06-10 00:40:59 -07:00
Takashi Kokubun c5e8a49bde
Avoid enqueueing the same ISeq twice
by a race condition by multiple Ractors.

Atmically incrementing body->total_calls may have its own cost, so for
now we intentionally leave the unreliable total_calls. So we allow an
ISeq to be never pushed when you use multiple Ractors. However, if you
enqueue a single ccan node twice, get_from_list loops infinitely. Thus
this patch takes care of such a situation.
2021-06-10 00:32:24 -07:00
Nobuyoshi Nakada 791d7d4947
Freeze command line script 2021-06-10 15:15:35 +09:00
Peter Zhu 8a46b480a7 Refactor gc_marks_start_heap to only configure heap
Move the non-heap related configurations to gc_marks_start.
2021-06-09 14:16:39 -04:00
git fa340dd9f1 * 2021-06-10 [ci skip] 2021-06-10 00:17:15 +09:00
Jun Aruga f7741cda32 Enable Travis on the specific branches or forked repositories.
Align the Travis enabling timing with GitHub Actions.

For the syntax, see <https://docs.travis-ci.com/user/conditions-v1>.
We use `repo` syntax rather than `fork = true/false` syntax to show a general usage in any repositories on GitHub.
The non-forked repo is not always a primary repo in any GitHub repositories.

[Bug #17936]
2021-06-09 17:16:53 +02:00
Nobuyoshi Nakada e03bf76b31
Pack iseq_inline_constant_cache_entry
Reordered iseq_inline_constant_cache_entry members not to exceed
the size of RValue.
2021-06-09 19:15:57 +09:00
Nobuyoshi Nakada 9ba335e2eb
[Win32] fixed PACKED_STRUCT_UNALIGNED on x86
Use MACHINE for x86 CPU family, ARCH is CPU model name (i386) and
cannot be x86.
2021-06-09 18:49:14 +09:00
Nobuyoshi Nakada 73f9831a57
POSIX timer cannot be shared in forked process [Bug #17941] 2021-06-09 12:32:18 +09:00
Peter Zhu 9f110ced57 Add multi-heap support to gc_marks_wb_unprotected_objects 2021-06-08 14:31:38 -04:00
git f9e13cda04 * 2021-06-09 [ci skip] 2021-06-09 02:19:27 +09:00
Jeremy Evans 117310bdc0
Make ENV.clone warn and ENV.dup raise
ENV.dup returned a plain Object, since all of ENV's behavior is
defined in ENV's singleton class.  So using dup makes no sense.

ENV.clone works and is used in some gems, but it doesn't do what
the user expects, since modifying ENV.clone also modifies ENV.
Add a deprecation warning pointing the user to use ENV.to_h
instead.

This also undefines some private initialize* methods in ENV,
since they are not needed.

Fixes [Bug #17767]
2021-06-08 10:19:08 -07:00
Yusuke Endoh 8c87efaa8a [ruby/psych] Fix the test that does not work with libyaml-0.1.7
https://github.com/ruby/psych/commit/542cf9754f
2021-06-08 08:12:27 +09:00
git a49a08ab98 * 2021-06-08 [ci skip] 2021-06-08 03:47:48 +09:00
Aaron Patterson 459a9f82c9
Don't create objects during GC
If we crash during GC, allocating new objects in the segv handler can
cause an infinite loop.  This commit is to avoid creating new objects in
the crash handler
2021-06-07 11:47:16 -07:00
Nobuyoshi Nakada 26fcec5ae5
[DOC] fix metacharacter markups [ci skip] 2021-06-07 20:44:05 +09:00
Nobuyoshi Nakada c741ea0be7
timev.rb: moved class rdoc from time.c 2021-06-07 20:44:05 +09:00
Nobuyoshi Nakada 4bd538e847
dir.rb: moved class rdoc from dir.c 2021-06-07 20:44:05 +09:00
Hiroshi SHIBATA bb4a10208c
Do not use YAML module in tests of Psych 2021-06-07 19:24:20 +09:00
Hiroshi SHIBATA d7146dfd7d
Use assert_raise instead of assert_raises 2021-06-07 19:21:41 +09:00
Hiroshi SHIBATA 85b94144f2
[ruby/psych] Bump version to 4.0.1
https://github.com/ruby/psych/commit/4049939006
2021-06-07 19:15:14 +09:00
Jean Boussier fd6225c7a9
[ruby/psych] Implement YAML.safe_dump to make safe_load more usable.
In case where Psych is used as a two way serializers,
e.g. to serialize some cache or config, it is preferable
to have the same restrictions on both load and dump.

Otherwise you might dump and persist some objects payloads
that you later won't be able to read.

https://github.com/ruby/psych/commit/441958396f
2021-06-07 19:15:14 +09:00
Yusuke Endoh 430883158f
[ruby/psych] Make YAML.load_file use YAML.load instead of safe_load
YAML.load and YAML.safe_load are different a little; the former allows
Symbol by default but the latter doesn't. So YAML.load_file and
YAML.safe_load_file should reflect the difference.

Fixes #490

https://github.com/ruby/psych/commit/f8a5e512a1
2021-06-07 19:15:14 +09:00
Nobuyoshi Nakada dd765f9e60
Get rid of updating Unicode files
Some certificates on Unicode.org have expired.
2021-06-07 17:45:50 +09:00
Yusuke Endoh bc126d91fe Skip make update-unicode for BASERUBY CI
Unfortunately it often fails depending on the status of www.unicode.org.

https://github.com/mame/ruby/runs/2761346164?check_suite_focus=true
```
./tool/downloader.rb:248:in `rescue in download': failed to download 12.1.0/ucd/UnicodeData.txt (RuntimeError)
OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=error: certificate verify failed: https://www.unicode.org/Public/12.1.0/ucd/UnicodeData.txt
```
2021-06-07 16:22:18 +09:00
git a9d7617201 * 2021-06-07 [ci skip] 2021-06-07 10:23:16 +09:00