summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-11-08st.c: fix comparison between signed and unsignedshyouhei
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-08avoid (size_t)--shyouhei
The decrements overflow and these variables remain ~0 when leaving the while loops. They are not fatal by accident, but better replace with ordinal for loops. See also: https://travis-ci.org/ruby/ruby/jobs/452218871#L3246 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-08* expand tabs.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-08separate Thread type (func or proc) explicitly.ko1
* vm_core.h (rb_thread_struct): introduce new fields `invoke_type` and `invoke_arg`. There are two types threads: invoking proc (normal Ruby thread created by `Thread.new do ... end`) and invoking func, created by C-API. `invoke_type` shows the types. * thread.c (thread_do_start): copy `invoke_arg.proc.args` contents from Array to ALLOCA stack memory if args length is enough small (<8). We don't need to keep Array and don't need to cancel using transient heap. * vm.c (thread_mark): For func invoking threads, they can pass (void *) parameter (rb_thread_t::invoke_arg::func::arg). However, a rubyspec test (thread_spec.c) passes an Array object and it expect to mark it. Clealy it is out of scope (misuse of `rb_thread_create` C-API). However, I'm not sure someone else has such kind of misunderstanding. So now we mark conservatively this (void *) arg with rb_gc_mark_maybe. This misuse is found by this error log. http://ci.rvm.jp/results/trunk-theap-asserts@silicon-docker/1448164 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-08st.c: straight-forward comparison of charactersshyouhei
These functions are used in strcasehash, which is used to store encoding names. Encoding names often include hyphens (e.g. "UTF-8"), and ` '-' - 'A' ` is negative (cannot express in unsigned int). Don't be tricky, just do what to do. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-08test_ftp.rb: extend timeout for --jit-wait testingk0kubun
to avoid random failures like https://app.wercker.com/ruby/ruby/runs/mjit-test1/5be394b818310600284f2b50?step=5be394f1591ca800079b1329 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-08ext/socket/init.c (wait_connectable): bail out early on some errorsnormal
This becomes necesary if sockets become non-blocking by default <https://bugs.ruby-lang.org/issues/14968>; but it's always been possible to make sockets non-blocking anyways. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-08refine parse_ratnobu
* rational.c (read_num): return the exponent instead of the divisor, to get rid of huge bignums. * rational.c (parse_rat): subtract exponents instead of reduction of powers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-08compile.c: compile error than rb_bug [ci skip]nobu
* compile.c (get_local_var_idx, get_dyna_var_idx): raise a compile error which is useful than rb_bug, when ID is not found. * compile.c (iseq_set_sequence): ditto when IC index overflow, with dumping generated code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-08st.c: suppress integer overlow warningsshyouhei
This `i += h;` overflows. Don't know the intention of the operation, so just suppress UBSAN. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-08NEWS: Add `RubyVM::AST.of` to NEWS [ci skip]yui-knk
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-08compile.c: unreachable than rb_bug [ci skip]nobu
* compile.c (iseq_calc_param_size): use UNREACHABLE than rb_bug, at where never reachable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-08test/rdoc/minitest_helper.rb: suppress bundler errork0kubun
maybe after bundler introduction to this repository, we randomly hit errors like: http://ci.rvm.jp/results/trunk-gc-asserts@silicon-docker/1447918 As we would require minitest in this repository anyway, it should be fine to suppress the error there. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-07Following up r65583. Removed VCR files when retrieving code from upstream.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-07Clear CC_WRAPPER in other than the toplevelnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-07Dir.children is available since Feature #11302. FileUtils useshsbt
Dir.each on an internal method encapsulated on a private class `Entry_#entry`, having no '.' neither '..' entries would make now superfluous a chained reject filtering. This change can improve the performance of these FileUtils methods when the provided path covers thousands of files or directories: - chmod_R - chown_R - remove_entry - remove_entry_secure - rm_r - remove_dir - copy_entry Related: Feature #13896 https://bugs.ruby-lang.org/issues/13896 [Feature #14109][Fix GH-1754] Co-Authored-By: esparta <esparta@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-07* 2018-11-08svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-07Expand MJIT_CC on mswin toonobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-07Convert MJIT_CC to Windows path on msys toonobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-07* expand tabs. [ci skip]svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-07Add cast to suppress warnings on Solaris [ci skip]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-07`+` sign in the path of ruby needs to be escapednobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-07Generalize r65594nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-07clean mjit_build_dir.dylib.dSYM directory on macOSnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-07* expand tabs.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-07Rename get/setinlinecache to opt_get/opt_setinlinecachemame
The instructions are just for optimization. To clarity the intention, this change adds the prefix "opt_", like "opt_case_dispatch". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-07mjit_worker.c: stop expanding already-absolute MJIT_CCk0kubun
r65577 seems to have made MJIT_CC (MJIT_CC_COMMONA) become an absolute path. So start_process doesn't need to find that from PATH by dln_find_exe_r. This commit is motivated by the msys2 AppVeyor CI failure: https://ci.appveyor.com/project/ruby/ruby/builds/20084104/job/1pg15os4dtttyl0q git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-07vm_backtrace.c: pos can be zeroshyouhei
(lldb) target create "./miniruby" Current executable set to './miniruby' (x86_64). (lldb) settings set -- target.run-args "-e0" (lldb) run Process 97005 launched: './miniruby' (x86_64) ./miniruby(rb_print_backtrace+0x15) [0x10024f7d5] vm_dump.c:715 ./miniruby(rb_vm_get_sourceline+0x85) [0x10024c4f5] vm_backtrace.c:43 ./miniruby(rb_vm_make_binding+0x146) [0x100236976] vm.c:941 ./miniruby(Init_VM+0x592) [0x100249f02] vm.c:3091 ./miniruby(rb_call_inits+0xc2) [0x1000c5a72] inits.c:58 ./miniruby(ruby_setup+0xcb) [0x100098c6b] eval.c:74 ./miniruby(ruby_init+0x9) [0x100098c99] eval.c:91 ./miniruby(main+0x4d) [0x10025ddbd] addr2line.c:246 Process 97005 stopped * thread #1: tid = 0x639bb, 0x000000010024c4f5 miniruby`rb_vm_get_sourceline(cfp=<unavailable>) + 133 at vm_backtrace.c:44, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) frame #0: 0x000000010024c4f5 miniruby`rb_vm_get_sourceline(cfp=<unavailable>) + 133 at vm_backtrace.c:44 41 else { 42 /* SDR() is not possible; that causes infinite loop. */ 43 rb_print_backtrace(); -> 44 __builtin_trap(); 45 } 46 #endif 47 return rb_iseq_line_no(iseq, pos); (lldb) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-07insns.def: forgot add cast [ci skip]shyouhei
See r65595 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-07ruby-runner.c: enable MJIT_SEARCH_BUILD_DIR only if no relative loadingnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-07insns.def: avoid integer overflowshyouhei
In these expressions `1` is of type `signed int` (cf: ISO/IEC 9899:1990 section 6.1.3.2). The variable (e.g. `num`) is of type `rb_num_t`, which is in fact `unsigned long`. These two expressions then exercises the "usual arithmetic conversions" (cf: ISO/IEC 9899:1990 section 6.2.1.5) and both eventually become `unsigned long`. The two unsigned expressions are then subtracted to generate another unsigned integer expression (cf: ISO/IEC 9899:1990 section 6.3.6). This is where integer overflows can occur. OTOH the left hand side of the assignments are `rb_snum_t` which is `signed long`. The assignments exercise the "implicit conversion" of "an unsigned integer is converted to its corresponding signed integer" case (cf: ISO/IEC 9899:1990 section 6.2.1.2), which is "implementation-defined" (read: not portable). Casts are the proper way to avoid this problem. Because all expressions are converted to some integer types before any binary operations are performed, the assignments now have fully defined behaviour. These values can never exceed LONG_MAX so the casts must not lose any information. See also: https://travis-ci.org/ruby/ruby/jobs/451726874#L4357 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-07test_process.rb: avoid test failure by r65588k0kubun
on macOS. https://travis-ci.org/ruby/ruby/jobs/451709313 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-07.travis.yml: UNALIGNED_WORD_ACCESS=0 for UBSANshyouhei
Unaligned word access warnings generated by UBSAN are often treated well already, depending on this macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-07string.c: this assumption is false [ci skip]shyouhei
Looking at the lines right above, it is clear than a blue sky that we cannot assume `p` to be aligned at all when UNALIGNED_WORD_ACCESS is true. It is a wrong idea to use __builtin_assume_aligned for that situation. See also: https://travis-ci.org/ruby/ruby/jobs/451710732#L2007 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-07Fix call-seq [ci skip]kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-07suppress GCC warning about unknown sanitizersshyouhei
See also: https://travis-ci.org/ruby/ruby/jobs/451710726#L1941 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-07blacklist UBSAN's unsigned integer overflowshyouhei
Integer overflow for unsigned types are fully defined in C. They are not always problematic (but not always OK). These functions in this changeset intentionally utilizes that behaviour. Blacklist from UBSAN checks for better output. See also: https://travis-ci.org/ruby/ruby/jobs/451624829 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-07ruby-runner.c: enable MJIT_SEARCH_BUILD_DIRnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-07mjit_build_dir: separate MJIT_BUILD_DIRnobu
* Makefile.in (mjit_build_dir.so): separate MJIT_BUILD_DIR to eliminate the feature for test-all after installation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-06Fix build_os:host_os pairnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-06* 2018-11-07svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-06Revert "thread.c (rb_wait_for_single_fd): no point initializing pollfd.revents"mame
It may cause an access to uninitialized variables. The call to ppoll will set the `revents` field, but ppoll is not always called because it is in the guard `!RUBY_VM_INTERRUPTED(th->ec)`. This issue was found by Coverity Scan. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-06Removed VCR cassettes files for reducing package size.hsbt
[Bug #14219] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-06Expand MJIT_CC in configurenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-06workaround C++ism in ASAN header shyouhei
See also: https://travis-ci.org/ruby/ruby/jobs/451299690 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-06* expand tabs.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-06cont.c: direct use of rb_thread_tshyouhei
The only usage of rb_fiber_reset_root_local_storage() is from ruby_vm_destruct(), where the object space is already terminated. This `th->self` is not alive. Why not just use `th` itself. See also: https://travis-ci.org/ruby/ruby/jobs/451294954 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-06adopt sanitizer APIshyouhei
These APIs are much like <valgrind/memcheck.h>. Use them to fine-grain annotate the usage of our memory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-06mjit.c: don't use mutex before checking availabilityk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-06mjit_worker.c: don't use _one for nowk0kubun
I'm planning to use _one later, but it may be doubly registered by switching `stop_worker_p` now and so we should not use _one for now. Otherwise stale job may reject new job registration and copy_cache_from_main_thread may wait forever. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e