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

51446 Коммитов

Автор SHA1 Сообщение Дата
nobu 05316c40ac fork() is deprecated on Solaris
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-26 09:32:42 +00:00
normal 97538e813f cont.c (ec_switch): prevent delayed/missed trap interrupt race
timer-thread may set trap interrupt with rb_threadptr_check_signal
at any time independent of GVL.  This means timer-thread may set
the trap interrupt flag on the previous execution context; causing
the flag to be unnoticed until a future ec switch (or lost
completely if the ec is done).

Note: I avoid relying on th->interrupt_lock here and use
atomics because we won't be able to rely on it for proposed lazy
timer-thread [Misc #14937].

This regression affects Ruby 2.5 as it was introduced by moving
interrupt_flag to `ec' which is an unstable pointer.  Ruby <= 2.4
was unaffected because vm->main_thread->interrupt_flag never
changed.

[ruby-core:88119] [Bug #14939]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-26 08:30:10 +00:00
nobu d3df0de693 ignore built files
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-26 07:23:14 +00:00
normal 9749bfbf73 webrick: Support bcrypt password hashing
This adds a password_hash keyword argument to
WEBrick::HTTPAuth::Htpasswd#initialize.  If set to :bcrypt, it
will create bcrypt hashes instead of crypt hashes, and will
raise an exception if the .htpasswd file uses crypt hashes.

If :bcrypt is used, then instead of calling
BasicAuth.make_passwd (which uses crypt),
WEBrick::HTTPAuth::Htpasswd#set_passwd will set the bcrypt
password directly.  It isn't possible to change the
make_passwd API to accept the password hash format, as that
would break configurations who use Htpasswd#auth_type= to set
a custom auth_type.

This modifies WEBrick::HTTPAuth::BasicAuth to handle checking
both crypt and bcrypt hashes.

There are commented out requires for 'string/crypt', to handle
when String#crypt is deprecated and the undeprecated version is
moved to a gem.

There is also a commented out warning for the case when
the password_hash keyword is not specified and 'string/crypt'
cannot be required.  I think the warning makes sense to nudge
users to using bcrypt.

I've updated the tests to test nil, :crypt, and :bcrypt values
for the password_hash keyword, skipping the bcrypt tests if the
bcrypt library cannot be required.

[ruby-core:88111] [Feature #14940]

From: Jeremy Evans <code@jeremyevans.net>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-26 03:21:52 +00:00
normal 1516b85d54 test/ruby/test_io.rb (test_select_leak): skip with MJIT
We need better ways to test for leaks :<

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-25 22:32:54 +00:00
tenderlove 3b60f4a590 [Doc] Recover example about Queue
`trunk@42862` dropped example's last line.

e334bb2ce5 (diff-8783a9b452e430bcf0d7b0c6e34f1db0L144)
e334bb2ce5 (diff-38e7b9d781319cfbc49445f8f6625b8aR195)

This brings no output.

```queue_example1.rb
queue = Queue.new

producer = Thread.new do
  5.times do |i|
    sleep rand(i) # simulate expense
    queue << i
    puts "#{i} produced"
  end
end

consumer = Thread.new do
  5.times do |i|
    value = queue.pop
    sleep rand(i/2) # simulate expense
    puts "consumed #{value}"
  end
end
```

```queue_example2.rb
queue = Queue.new

producer = Thread.new do
  5.times do |i|
    sleep rand(i) # simulate expense
    queue << i
    puts "#{i} produced"
  end
end

consumer = Thread.new do
  5.times do |i|
    value = queue.pop
    sleep rand(i/2) # simulate expense
    puts "consumed #{value}"
  end
end

consumer.join
```

$ ruby queue_example1.rb
$

$ ruby queue_example2.rb
0 produced
1 produced
consumed 0
consumed 1
2 produced
consumed 2
3 produced
consumed 3
4 produced
consumed 4
$

Co-Authored-By: Sanemat <o.gata.ken@gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-25 18:09:02 +00:00
tenderlove ac1193d38f Remove obsolete comment from Module#define_method documentation
Since 2.5, Module#define_method is public. (feature #14133)

Co-Authored-By: Miguel Landaeta <miguel@miguel.cc>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-25 18:06:29 +00:00
tenderlove 655b3da03c Fixes the File::CREAT logger documentation
Co-Authored-By: Matias Korhonen <matias@kiskolabs.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-25 18:04:16 +00:00
svn a818fca33a * 2018-07-26
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-25 18:00:12 +00:00
tenderlove e6282ef0d2 Add docs to RubyVM::AST
Co-Authored-By: Robert Mosolgo <rdmosolgo@gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-25 18:00:09 +00:00
k0kubun a763bc3c6b insns.def: s/handles_frame/handles_sp/
because it's more suitable to describe the current behavior now.

tool/ruby_vm/models/bare_instructions.rb: ditto.
tool/ruby_vm/views/_insn_entry.erb: ditto.
tool/ruby_vm/views/_mjit_compile_insn_body.erb: ditto.
tool/ruby_vm/views/_mjit_compile_pc_and_sp.erb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-25 14:55:43 +00:00
k0kubun 218aa03c0f mjit.c: split build stages for unix
I'm going to build a large .so file that combines multiple .o files.
For that change, I want to confirm the impact to performance by this
change. So far, I haven't seen the significant change on the max
performance.

* before
$ for i in 1 2 3 4 5 6 7 8 9 1 2; do ruby --jit ../../mame/optcarrot/bin/optcarrot --benchmark ../../mame/optcarrot/examples/Lan_Master.nes; done
fps: 67.66058054621772
checksum: 59662
fps: 67.53138656233348
checksum: 59662
fps: 67.44109425628592
checksum: 59662
fps: 70.29423063961576
checksum: 59662
fps: 72.0147653358158
checksum: 59662
fps: 69.40157398157892
checksum: 59662
fps: 72.3984212467565
checksum: 59662
fps: 67.15473484463604
checksum: 59662
fps: 70.14142014098444
checksum: 59662
fps: 72.51761974327023
checksum: 59662
fps: 72.41086970333218
checksum: 59662

* after
$ for i in 1 2 3 4 5 6 7 8 9 1 2; do ruby --jit ../../mame/optcarrot/bin/optcarrot --benchmark ../../mame/optcarrot/examples/Lan_Master.nes; done
fps: 69.53134628999938
checksum: 59662
fps: 66.13157649232654
checksum: 59662
fps: 70.17474368971281
checksum: 59662
fps: 61.88316323809907
checksum: 59662
fps: 72.48731307319704
checksum: 59662
fps: 65.1180687907147
checksum: 59662
fps: 68.89553415996615
checksum: 59662
fps: 65.77342314036225
checksum: 59662
fps: 64.33337015048106
checksum: 59662
fps: 64.98152672793444
checksum: 59662
fps: 72.225729092625
checksum: 59662

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-25 14:36:08 +00:00
k0kubun 40bb70c7eb mjit.c: completely separate compile_c_to_so
by whether on mswin or not.

This is needed because I'm going to renew the compilation process for
unix, keeping mswin builds as it is, at first.

This commit is not changing the behavior at all.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-25 13:54:00 +00:00
k0kubun f10582d8e7 mjit.c: prevent memory leak on realloc failure
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-25 12:33:38 +00:00
hsbt 3a1e3d35e2 Update latest default gems on maintainers.rdoc and standard_library.rdoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-25 12:31:58 +00:00
hsbt 8d884d94aa Promote Mutex_m to Default gems.
* lib/mutex_m.gemspec: Added initial gemspec.
  * lib/mutex_m.rb: Added Mutex_m::VERSION for gemspec.
  * tool/sync_default_gems.rb: Support Mutex_m.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-25 12:28:17 +00:00
svn 27785eec15 * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-25 12:26:42 +00:00
hsbt 82f55bae86 Promote Exception2MessageMapper to Default gems.
* lib/e2mmap.gemspec: Added initial gemspec.
  * lib/e2mmap/version.rb: Added Exception2MessageMapper::VERSION for gemspec.
  * tool/sync_default_gems.rb: Support Exception2MessageMapper.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-25 12:26:41 +00:00
svn ddb6e1f712 * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-25 12:15:46 +00:00
hsbt bbb5dbe8ee Promote ThWait to Default gems.
* lib/thwait.gemspec: Added initial gemspec.
  * lib/thwait/version.rb: Added ThWait::VERSION for gemspec.
  * tool/sync_default_gems.rb: Support ThWait.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-25 12:15:45 +00:00
hsbt 2b80b8bcec Removed duplicate task in default gems that used single test file
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-25 11:59:21 +00:00
hsbt 26e6462b81 Promote Forwardable to default gems.
* lib/forwardable.rb: Added Forwardable::VERSION and re-use it.
  * lib/forwardable/forwardable.gemspec: Added initial gemspec.
  * tool/sync_default_gems.rb: Support forwaradable repository.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-25 11:53:57 +00:00
hsbt fd87d68028 Removed duplicate task in default gems
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-25 11:51:43 +00:00
hsbt 3772c47d2f Support logger.gemspec
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-25 11:47:04 +00:00
hsbt c8edd78811 Update latest versions of bundled gems.
* net-telnet-0.2.0
  * power_assert-1.1.3

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-25 11:34:35 +00:00
naruse f1186a3d38 Revert "dir.c: fix glob with base when no DT_UNKNOWN"
This reverts commit r63982.
It breaks build on Solaris 11.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-24 20:24:27 +00:00
k0kubun cd2eaf2a33 mjit.c: handle memory allocation failure
which was missing in r64033.

Prior to r64033, memory allocation failure had been checked by
TRY_WITH_GC and handled by rb_memerror. But calling rb_memerror on MJIT
worker is problematic since it does EC_JUMP_TAG in the end. Threads
except Ruby's main thread must not use it.

mjit_compile.c: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-24 15:40:05 +00:00
svn 461c79f17c * 2018-07-25
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-24 15:17:09 +00:00
k0kubun ba8413c27c vm.c: simplify the implementation of r64031
because such inconsistency may result in the regression fixed in r64034.

vm_exec is not touched since renaming it may be controversial...

vm_args.c: ditto.
vm_eval.c: ditto.
vm_insnhelper.c: ditto.
vm_method.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-24 15:17:08 +00:00
k0kubun 63f51f5283 transform_mjit_header.rb: fix performance regression
on r64031. Compiling vm_search_method_slowpath is very slow.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-24 14:43:40 +00:00
k0kubun 83c9263b85 mjit.c: prevent GC on MJIT worker
mjit_compile.c: ditto.

REALLOC_N, ALLOC_N and xmalloc trigger GC but it's not expected.
Other allocation calls in mjit.c are executed on Ruby's main thread and
thus fine.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-24 14:36:10 +00:00
k0kubun e8df28d9ae test_jit.rb: give up debugging cc1 issue
in a short term, and add retries to prevent random CI failures by it.

I remember this and will address it later for sure.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-24 12:19:47 +00:00
nobu afba9cd7fe prefix symbols exported for mjit
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-24 12:12:59 +00:00
k0kubun a67f47c4cc test_jit.rb: suppress unused variable warning
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-24 11:54:15 +00:00
kazu 004f55212d Try to suppress warning on some CI
http://ci.rvm.jp/results/trunk-asserts-nopara@silicon-docker/1149270
```
/home/ko1/ruby/src/trunk-asserts-nopara/process.c: In function 'assert_close_on_exec':
/home/ko1/ruby/src/trunk-asserts-nopara/process.c:298:9: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]
         (void)write(2, m, sizeof(m) - 1);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

