summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-05-12iseq.c: refactoring rb_iseq_freenobu
* 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-11lib/securerandom.rb: improve docsstomar
* 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-11configure.ac: remove ineffective check on Solaris with GCCngoto
* 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-11transform_mjit_header.rb: workaround for Solaris 10 with old GCCngoto
* 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* 2018-05-12svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-11mkmf.rb: set cppflagsngoto
* 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-11fix potential memory leaksnobu
* 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-11net/imap: Fix ArgumentError in send_string_datashugo
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* 2018-05-11svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-11Use `&.` instead of modifier ifkazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-10node.c: Fix format and example of NODE_OPCALLyui-knk
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-10variable.c: fix multiple autoload with identical file (again)normal
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-10parse.y: Fix locations of NODE_NIL in endless ranges.yui-knk
* 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-10revert r63387 and r63389 for nownormal
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-10variable.c: fix autoload object lifetimes and leaknormal
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-10RSTRING_PTR is not guaranteed to be char*-alignedshyouhei
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-10variable.c: fix multiple autoload with identical filenormal
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-10node.c: Fix typosyui-knk
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09fix potential memory leaksnobu
* 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_mjit_compile_pc_and_sp: re-commit r63360k0kubun
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-09compile.c: suppress a warningnobu
* 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_mjit_compile_send.erb: revert r63350k0kubun
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* 2018-05-10svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09iseq.h: fix argument ordernobu
* 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_mjit_compile_pc_and_sp.erb: revert r63360k0kubun
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-09Use `&.` instead of modifier ifkazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09Use hard-coded file list instead of Dir.glob.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09Revert "Use hard-coded vesion number for CI broken."hsbt
This reverts commit f5fef0a80d597f40c2d1a8cc8079bf190039fd6f. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09align jmp_buf to VALUEshyouhei
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-09Use hard-coded vesion number for CI broken.hsbt
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-09RSTRING_PTR is not guaranteed to be VALUE-alignedshyouhei
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-09Rename imemo_alloc with imemo_tmpbufmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09gc.c (rb_imemo_alloc_new): split for each purposemame
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-09type func(); is different from type func(void);shyouhei
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-09gc.c (rb_imemo_alloc_new): improve the API interfacemame
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-09RSTRING_PTR is not guaranteed to be VALUE-aligned (retry)shyouhei
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-09Fixed file structure for csv.gemspec.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09* properties.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09* append newline at EOF.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09Merge csv-1.0.2 from upstream.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09revert r63362 due to test failure. Sorry!shyouhei
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09RSTRING_PTR is not guaranteed to be VALUE-alignedshyouhei
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-08* 2018-05-09svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-08_mjit_compile_pc_and_sp.erb: make sure no uninitializedk0kubun
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-08vm_eval.c: eval_string_protect wrappernobu
* vm_eval.c (eval_string_protect): cast data instead of the function pointer, to suppress "cast between incompatible function types" warning by gcc 8.1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-08rb_ary_dig, rb_hash_dig: nobody is using them outside.shyouhei
mark them static. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-08fix type mismatch.ko1
* cont.c (fiber_context_create): `func` should accept variable args. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-08Merge rdoc-6.0.4 from upstream.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-08cont.c: host out context setupnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-08Remove unreachable breakkazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e