summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-12-12Make super in instance_eval in method in module raise TypeErrorJeremy Evans
This makes behavior the same as super in instance_eval in method in class. The reason this wasn't implemented before is that there is a check to determine if the self in the current context is of the expected class, and a module itself can be included in multiple classes, so it doesn't have an expected class. Implementing this requires giving iclasses knowledge of which class created them, so that super call in the module method knows the expected class for super calls. This reference is called includer, and should only be set for iclasses. Note that the approach Ruby uses in this check is not robust. If you instance_eval another object of the same class and call super, instead of an TypeError, you get super called with the instance_eval receiver instead of the method receiver. Truly fixing super would require keeping a reference to the super object (method receiver) in each frame where scope has changed, and using that instead of current self when calling super. Fixes [Bug #11636] Notes: Merged: https://github.com/ruby/ruby/pull/2717
2019-12-12proper initialization of struct RVALUE卜部昌平
This changeset makes no difference unless GC_DEBUG is on. When that flag is set, struct RVALUE is bigger than struct RObject. We have to take care of the additional fields. Otherwise we get a SIGSEGV like shown below. The way obj is initialized in this patch works for both GC_DEBUG is on and off. See also ISO/IEC 9899:1999 section 6.7.8 paragraph #21. ``` Program received signal SIGSEGV, Segmentation fault. __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:62 62 ../sysdeps/x86_64/multiarch/strlen-avx2.S: No such file or directory (gdb) bt #0 __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:62 #1 0x00005555557dd9a7 in BSD_vfprintf (fp=0x7fffffff6be0, fmt0=0x5555558f3059 "@%s:%d", ap=0x7fffffff6dd0) at vsnprintf.c:1027 #2 0x00005555557db6f5 in ruby_do_vsnprintf (str=0x555555bfc58d <obj_info_buffers+1325> "", n=211, fmt=0x5555558f3059 "@%s:%d", ap=0x7fffffff6dd0) at sprintf.c:1022 #3 0x00005555557db909 in ruby_snprintf (str=0x555555bfc58d <obj_info_buffers+1325> "", n=211, fmt=0x5555558f3059 "@%s:%d") at sprintf.c:1040 #4 0x0000555555661ef4 in rb_raw_obj_info (buff=0x555555bfc560 <obj_info_buffers+1280> "0x0000555555d2bfa0 [0 ] T_STRING (String)", buff_size=256, obj=93825000456096) at gc.c:11449 #5 0x000055555565baaf in obj_info (obj=93825000456096) at gc.c:11612 #6 0x000055555565bae1 in rgengc_remembered (objspace=0x555555c0a1c0, obj=93825000456096) at gc.c:6618 #7 0x0000555555666987 in newobj_init (klass=93824999964192, flags=5, v1=0, v2=0, v3=0, wb_protected=1, objspace=0x555555c0a1c0, obj=93825000456096) at gc.c:2134 #8 0x0000555555666e49 in newobj_slowpath (klass=93824999964192, flags=5, v1=0, v2=0, v3=0, objspace=0x555555c0a1c0, wb_protected=1) at gc.c:2209 #9 0x0000555555666b94 in newobj_slowpath_wb_protected (klass=93824999964192, flags=5, v1=0, v2=0, v3=0, objspace=0x555555c0a1c0) at gc.c:2220 #10 0x000055555565751b in newobj_of (klass=93824999964192, flags=5, v1=0, v2=0, v3=0, wb_protected=1) at gc.c:2256 #11 0x00005555556575ca in rb_wb_protected_newobj_of (klass=93824999964192, flags=5) at gc.c:2272 #12 0x00005555557f36ea in str_alloc (klass=93824999964192) at string.c:728 #13 0x00005555557f2128 in rb_str_buf_new (capa=0) at string.c:1317 #14 0x000055555578c66d in rb_reg_preprocess (p=0x555555cc8148 "^-(.)(.+)?", end=0x555555cc8152 "", enc=0x555555cc7c80, fixed_enc=0x7fffffff74e8, err=0x7fffffff75f0 "") at re.c:2682 #15 0x000055555578ea13 in rb_reg_initialize (obj=93825000046736, s=0x555555cc8148 "^-(.)(.+)?", len=10, enc=0x555555cc7c80, options=0, err=0x7fffffff75f0 "", sourcefile=0x555555d1a5c0 "lib/optparse.rb", sourceline=1460) at re.c:2808 #16 0x000055555578e285 in rb_reg_initialize_str (obj=93825000046736, str=93825000046904, options=0, err=0x7fffffff75f0 "", sourcefile=0x555555d1a5c0 "lib/optparse.rb", sourceline=1460) at re.c:2869 #17 0x000055555578ee02 in rb_reg_compile (str=93825000046904, options=0, sourcefile=0x555555d1a5c0 "lib/optparse.rb", sourceline=1460) at re.c:2958 #18 0x0000555555748dfb in rb_parser_reg_compile (p=0x555555d1f760, str=93825000046904, options=0) at parse.y:12157 #19 0x00005555557581c3 in parser_reg_compile (p=0x555555d1f760, str=93825000046904, options=0) at parse.y:12151 #20 0x00005555557580ac in reg_compile (p=0x555555d1f760, str=93825000046904, options=0) at parse.y:12167 #21 0x0000555555746ebb in new_regexp (p=0x555555d1f760, node=0x555555dece68, options=0, loc=0x7fffffff89e8) at parse.y:10072 #22 0x000055555573d1f5 in ruby_yyparse (p=0x555555d1f760) at parse.y:4395 #23 0x000055555574a582 in yycompile0 (arg=93825000404832) at parse.y:5945 #24 0x00005555558c6898 in rb_suppress_tracing (func=0x55555574a470 <yycompile0>, arg=93825000404832) at vm_trace.c:427 #25 0x0000555555748290 in yycompile (vparser=93824999283456, p=0x555555d1f760, fname=93824999283624, line=1) at parse.y:5994 #26 0x00005555557481ae in rb_parser_compile_file_path (vparser=93824999283456, fname=93824999283624, file=93824999283400, start=1) at parse.y:6098 #27 0x00005555557cdd35 in load_file_internal (argp_v=140737488331760) at ruby.c:2023 #28 0x00005555556438c5 in rb_ensure (b_proc=0x5555557cd610 <load_file_internal>, data1=140737488331760, e_proc=0x5555557cddd0 <restore_load_file>, data2=140737488331760) at eval.c:1128 #29 0x00005555557cb68b in load_file (parser=93824999283456, fname=93824999283624, f=93824999283400, script=0, opt=0x7fffffffa468) at ruby.c:2142 #30 0x00005555557cb339 in rb_parser_load_file (parser=93824999283456, fname_v=93824999283624) at ruby.c:2164 #31 0x00005555556ba3e1 in load_iseq_eval (ec=0x555555c0a650, fname=93824999283624) at load.c:579 #32 0x00005555556b857a in require_internal (ec=0x555555c0a650, fname=93824999284352, exception=1) at load.c:1016 #33 0x00005555556b7967 in rb_require_string (fname=93824999284464) at load.c:1105 #34 0x00005555556b7939 in rb_f_require (obj=93824999994824, fname=93824999284464) at load.c:811 #35 0x00005555558b7ae0 in call_cfunc_1 (recv=93824999994824, argc=1, argv=0x7ffff7ecd0a8, func=0x5555556b7920 <rb_f_require>) at vm_insnhelper.c:2348 #36 0x00005555558a8889 in vm_call_cfunc_with_frame (ec=0x555555c0a650, reg_cfp=0x7ffff7fccfa0, calling=0x7fffffffaab0, cd=0x555555d76a10, empty_kw_splat=0) at vm_insnhelper.c:2513 #37 0x000055555589fb5c in vm_call_cfunc (ec=0x555555c0a650, reg_cfp=0x7ffff7fccfa0, calling=0x7fffffffaab0, cd=0x555555d76a10) at vm_insnhelper.c:2538 #38 0x000055555589f22e in vm_call_method_each_type (ec=0x555555c0a650, cfp=0x7ffff7fccfa0, calling=0x7fffffffaab0, cd=0x555555d76a10) at vm_insnhelper.c:2924 #39 0x000055555589ef47 in vm_call_method (ec=0x555555c0a650, cfp=0x7ffff7fccfa0, calling=0x7fffffffaab0, cd=0x555555d76a10) at vm_insnhelper.c:3038 #40 0x0000555555866dbd in vm_call_general (ec=0x555555c0a650, reg_cfp=0x7ffff7fccfa0, calling=0x7fffffffaab0, cd=0x555555d76a10) at vm_insnhelper.c:3075 #41 0x00005555558ae557 in vm_sendish (ec=0x555555c0a650, reg_cfp=0x7ffff7fccfa0, cd=0x555555d76a10, block_handler=0, method_explorer=0x5555558ae5d0 <vm_search_method_wrap>) at vm_insnhelper.c:4021 #42 0x000055555587745b in vm_exec_core (ec=0x555555c0a650, initial=0) at insns.def:801 #43 0x0000555555899b9c in rb_vm_exec (ec=0x555555c0a650, mjit_enable_p=1) at vm.c:1907 #44 0x000055555589aaf0 in rb_iseq_eval_main (iseq=0x555555c1da80) at vm.c:2166 #45 0x0000555555641f0b in rb_ec_exec_node (ec=0x555555c0a650, n=0x555555c1da80) at eval.c:277 #46 0x0000555555641d62 in ruby_run_node (n=0x555555c1da80) at eval.c:335 #47 0x000055555557a188 in main (argc=11, argv=0x7fffffffc848) at main.c:50 (gdb) fr 7 #7 0x0000555555666987 in newobj_init (klass=93824999964192, flags=5, v1=0, v2=0, v3=0, wb_protected=1, objspace=0x555555c0a1c0, obj=93825000456096) at gc.c:2134 2134 if (rgengc_remembered(objspace, (VALUE)obj)) rb_bug("newobj: %s is remembered.", obj_info(obj)); (gdb) p ((struct RVALUE*)obj)->file $1 = 0x65a5992b0fb25ce7 <error: Cannot access memory at address 0x65a5992b0fb25ce7> (gdb) ```
2019-12-12add casts卜部昌平
%p is for void *. Becuase fprintf is a function with variadic arguments automatic cast from any pointer to void * does not work. We have to be explicit.
2019-12-12fix arity mismatch卜部昌平
I missed this in bc3e7924bc66d3ef77b219c72f3e59cc154550a3 because the function is inside of a #ifdef.
2019-12-12implement make test-all TESTS=--gc-compact卜部昌平
79eb5e1acac2339c6ec71db723298bdfcd92b233 implemented RUBY_TEST_GC_COMPACT=1 so why not make it also possible via the command line argument.
2019-12-12Import json-2.3.0 from flori/jsonHiroshi SHIBATA
2019-12-12Suppress to crash IRB if completed list has nilaycabta
2019-12-11debug_counter.c: include ruby/config.h before stdio.hRei Odaira
to define _LARGE_FILES
2019-12-12support gc_compact_checker on parallel test.Koichi Sasada
2019-12-11Make sure we don't push MOVED or NONE on the stackAaron Patterson
2019-12-12call GC.compact after each test.Koichi Sasada
RUBY_TEST_GC_COMPACT=1 enables GC.compact checker which calls GC.compact after each test.
2019-12-12Some tests failed with before GNU Readline 6.0 on Windowsaycabta
2019-12-12* 2019-12-12 [ci skip]git
2019-12-11Update method tables only if there is a class ext pointerAaron Patterson
This makes reference updating look similar to marking, and may avoid dereferencing a wrong pointer.
2019-12-11Fix .travis.yml to keep s390x-linux as allow_featuresYusuke Endoh
[Misc #16360]
2019-12-11Move s390x-linux to allow_failures matrixYusuke Endoh
ref [Misc #16360]
2019-12-11[ruby/forwardable] Bump version to 1.3.1Jeremy Evans
https://github.com/ruby/forwardable/commit/aa07c55f3f
2019-12-11[ruby/forwardable] Make def_*_delegator return name of method defined (Fixes ↵Jeremy Evans
#10) This restores compatibility with previous versions. This behavior was previously undefined, but it makes sense for the name of the defined method to be returned. https://github.com/ruby/forwardable/commit/a52ef3451e
2019-12-11The result of Readline.completion_proc should have the same encoding of ↵aycabta
Encoding.default_external
2019-12-11Test `Thread#to_s` when used from to_s_spec.rbNobuyoshi Nakada
2019-12-11`Thread#to_s` has been added at ruby 2.5Nobuyoshi Nakada
2019-12-11skip continuous failure test.Koichi Sasada
On mingw this test fails and not solved long time, so skip it. Please revert it when it solved. https://ci.appveyor.com/project/ruby/ruby/builds/29458671/job/9nbcjnfe6p0xnxoe
2019-12-11Thread#to_s is not same as #inspect on old version.Koichi Sasada
Thread#to_s returns simple Object#to_s until Ruby 2.4.
2019-12-11rely on sorted compiled binary array.Koichi Sasada
`builtin_binary` is sorted by miniruby loading order and this loading order should be same on ruby. So we can believe sorted order of `builtin_binary` on boot time.
2019-12-11Show the failed messageNobuyoshi Nakada
2019-12-11Try to use `set-output`Kazuhiro NISHIYAMA
because commit info are not necessary in env.
2019-12-11fix for old MRI versionsKoichi Sasada
2019-12-11add depenency pointed by update-depsKoichi Sasada
2019-12-11Create dummy files when check onlyKazuhiro NISHIYAMA
because foo.rb in build directory breaks test-bundler https://github.com/ruby/ruby/runs/343168046#step:20:125
2019-12-11Do not load q.rb in build directoryKazuhiro NISHIYAMA
Notes: Merged: https://github.com/ruby/ruby/pull/2736
2019-12-11Create more dummy files in build directoryKazuhiro NISHIYAMA
Notes: Merged: https://github.com/ruby/ruby/pull/2736
2019-12-11Do not load files in build directoryKazuhiro NISHIYAMA
related https://bugs.ruby-lang.org/issues/16177 Notes: Merged: https://github.com/ruby/ruby/pull/2736
2019-12-11Fix Enumerator::Lazy#with_indexJeremy Evans
* Make it correctly handle lambdas * Make it iterate over the block if block is given The original implementation was flawed, based on lazy_set_method instead of lazy_add_method. Note that there is no implicit map when passing a block, the return value of the block passed to with_index is ignored, just as it is for Enumerator#with_index. Also like Enumerator#with_index, when called with a block, the return value is an enumerator without the index. Fixes [Bug #16414] Notes: Merged: https://github.com/ruby/ruby/pull/2742
2019-12-11Make Thread#to_s consistent with Method and Proc to_sJean byroot Boussier
Notes: Merged: https://github.com/ruby/ruby/pull/2738
2019-12-11Add a message for CompatibilityErroraycabta
2019-12-11Added documentation for integer range sums (#1593)Eli Sadoff
2019-12-11* remove trailing spaces. [ci skip]git
2019-12-11Update tool/mk_builtin_binary.rbKoichi Sasada
Co-Authored-By: Sutou Kouhei <kou@cozmixng.org> Notes: Merged: https://github.com/ruby/ruby/pull/2735
2019-12-11support cross-compilation.Koichi Sasada
On cross-compilation, compiled binary can no be created because compiled binary should be created by same interpreter (on cross- compilation, host ruby is used to build ruby (BASERUBY)). So that cross-compilation system loads required scripts in text. It is same as miniruby. Notes: Merged: https://github.com/ruby/ruby/pull/2735
2019-12-11remove prelude.cKoichi Sasada
prelude.c is an automatically generated file by template/prelude.c.tmpl. However it does not contain any required functions. So remove it from dependency. Also miniprelude.c is included by mini_builtin.c and does not need to make miniprelude.o. Notes: Merged: https://github.com/ruby/ruby/pull/2735
2019-12-11use compiled binary for gem_prelude.rb.Koichi Sasada
`gem_prelude.rb` is not compiled yet. This patch compile it to compiled binary. Notes: Merged: https://github.com/ruby/ruby/pull/2735
2019-12-11add include guardKoichi Sasada
Notes: Merged: https://github.com/ruby/ruby/pull/2735
2019-12-11Indicate `find_all` and `select` methods are aliases.Corey Farwell
This matches the documentation for `Enumerable::inject` and `Enumerable::reduce` which are also aliases.
2019-12-11* 2019-12-11 [ci skip]git
2019-12-11Support Readline.completion_quote_character by Relineaycabta
2019-12-10[ruby/io-console] update depend for f9c0fe77c0eNobuyoshi Nakada
2019-12-10Followed up 38722fa179fcec549300b2f35206f4eb168f202eHiroshi SHIBATA
2019-12-10[ruby/logger] bump version to 1.4.2Hiroshi SHIBATA
https://github.com/ruby/logger/commit/d6c01cc652
2019-12-10[ruby/logger] Enable more timezone tests on OpenBSDJeremy Evans
https://github.com/ruby/logger/commit/bcd7e227e8
2019-12-10[ruby/logger] Document that shift_age of 0 disables log file rotationJeremy Evans
Fixes Ruby Bug 16349. https://github.com/ruby/logger/commit/b1b6d06f2d