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

50759 Коммитов

Автор SHA1 Сообщение Дата
nobu 707c5ffab5 irb.rb: update `_`
* lib/irb.rb (IRB::Irb#eval_input): update `_` after exception.
  [ruby-core:86989] [Bug #14749]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-12 09:13:45 +00:00
nobu 4969fb6282 fix TestInputMethod
* test/irb/test_context.rb (TestInputMethod#initialize): fix typos
  and increment `line_no` only when not reaching the end.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-12 09:09:23 +00:00
kou 97c07d3487 rss: Add option Hash support to RSS::Parser.parse
Available options:

  * :validate
  * :ignore_unknown_element
  * :parser_class


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-12 09:06:00 +00:00
rhe 961cbe5262 openssl: merge changes in v2.1.1
Commits in upstream repository since v2.1.0 can be found at:

	https://github.com/ruby/openssl/compare/v2.1.0...v2.1.1

----------------------------------------------------------------
Kazuki Yamaguchi (7):
      test/utils: disable Thread's report_on_exception in start_server
      cipher: validate iterations argument for Cipher#pkcs5_keyivgen
      extconf.rb: fix build with LibreSSL 2.7.0
      test/test_pkey_rsa: fix test failure with OpenSSL 1.1.1
      test/test_ssl_session: set client protocol version explicitly
      Ruby/OpenSSL 2.0.8
      Ruby/OpenSSL 2.1.1

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-12 07:33:53 +00:00
nobu 23666ac1c1 io.c: fix typo and phrase [ci skip]
[Fix GH-1872]

From: Leon M. George <leon@georgemail.eu>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-12 01:26:39 +00:00
nobu 610c6ba5d2 iseq.c: iseq body local variables
* iseq.c: extract body and param.keyword in iseq as local
  variables.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-12 01:24:18 +00:00
nobu 67221be89b iseq.c: refactoring rb_iseq_free
* iseq.c (rb_iseq_free): call mjit_free_iseq only if iseq->body is
  not NULL too, as the function accesses the body.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-12 01:24:16 +00:00
stomar 4b8d33a323 lib/securerandom.rb: improve docs
* lib/securerandom.rb: [DOC] drop unnecessary `p' from code examples.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-11 20:07:32 +00:00
ngoto 3d1e34c1ce configure.ac: remove ineffective check on Solaris with GCC
* configure.ac (solaris): Remove ineffective check for -std=iso9899:1999
  on Solaris with GCC. The "-std=iso9899:1999" was replaced by
  "-std=gnu99" by the commit r54895. The check is no longer effective
  after that, and two years have passed without error reports.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-11 17:21:37 +00:00
ngoto 1c67c46efb transform_mjit_header.rb: workaround for Solaris 10 with old GCC
* tool/transform_mjit_header.rb (MJITHeader.conflicting_types?):
  Add workaround for Solaris 10 with old GCC (4.6.2), that is
  essentially the same as for AIX (commit r62326), but probably
  due to different GCC versions, different error message is shown.
  [Bug #14751] [ruby-dev:50541]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-11 16:47:38 +00:00
svn 94cb4cef59 * 2018-05-12
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-11 15:46:21 +00:00
ngoto 5cc2ac98a9 mkmf.rb: set cppflags
* ext/mkmf.rb (configuration): set the default cppflags, which is
  referred from the default CPPFLAGS, for extension libraries.
  This fixes build failure of ext/zlib on Solaris 10.
  [Bug #14746] [ruby-dev:50539]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-11 15:46:21 +00:00
nobu b936115ed6 fix potential memory leaks
* parse.y (primary, new_args_tail, local_tbl): keep the order;
  allocate an empty imemo first then xmalloc, to get rid of
  potential memory leak when allocation imemo failed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-11 13:01:36 +00:00
shugo 59630683d6 net/imap: Fix ArgumentError in send_string_data
Thanks to ShockwaveNN (Pavel Lobashov) for reporting the bug.
[ruby-core:86990] [Bug #14750]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-11 12:39:23 +00:00
svn b787be4e45 * 2018-05-11
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-11 12:12:59 +00:00
kazu 0f4b4684cc Use `&.` instead of modifier if
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-11 12:12:57 +00:00
yui-knk bd97ca443f node.c: Fix format and example of NODE_OPCALL
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-10 09:49:55 +00:00
normal ec959fbb4b variable.c: fix multiple autoload with identical file (again)
We need to ensure autoload declarations pointing to the same
feature (aka "file") can wait on each other to avoid deadlock
situations.

So, reorganize autoload data structures to maintain a
feature => autoload_data_i mapping, and have module constant
tables point to the new autoload_const struct instead of
directly to autoload_data_i.  This allows multiple
autoload_const structs to refer to the SAME autoload_data_i
struct, and with it, the on-stack autoload_state.waitq.

The end result is different constants can share the same waitq
(tied to the feature name), and not deadlock each other during
loading.

Thanks to Eugene Kenny for the bug report and reproducible test case.

Reported-by: Eugene Kenny <elkenny@gmail.com>

* variable.c (autoload_featuremap): new global
  (struct autoload_const): new per-const struct
  (struct autoload_state): reference autoload_const instead of autoload_data_i
  (struct autoload_data_i): remove per-const
  (autoload_i_mark): delete from autoload_featuremap if unreferenced
  (autoload_c_mark): new dmark callback
  (autoload_c_free): new dfree callback
  (autoload_c_memsize): new memsize callback
  (autoload_const_type): new data type
  (get_autoload_data): set autoload_const as well
  (rb_autoload_str): use new data structures
  (autoload_delete): cleanup from autoload_featuremap
  (check_autoload_required): adjust for new internals
  (rb_autoloading_value): ditto
  (struct autoload_const_set_args): remove, redundant with autoload_const
  (const_tbl_update): adjust for new internals
  (autoload_const_set): ditto
  (autoload_require): ditto
  (autoload_reset): ditto
  (rb_autoload_load): ditto
  (rb_const_set): ditto
  (current_autoload_data): ditto
  (set_const_visibility): ditto
* test/ruby/test_autoload.rb (test_autoload_same_file): new test
  (test_no_leak): new test
  [ruby-core:86935] [Bug #14742]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-10 08:54:26 +00:00
yui-knk 5afa84b028 parse.y: Fix locations of NODE_NIL in endless ranges.
* parse.y: Fix to start with the end of dots.

  e.g. The locations of the NODE_NIL is fixed:

  ```
  1..
  ```

  * Before

  ```
  NODE_NIL (line: 1, location: (1,0)-(1,3))
  ```

  * After

  ```
  NODE_NIL (line: 1, location: (1,3)-(1,3))
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-10 06:34:20 +00:00
normal 18b2cee206 revert r63387 and r63389 for now
I can't reproduce the problem on my 32-bit machine, and I have
connectivity problems to my 64-bit systems at the moment.
Will revisit in a few hours hopefully.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-10 05:10:13 +00:00
normal 6726038d76 variable.c: fix autoload object lifetimes and leak
We must not call normal Hash methods inside GC free callback,
either, however identity hash may be used.

[ruby-core:86935] [Bug #14742]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-10 04:18:28 +00:00
shyouhei 23c74845ed RSTRING_PTR is not guaranteed to be char*-aligned
We need to ensure aligned memory access by allocating
another memory region.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-10 02:54:04 +00:00
normal b74131132f variable.c: fix multiple autoload with identical file
We need to ensure autoload declarations pointing to the same
feature (aka "file") can wait on each other to avoid deadlock
situations.

So, reorganize autoload data structures to maintain a
feature => autoload_data_i mapping, and have module constant
tables point to the new autoload_const struct instead of
directly to autoload_data_i.  This allows multiple
autoload_const structs to refer to the SAME autoload_data_i
struct, and with it, the on-stack autoload_state.waitq.

The end result is different constants can share the same waitq
(tied to the feature name), and not deadlock each other during
loading.

Thanks to Eugene Kenny for the bug report and reproducible test case.

Reported-by: Eugene Kenny <elkenny@gmail.com>

* variable.c (autoload_featuremap): new global
  (struct autoload_const): new per-const struct
  (struct autoload_state): reference autoload_const instead of autoload_data_i
  (struct autoload_data_i): remove per-const
  (autoload_i_mark): delete from autoload_featuremap if unreferenced
  (autoload_c_mark): new dmark callback
  (autoload_c_free): new dfree callback
  (autoload_c_memsize): new memsize callback
  (autoload_const_type): new data type
  (get_autoload_data): set autoload_const as well
  (rb_autoload_str): use new data structures
  (autoload_delete): cleanup from autoload_featuremap
  (check_autoload_required): adjust for new internals
  (rb_autoloading_value): ditto
  (struct autoload_const_set_args): remove, redundant with autoload_const
  (const_tbl_update): adjust for new internals
  (autoload_const_set): ditto
  (autoload_require): ditto
  (autoload_reset): ditto
  (rb_autoload_load): ditto
  (rb_const_set): ditto
  (current_autoload_data): ditto
  (set_const_visibility): ditto
* test/ruby/test_autoload.rb (test_autoload_same_file): new test
  [ruby-core:86935] [Bug #14742]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-10 01:19:20 +00:00
yui-knk 59a571d14c node.c: Fix typos
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-10 00:23:23 +00:00
nobu 6e06d6440b fix potential memory leaks
* gc.c (rb_alloc_tmp_buffer_with_count): keep the order; allocate
  an empty imemo first then xmalloc, to get rid of potential
  memory leak when allocation imemo failed.

* parse.y (rb_parser_malloc, rb_parser_calloc, rb_parser_realloc):
  ditto.

* process.c (rb_execarg_allocate_dup2_tmpbuf): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09 17:40:04 +00:00
k0kubun 8789eb02ee _mjit_compile_pc_and_sp: re-commit r63360
reverting r63379 (revert of r63360).

The cause of error seems to be r63350. See r63382.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09 17:19:23 +00:00
nobu 5afd479de6 compile.c: suppress a warning
* compile.c (iseq_peephole_optimize): initialize dniobj first, to
  suppress a false warning by gcc 8.1.0.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09 17:17:06 +00:00
k0kubun 179bc1b814 _mjit_compile_send.erb: revert r63350
Revert "_mjit_compile_send.erb: inline recursive call"

I reverted r63360 in r63379, but the errors were reproductive from
r63350. So I need to revert this.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09 17:11:07 +00:00
svn 29ac19a05b * 2018-05-10
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09 16:12:42 +00:00
nobu c4a83d2924 iseq.h: fix argument order
* iseq.h (ISEQ_ORIGINAL_ISEQ_ALLOC): the order of ruby_xmalloc2
  arguments is `count` and `element size`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09 16:12:41 +00:00
k0kubun 3c4f49c814 _mjit_compile_pc_and_sp.erb: revert r63360
Revert "_mjit_compile_pc_and_sp.erb: make sure no uninitialized"

This triggered some `NoMethodError`s which seem to be caused by the
commit like: https://travis-ci.org/k0kubun/mjit-test/builds/376416934

I'll add tests and fix it later...

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09 13:09:01 +00:00
kazu 34002d12a6 Use `&.` instead of modifier if
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09 12:51:14 +00:00
hsbt 10a495a08a Use hard-coded file list instead of Dir.glob.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09 11:44:30 +00:00
hsbt 954d0c58c2 Revert "Use hard-coded vesion number for CI broken."
This reverts commit f5fef0a80d.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09 11:44:06 +00:00
shyouhei abc30f2591 align jmp_buf to VALUE
This ec->machine.regs is marked by GC. However jmp_buf is
not defined by us.  There are chances of unaligned access.
We should force it VALUE-aligned.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09 09:53:19 +00:00
hsbt f5fef0a80d Use hard-coded vesion number for CI broken.
https://rubyci.org/logs/rubyci.s3.amazonaws.com/ubuntu/ruby-trunk/log/20180509T063003Z.fail.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09 09:35:12 +00:00
shyouhei a6108df948 RSTRING_PTR is not guaranteed to be VALUE-aligned
Don't abuse struct RString to hold arbitrary memory region.
Thanks to @mame we now have rb_imemo_alloc_auto_free_pointer
so use it instead.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09 07:46:11 +00:00
mame e9303e1a00 Rename imemo_alloc with imemo_tmpbuf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09 07:11:59 +00:00
mame af0696782d gc.c (rb_imemo_alloc_new): split for each purpose
imemo_alloc is used for three purposes: auto-free pointer (alternative
of alloca), alloc_tmp_buffer, and heap allocation for bison.
To make it clear, this change introduces three functions:
rb_imemo_alloc_auto_free_pointer,
rb_imemo_alloc_auto_free_maybe_mark_buffer, and
rb_imemo_alloc_parser_heap.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09 07:08:53 +00:00
shyouhei 01d998aafe type func(); is different from type func(void);
If a function declarator includes no parameter list, that doesn't
mean the function takes zero parameter. rb_ast_new here does take
zero parameter, so it should be explicitly prototypes as (void).



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09 06:55:11 +00:00
mame 58823392b4 gc.c (rb_imemo_alloc_new): improve the API interface
rb_imemo_alloc_new returns rb_imemo_alloc_t*, but took VALUEs, which is
inconsistent.  To make the intention clear, it now takes only a pointer
to the buffer.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09 06:12:17 +00:00
shyouhei 75d5cf55de RSTRING_PTR is not guaranteed to be VALUE-aligned (retry)
Don't abuse struct RString to hold arbitrary memory region.
Raw pointer should just suffice.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09 05:42:06 +00:00
hsbt 433a4e66a2 Fixed file structure for csv.gemspec.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09 04:45:59 +00:00
svn 8835dd498d * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09 04:39:18 +00:00
svn 74db990e4d * append newline at EOF.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09 04:39:17 +00:00
hsbt 5c1941a9be Merge csv-1.0.2 from upstream.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09 04:39:16 +00:00
shyouhei dfc56b8c43 revert r63362 due to test failure. Sorry!
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09 02:42:22 +00:00
shyouhei 7079db9ec5 RSTRING_PTR is not guaranteed to be VALUE-aligned
Don't abuse struct RString to hold arbitrary memory region.
use rb_alloc_tmp_buffer for that purpose.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09 02:36:34 +00:00
svn 6061071f40 * 2018-05-09
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-08 15:06:12 +00:00
k0kubun bdb4268928 _mjit_compile_pc_and_sp.erb: make sure no uninitialized
area on VM stack to prevent SEGV on GC. GC may mark every value in VM
stack.

Unfortunately I couldn't write a test for it... So let me explain the
situation.

SEGV example:
https://gist.github.com/k0kubun/c7cea2b5761ffdff29ec79ea1a8f7f91

```
$ ruby --dump=insns -e 'def oct(num, len); "%0#{len}o" % num; end'
== disasm: #<ISeq:oct@-e:1 (1,0)-(1,41)> (catch: FALSE)
local table (size: 2, argc: 2 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1])
[ 2] num@0<Arg> [ 1] len@1<Arg>
0000 putobject                    "%0"                                (   1)[LiCa]
0002 getlocal_WC_0                len@1
0004 dup
0005 checktype                    T_STRING
0007 branchif                     14
0009 dup
0010 opt_send_without_block       <callinfo!mid:to_s, argc:0, FCALL|ARGS_SIMPLE>, <callcache>
0013 tostring
0014 putobject                    "o"
0016 concatstrings                3
0018 getlocal_WC_0                num@0
0020 opt_mod                      <callinfo!mid:%, argc:1, ARGS_SIMPLE>, <callcache>
0023 leave                        [Re]
```

Prior to this commit, after arguments are pushed on 0010, stacks were:
VM stack: [uninitialized, uninitialized, len]
JIT stack: ["%0", len, len]

And then, when GC is invoked on 0016, VM stack will be [uninitialized, uninitialized]
and those uninitialized values will be marked by GC.

With this commit, after arguments are pushed on 0010, stacks will be:
VM stack: [len]
JIT stack: ["%0", len, len]

And VM stack will be [] on 0016.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-08 15:06:11 +00:00