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

51421 Коммитов

Автор SHA1 Сообщение Дата
kazu 14892a26a5 use https:// instead of http://
[ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-28 10:00:27 +00:00
duerst a7acec6750 fix range check for Hangul jamo trailers in Unicode normalization
* lib/unicode_normalize/normalize.rb: Fix the range check for trailing
  Hangul jamo characters in Unicode normalization. Different from
  leading or vowel jamos, where LBASE and VBASE are actual characters,
  a value equal to TBASE expresses the absence of a trailing jamo.
  This fix is technically correct, but there was no bug because
  the regular expressions in lib/unicode_normalize/tables.rb
  eliminate jamos equal to TBASE from normalization processing.

* test/test_unicode_normalize.rb: Add preventive test
  test_no_trailing_jamo based on
  d134809cd3
  just for the case we ever get a regression.

This closes issue #14934, thanks to MaLin (Lin Ma) for reporting.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-28 09:44:33 +00:00
duerst 9eb6304aa9 always run unicode normalization that do not depend on data file
* test/test_unicode_normalize.rb: extract tests that do not depend
  on NormalizationTest.txt data file from conditionally constructed
  part of TestUnicodeNormalize class, to always run them even if
  the data file isn't found.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-28 09:11:13 +00:00
duerst fb1059312d update unicode data files directory for normalization tests
* test/test_unicode_normalize.rb: search ucd directory
  first if it exists. This change follows r61415.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-28 08:56:59 +00:00
normal 3943dcd180 use https:// instead of git:// when possible
Avoid MitM when downloading from insecure networks.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-28 03:34:30 +00:00
normal 856bd77aea thread.c (blocking_region_end): clear ubf before unregister_ubf_list
If we keep ubf set after unregistering, there is a window for
other threads (including timer thread) to put this thread back
on the ubf_list right away.  Entering ubf_list unexpectedly
after GVL acquisition may cause spurious wakeup and trigger
unexpected behavior.

Finally, clear ubf before acquiring GVL, to since ubf is useless
during GVL acquisition anyways and we don't want to waste cycles
in other threads calling ubf for useless work.

[ruby-core:88141] [Bug #14945]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-28 03:10:10 +00:00
k0kubun 297ae3437e mjit.c: clean up unit link from iseq
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-27 22:27:04 +00:00
tenderlove efee3033b5 Include Hash#size in the examples
Both methods Hash#length and Hash#size share the same source code in
Ruby, but they also share the same documentation. Now when you look at
the documentation of Hash#size you only see examples for Hash#length,
which is confusing. This commit includes Hash#size in the examples and
also remarks that both methods are equivalent to each other.

Co-authored-by: Alberto Almagro <alberto.almagro@rakuten.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-27 17:28:41 +00:00
svn ecf4641b4c * 2018-07-28
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-27 17:19:44 +00:00
tenderlove 684cdb4f83 Escape debug output in InvalidURIError exceptions.
Co-authored-by: Brad Landers <brad@bradlanders.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-27 17:19:43 +00:00
mame ffb09d8e87 eval.c: rename "rb_frozen_class_p" to "rb_class_modify_check"
Just refactoring.  Despite its name, the function does NOT return a
boolean but raises an exception when the class given is frozen.
I don't think the new name "rb_class_modify_check" is the best, but
it follows the precedeint "rb_ary_modify_check", and is definitely
better than "*_p".

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-27 13:57:14 +00:00
k0kubun ceab460fca mjit.c: keep all .o files
and lazily delete them on termination.

This will be needed to create a large so file later.
The large number of .o files will be probably compacted before the large so
file is created.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-27 09:27:58 +00:00
k0kubun e09bf11f6e mjit.c: use NOT_COMPILED_JIT_ISEQ_FUNC for unloaded
units, renaming it from NOT_COMPILABLE_JIT_ISEQ_FUNC.

NOT_READY_JIT_ISEQ_FUNC is for ones being compiled, so
mjit_get_iseq_func treats it specially and it shouldn't be used for the
purpose.

I renamed it instead of adding a new one because I'm not sure about the
impact for the performance by increasing the switch branches in mjit_exec.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-27 08:51:56 +00:00
k0kubun 0d753d4f29 mjit.c: release memory for unloaded unit
`xfree(unit)` was missing.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-27 08:24:10 +00:00
mame ca494df3e0 insns.def: remove old wrong explanation for get/setconstant
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-27 06:28:14 +00:00
k0kubun 4aa952f678 mjit.c: clarify the intention of setting 0
which was originally NULL before r62221

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-27 06:01:46 +00:00
k0kubun 51f948727d test_jit.rb: test unload_units
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-27 05:52:01 +00:00
nobu 9fbb66610c ruby.c: taint ARGV on Windows
* ruby.c (external_str_new_cstr): strings come from the external
  should be tainted.  [ruby-dev:50596] [Bug #14941]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-27 05:42:56 +00:00
svn c0e478ed75 * 2018-07-27
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-26 18:46:11 +00:00
marcandre 5219adf4f1 lib/ostruct: Remove unnecessary `__send__`
Patch by yuuji.yaginuma [Fix GH-1890]

Since `remove_method` is public.
Ref: https://bugs.ruby-lang.org/issues/14133

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-26 18:46:10 +00:00
k0kubun 781c3ca574 mjit.c: o -> so is not compilation
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-26 13:05:47 +00:00
nobu 2bfc133477 dir.c: fix glob with base when no DT_UNKNOWN
* dir.c (do_stat, do_lstat, do_opendir): need the length of the base
  path for fstatat() when fd is valid.

* dir.c (glob_helper): fix for platforms where DT_UNKNOWN is not
  available, e.g. Solaris.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-26 12:48:02 +00:00
kazu f6ae1ed6ec Add missing escape
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-26 12:47:01 +00:00
nobu d6df54cc9f process.c: conditionally used functions
* process.c (before_fork_ruby, after_fork_ruby): used only if fork()
  or daemon() is available.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-26 12:04:32 +00:00
nobu dff596be18 dladdr() is declared with non-const pointer on Solaris
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-26 09:34:30 +00:00
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