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

51191 Коммитов

Автор SHA1 Сообщение Дата
normal faba0ee1c1 mjit.c: avoid signed pointer comparisons (fix for 32-bit)
ptrdiff_t is a signed type, use uintptr_t instead for unsigned
comparisons.  This is needed to allow MJIT tests to pass on
32-bit x86 GNU/Linux.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-25 02:52:34 +00:00
normal 65ab2ab1c0 mjit.c: set PIC flags on clang for FreeBSD and glibc
This seems required on FreeBSD 11.1 (clang 4.0.0) and
Debian stretch (clang 3.8.1) for shared libraries.

Note: Not checking __linux__ because there are statically-linked
Linux distros (I don't know if they can support MJIT).  But
glibc doesn't support static linking, so we guard on that.

Maybe other platforms will need this, too.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-25 02:52:29 +00:00
normal d3e8d4f35a mjit.c: avoid execvp PATH lookup in vfork-ed child
execvp(3) is not async-signal-safe and may alter libc internal
states (e.g. those used by malloc).  However execv(3) is
async-signal-safe as of POSIX.1-2008.

So perform the PATH lookup in the parent and use execv(3)
in the child.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-25 01:06:15 +00:00
svn 8c8247c6eb * 2018-06-25
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-24 22:08:16 +00:00
normal 8b590c4663 UNIXSocket#recv_io: trigger GC when out of FDs
Make this behavior is consistent with our other FD-allocating
methods.

EMFILE and ENFILE are not documented nor can I trigger them when
using UNIXSocket#recv_io.  However, ENOMEM is documented, and
I've triggered EMSGSIZE on FreeBSD and truncated messages when
an EMFILE condition is hit on my system.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-24 22:08:15 +00:00
normal 4bbdb9ea19 process.c (ruby_fork_ruby): fix race in signal handling
We must block signals before stopping timer-thread, otherwise
signal handing may be delayed until (and if) another signal
is received after timer-thread is restarted.

[ruby-core:87622] [Bug #14868] [Bug #13916]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-24 12:36:44 +00:00
k0kubun 042395a7f7 test_process.rb: skip tests for Bug 14867
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-24 11:07:44 +00:00
normal 5767162197 process.c (after_fork_ruby): make it a proper function
Improves readability to me, and there's no point in using
macros for this with decent compilers.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-24 10:30:48 +00:00
mame be850d7b11 test/net/http/test_httpresponse.rb: add testcases for net/httpresponse
This change adds testcases for Response#inspect and #code_type, and
improves line coverage of lib/net/http/response.rb (91.8 % to 92.94 %).

A patch from @owlworks.  https://github.com/ruby/ruby/pull/1898

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-24 09:31:09 +00:00
mame 103b5063f2 lib/prime.rb: remove unused methods
This change removes TrialDivision#cache, TrialDivision#primes, and
TrialDivision#primes_so_far.

TrialDivision class is undocumented officially, so this class is used
only internally.  Yugui san moved prime library from mathn to prime in
2008, and then she might forget to delete these methods.

A patch from @shio-phys.  https://github.com/ruby/prime/pull/4

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-24 09:31:07 +00:00
svn dc4ab636c0 * 2018-06-24
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-24 09:31:07 +00:00
mame fdf2322d5a test/test_prime.rb: add testcases of prime library
This change improves line coverage of prime.rb from 86% to 99%.
A patch from @shio-phys.  https://github.com/ruby/prime/pull/3

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-24 09:31:06 +00:00
k0kubun e1be448840 mjit.c: disable calling JIT-ed code
when TracePoint is enabled. We're cancelling JIT-ed code execution AFTER
each instruction, but there is no guard before the first insn of method.

To prevent spoiling performance, I don't want to modify the JIT-ed code
to fix this. So this commit replaces `mjit_enabled` check with `mjit_call_p`
check.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-23 14:11:19 +00:00
tarui a62a776d57 gc.c (ruby_mimmalloc): add initialize code for USE_GC_MALLOC_OBJ_INFO_DETAILS
We often had SEGV in ruby_xfree when USE_GC_MALLOC_OBJ_INFO_DETAILS is 1


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-23 13:58:51 +00:00
k0kubun 06f54f0303 mjit.c: unify the variable name with method name
`RubyVM::MJIT.enabled?`.

It's set to be TRUE even before initialization is finished.
So it was actually not "mjit initialized predicate".

This flag is also used to check whether JIT-ed code should be called
or not, but I'm going to split the responsibility to another flag.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-23 13:41:06 +00:00
k0kubun 359dd59db2 spec: skip Process wait specs on MJIT
until [Bug #14867] is fixed. I want to start running CI with MJIT
enabled before fixing the problem.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-23 08:29:20 +00:00
k0kubun ea0cede5aa mjit.c: initial cygwin support
thread_pthread.c: Drop pthread_attr_setscope usage. It seems that,
at least on Linux and macOS, PTHREAD_SCOPE_PROCESS is not supported
and thus PTHREAD_SCOPE_SYSTEM should be used by default.

Let's just stop calling this until we find some platform that needs
`pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)`.

[Misc #14854]

From: fd0 (Daisuke Fujimura)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-23 07:21:12 +00:00
ktsj d62b7e133e [DOC] Add call signature for {Array,Hash}#any?
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-23 04:57:49 +00:00
ktsj c7ab4f6dcb test/ruby/test_settracefunc.rb: fix NoMethodError
* test/ruby/test_settracefunc.rb (test_trace_point_raising_exception_in_bmethod_call):
  this test run in separate process, so #target_thread? is not defined and it doesn't
  need target thread check.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-23 04:56:49 +00:00
ktsj 289dcb30b9 vm.c: fix infinite loop
* vm.c: use EXEC_EVENT_HOOK_AND_POP_FRAME. While exception handling, if an exception
  is raised in hooks, need to pop current frame and raise this raised exception by hook.

[ruby-dev:50582] [Bug #14865]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-23 04:52:58 +00:00
ktsj 3b51b2fa96 vm.c: fix typo in function name
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-23 04:45:57 +00:00
svn 31d7e56b27 * 2018-06-23
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-23 03:47:55 +00:00
normal b445543974 thread_pthread.c (native_sleep): do not clear unblock.arg
It is unnecessary to clear unblock.arg once unblock.func is
cleared, and unblock_function_clear in thread.c doesn't
touch it, either.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-23 03:47:54 +00:00
naruse 10485be8c2 remove debug print
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-22 11:57:06 +00:00
naruse fab030c2c1 check net.core.wmem_default and max instead of tcp
https://travis-ci.org/ruby/ruby/jobs/395416137

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-22 11:10:56 +00:00
naruse 38d0219ab0 show net.ipv4.tcp_wmem to debug failure on travis
https://travis-ci.org/ruby/ruby/builds/395318841

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-22 10:53:03 +00:00
normal 45765e94d9 dir.c: define O_CLOEXEC for older systems
SuSE 10 has openat(), but not O_CLOEXEC

Reported-by: wangpeiwen

[ruby-core:87591] [Bug #14864]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-22 08:47:12 +00:00
normal 3839734b94 thread.c (sleep_timespec): avoid needless update w/o spuriuos check
No point in wasting cycles updating the timespec when not
checking on spurious wakeups.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-22 06:17:15 +00:00
nobu 64a189d207 remove DISABLE_RUBYGEMS from config files
* configure.ac: removed DISABLE_RUBYGEMS macro from config.h, not
  to rebuild everything when the flag changed.

* configure.ac, win32/configure.bat: make USE_RUBYGEMS lowercase.

* tool/mkconfig.rb: remove RUBYGEMS stuff from rbconfig.rb, not to
  reconfigure and rebuild all extension libraries.

* Makefile.in (CPPFLAGS): enable/disable Rubygems by USE_RUBYGEMS.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-22 04:13:02 +00:00
mame 0ad9c00525 test/ruby/test_range.rb: add a test for endless range's min with comparison
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-22 03:07:24 +00:00
mame cae4517419 range.c: Range#last and #max raises a RangeError if it is endless
Also, Range#min raises an error if it is endless and a comparison method
is specified.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-22 02:58:40 +00:00
mame 342619300c range.c: Range#size now returns Float::INFINITY if it is endless
Fixes [Bug #14699]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-22 02:58:39 +00:00
mame c19ecf05b4 range.c: Range#to_a now raises RangeError if it is endless
Fixes [Bug #14845]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-22 02:58:37 +00:00
normal 3afb77330f vm_core.h (rb_vm_t): make sleeper non-volatile
vm->sleeper is never modified in signal handlers or without GVL,
so there's no need for volatile hocus-pocus.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-22 02:43:51 +00:00
svn 97fcb45078 * 2018-06-22
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-22 02:32:32 +00:00
normal 501069b8a4 thread_sync.c (rb_mutex_lock): fix deadlock
* thread_sync.c (rb_mutex_lock): fix deadlock
  [ruby-core:87467] [Bug #14841]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-22 02:32:30 +00:00
k0kubun 0af19735d7 mjit.c: RubyVM::MJIT.pause / RubyVM::MJIT.resume
[Feature #14830]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-21 14:04:05 +00:00
normal 48efa44719 thread_pthread.c: fix non-sleepy timer-thread with fork
This fixes bootstraptest/test_fork.rb for systems with
sleepy timer thread disabled.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-20 23:38:21 +00:00
normal 6c83a3ab60 test/ruby/test_io.rb: fix timing sensitive test
For systems with sleepy timer thread disabled, the signal
handler does not fire soon enough and we need to ensure the
signal is received before we check its value.  So use a
self-pipe here.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-20 23:38:16 +00:00
svn 34dbd74f0c * 2018-06-21
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-20 18:10:10 +00:00
ko1 331f46a250 add assertion to vm_search_method()
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-20 18:10:09 +00:00
hsbt 2b5a801c1b ConditionVariable and Queue is not standard library.
They are located under the Thread class.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-20 12:51:38 +00:00
yui-knk 248e076e5e test_ast.rb: Remove a needless line
`RubyVM::AST.parse_file` was fixed to raise `SyntaxError`
by r63602. So this line is needless.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-20 12:40:59 +00:00
yui-knk 158f223586 test_ast.rb: Fix an argument of `grep`, child is a `RubyVM::AST::Node`
Yusuke Endoh pointed out coverage of ast module is very low. Thanks!

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-20 12:11:25 +00:00
nobu f194979bae skip when group name is not found
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-20 11:14:08 +00:00
ko1 07a5e55f11 Introduce `USE_GC_MALLOC_OBJ_INFO_DETAILS`. [Feature #14857]
* include/ruby/defines.h: introduce `USE_GC_MALLOC_OBJ_INFO_DETAILS`
  to show malloc statistics by replace ruby_xmalloc() and so on with
  macros.

* gc.c (struct malloc_obj_info): introduced to save per-malloc information.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-20 07:53:29 +00:00
hsbt 9c272f39ff Thread is always provided at current ruby version.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-20 07:16:25 +00:00
svn d03afde388 * 2018-06-20
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-19 23:20:37 +00:00
normal 0c53b40033 lib/drb/extservm.rb (service): do not return `false'
invoke_service_command may set entries in @servers to `false',
making it incompatible with the intended use of the
safe navigation operator.

This caused occasional DRb test failures, but they were hidden
with automatic retry.

[ruby-core:87524] [Bug #14856]

Fixes: r53111 ("use safe navigation operator")
	commit 059c9c1cf3 [GH-1142]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-19 23:20:36 +00:00
nobu 9d55666225 describe about NameError by #private_constant
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-19 08:45:17 +00:00