workaround from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425#c34

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-24 09:15:58 +00:00
nobu 728b75bc9b time.rb: yday support
* lib/time.rb (Time.make_time): added yday support.
  [ruby-core:87545] [Bug #14860]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-24 07:47:01 +00:00
nobu 727f6ee8ef dsymutil needs the object files
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-24 06:03:02 +00:00
svn 8099b9279b * 2018-07-24
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-24 05:38:09 +00:00
nobu 97e05dad7f UNREACHABLE_RETURN
* include/ruby/ruby.h (UNREACHABLE_RETURN): UNREACHABLE at the end
  of non-void functions.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-24 05:38:07 +00:00
svn c78945751f * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-23 09:56:50 +00:00
kazu 0a5c78b979 Revert previous commit and split lib/tracer/version.rb
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-23 09:56:49 +00:00
kazu 043e17db95 Revert partially to avoid test error temporarily
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-23 09:49:46 +00:00
kazu 5b666803f1 Fix a typo [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-23 09:49:45 +00:00
usa 7ca648e929 60 sec is not enough at all
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-23 06:22:25 +00:00
ko1 b2f9deee3e increase timeout seconds.
* test/ruby/test_io.rb (test_select_leak): increase timeout seconds
  to pass this test on a high-load machine.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-23 06:08:02 +00:00
normal 8a3ed368af Revert "thread.c (rb_thread_fd_select): remove unnecessary rb_fd_resize calls"
This reverts commit r64017
(git commit 2ff8562169).

Nevermind, haven't had enough coffee, yet :x

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-23 01:07:41 +00:00
normal 2ff8562169 thread.c (rb_thread_fd_select): remove unnecessary rb_fd_resize calls
There's no need to resize each rb_fdset_t to match the size of
the biggest one.  This can allow some small memory savings if
watching several sets of FDs simultaneously.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-23 00:51:51 +00:00
svn 0c32ffc72d * 2018-07-23
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-22 16:03:59 +00:00
nobu 02cae85e34 object.c: prefer base optarg
* object.c (rb_f_integer): prefer `base` optional argument over
  keyword arguments.  this issue should be resolved more generally
  by separating keyword arguments from hashes in the future.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-22 16:03:58 +00:00
nobu 67cacdb836 fix sum on infinity
* array.c (rb_ary_sum): consider non-finite floats.
  [ruby-core:88024] [Bug #14926]

* enum.c (sum_iter): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-22 10:47:33 +00:00