summaryrefslogtreecommitdiff
path: root/vm_dump.c
AgeCommit message (Collapse)Author
2015-06-02* method.h: make rb_method_entry_t a VALUE.ko1
Motivation and new data structure are described in [Bug #11203]. This patch also solve the following issues. * [Bug #11200] Memory leak of method entries * [Bug #11046] __callee__ returns incorrect method name in orphan proc * test/ruby/test_method.rb: add a test for [Bug #11046]. * vm_core.h: remvoe rb_control_frame_t::me. me is located at value stack. * vm_core.h, gc.c, vm_method.c: remove unlinked_method... codes because method entries are simple VALUEs. * method.h: Now, all method entries has own independent method definititons. Strictly speaking, this change is not essential, but for future changes. * rb_method_entry_t::flag is move to rb_method_definition_t::flag. * rb_method_definition_t::alias_count is now rb_method_definition_t::alias_count_ptr, a pointer to the counter. * vm_core.h, vm_insnhelper.c (rb_vm_frame_method_entry) added to search the current method entry from value stack. * vm_insnhelper.c (VM_CHECK_MODE): introduced to enable/disable assertions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-20* vm_dump.c (rb_print_backtrace): return value of libexec's backtracenaruse
is size_t, so simply cast as int. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-12vm_dump.c: statement for crash report lognobu
* vm_dump.c (preface_dump): move the statement to include crash report log file from REPORTBUG_MSG in error.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-12vm_dump.c: highlight prefacenobu
* vm_dump.c (preface_dump): highlight very important but very ofhen ignored message like a Xmas tree. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-12vm_dump.c: preface_dumpnobu
* vm_dump.c (preface_dump): move platform specific preface. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-11vm_dump.c: check procstat_getvmmapnobu
* configure.in: check also procstat_getvmmap, which is not available on FreeBSD 9. [ruby-core:68468] [Bug #10954] * vm_dump.c (procstat_vm): use kinfo_getvmmap instead if procstat_getvmmap is not available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-10* proc.c: use RUBY_VM_IFUNC_P() to recognize IFUNC or not.ko1
* vm.c: ditto. * vm_dump.c: ditto. * vm_insnhelper.c: ditto. * vm_core.h: use RB_TYPE_P() instead of BUILTIN_TYPE(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-28vm_dump.c: no new strings in signal contextnobu
* vm_dump.c (rb_vm_bugreport): get rid of making new strings inside signal context. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-18vm_dump.c: check by configured resultnobu
* vm_dump.c (rb_vm_bugreport): check by configured result instead of system name for old FreeBSD. based on a patch by Steve Wills at [ruby-core:67655]. [Bug #10752] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15* internal.h: Include ruby.h and ruby/encoding.h to beakr
includable without prior inclusion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-02* vm_core.h: change iseq parameter data structure.ko1
https://bugs.ruby-lang.org/issues/10440#change-49694 * change terminology `arg' to `param'. * move rb_iseq_t::arg_* to rb_iseq_t::param. * move rb_iseq_t::arg_size to rb_iseq_t::param::size. * move rb_iseq_t::argc to rb_iseq_t::param::lead_num. * move rb_iseq_t::arg_opts to rb_iseq_t::param::opt_num. * move rb_iseq_t::arg_rest to rb_iseq_t::param::rest_start. * move rb_iseq_t::arg_post_num to rb_iseq_t::param::post_num. * move rb_iseq_t::arg_post_start to rb_iseq_t::param::post_start. * move rb_iseq_t::arg_block to rb_iseq_t::param::block_start. * move rb_iseq_t::arg_keyword* to rb_iseq_t::param::keyword. rb_iseq_t::param::keyword is allocated only when keyword parameters are available. * introduce rb_iseq_t::param::flags to represent parameter availability. For example, rb_iseq_t::param::flags::has_kw represents that this iseq has keyword parameters and rb_iseq_t::param::keyword is allocated. We don't need to compare with -1 to check availability. * remove rb_iseq_t::arg_simple. * compile.c: catch up this change. * iseq.c: ditto. * proc.c: ditto. * vm.c, vm_args.c, vm_dump.c, vm_insnhelper.c: ditto. * iseq.c (iseq_data_to_ary): support keyword argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-10compile: translate iseq in-placenormal
running "ruby -rpp -e 'pp GC.stat'", a reduction in malloc usage is shown: before: :malloc_increase=>118784, :oldmalloc_increase=>1178736, after: :malloc_increase=>99832, :oldmalloc_increase=>1031976, For "ruby -e exit", valgrind reports over 300K reduction in overall allocations (and unnecessary memory copies). before: total heap usage: 49,622 allocs, 20,492 frees, 8,697,493 bytes allocated after: total heap usage: 48,935 allocs, 19,805 frees, 8,373,773 bytes allocated (numbers from x86-64) v2 changes based on ko1 recommendations [ruby-core:64883]: - squashed in-place direct thread translation to avoid alloc+copy - renamed rb_iseq_untranslate_threaded_code to rb_iseq_original_iseq, cache new iseq->iseq_original field. * compile.c (rb_iseq_translate_threaded_code): modify in-place w/o copy (rb_vm_addr2insn): new function for debug (rb_iseq_original_iseq): ditto (iseq_set_sequence): assign iseq_encoded directly [Feature #10185] * vm_core (rb_iseq_t): move original ->iseq to bottom * iseq.c (iseq_free, iseq_free): adjust for new layout (rb_iseq_disasm): use original iseq for dump (iseq_data_to_ary): ditto (rb_iseq_line_trace_each): ditto (rb_iseq_build_for_ruby2cext): use iseq_encoded directly * vm_dump.c (rb_vmdebug_debug_print_pre): use original iseq git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47508 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-04* dir.c (glob_helper): use #ifdef instead of #if.ko1
gcc's -Wundef option shows warning for undefined macro. * numeric.c (flo_is_finite_p): ditto. * vm_dump.c (rb_vmdebug_thread_dump_state): ditto. * vm_core.h: define VM_DEBUG_VERIFY_METHOD_CACHE to 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-19* vm_core.h: add VM_FRAME_MAGIC_RESCUE to recognize normal block orko1
rescue clause. * vm.c (vm_exec): use VM_FRAME_MAGIC_RESCUE on at rescue/ensure. * test/ruby/test_settracefunc.rb: should not invoke b_return at rescue clause. [Bug #9957] * vm_dump.c (control_frame_dump): check VM_FRAME_MAGIC_RESCUE. * vm_dump.c (vm_stack_dump_each): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-25report bug with machine regisitersnobu
* error.c (rb_bug_context): new function to report bug with context. * vm_dump.c (rb_vm_bugreport): accepts `ucontext_t` argument to dump machine regisiters. based on [GH-584]. * signal.c (sigbus, sigsegv): dump machine regisiters if available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-25vm_dump.c: adjust stylenobu
* vm_dump.c (backtrace): adjust style, inserting breaks between type, function name with its arguments, and its body. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-31* vm_dump.c (rb_print_backtrace): current implementationnaruse
uses dladdr to get the path of objects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-28revert r45417naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-26* addr2line.c (fill_lines): loop reverse order not to overwritenaruse
the basis of base addresses comparison. * addr2line.c: use uintptr_t instead of intptr_t for poinrters. * addr2line.c (rb_dump_backtrace_with_lines): don't use syms. * vm_dump.c (rb_print_backtrace): ditto. * addr2line.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-25temporaly change/add to debug on powerpc64-linuxnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-10* vm_dump.c (rb_vm_bugreport): show vm maps on FreeBSD.naruse
* vm_dump.c (procstat_vm): copied from FreeBSD. http://svnweb.freebsd.org/base/head/usr.bin/procstat/procstat_vm.c?revision=261780 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-19vm_dump.c: improve wording of apple crashlog messagestmm1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-30vm_dump.c: suppress warningnobu
* vm_dump.c (rb_vmdebug_debug_print_pre): suppress warning on a platform ptrdiff_t is shorter than long int. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-29 * vm_dump.c (rb_vmdebug_debug_print_pre): Bugfix. Get PC directly.tarui
PC is cached into local stack and cfp->pc is incorrent at next of branch or jump. * vm_exec.h (DEBUG_ENTER_INSN): catch up this change. * vm_core.h: update signature of rb_vmdebug_debug_print_pre. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-22* vm_dump.c (rb_vm_bugreport): show name of class and module.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-22* vm_dump.c (rb_vm_bugreport): limit class name length.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13* *.c, parse.y, insns.def: use RARRAY_AREF/ASET macroko1
instead of using RARRAY_PTR(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-02* vm_dump.c (rb_print_backtrace): separate to ease showing C backtrace.naruse
* internal.h (rb_print_backtrace): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-18Add comments to r39808naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-18* vm_dump.c (backtrace): on darwin use custom backtrace() to tracenaruse
beyond _sigtramp. darwin's backtrace can't trace beyond signal trampoline with sigaltstack. * configure.in: check execinfo.h on darwin. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-18Correct condition of r39302naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-18* vm_dump: FreeBSD ports' libexecinfo's backtrace(3) can't tracenaruse
beyond signal trampoline, and as described in r38342 it can't trace on -O because it see stack frame pointers. libunwind unw_backtrace see dwarf information in the binary and it works with -O (without frame pointers). * configure.in: remove r38342's hack and check libunwind. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-18* configure.in: check whether backtrace(3) works well or not.naruse
* vm_dump.c: set HAVE_BACKTRACE 0 if BROKEN_BACKTRACE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-04* vm_dump.c (control_frame_dump): capitalize prefix of `ep'ko1
if `ep' points an env object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-30vm_dump.c: important message firstnobu
* vm_dump.c (rb_vm_bugreport): show the most important message, Crash Report log information, first. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-21* vm_dump.c (rb_vm_bugreport): revert r38533.kosaki
* addr2line.c (fill_lines): add ELF sanity check. [Bug #7597] [ruby-dev:46786] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-21 * vm_dump.c (rb_vm_bugreport): commentout addr2line call temporarilytarui
in order to avoid segv. anyone can fix addr2line? [Bug #7597] [ruby-dev:46786] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-12* configure.in: add -fno-omit-frame-pointer if libexecinfo is used.naruse
At least on FreeBSD ruby will crash on getting C backtrace when it is compiled with other than -O0. * vm_dump.c: enable backtrace on FreeBSD even if with optimizations. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-12Specify rlimits_core to prevent making core filenaruse
Stable fix for r38041. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-12Experimental fix for r38041naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-11Experimental: don't use $.*s of fprintfnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-11Experimentally recommit of r38041: specify smaller max lengthnaruse
* vm_dump.c (rb_vm_bugreport): get rid of calling methods in sigsegv handler. based on a patch by charliesome (Charlie Somerville) [ruby-core:49573] [Bug #7402] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-11Experimentally revert r38041naruse
"vm_dump.c: no methods in segv handler" It may cause segv: http://fb.rubyci.org/~chkbuild/ruby-trunk/log/20121130T090301Z.diff.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-30vm_dump.c: no methods in segv handlernobu
* vm_dump.c (rb_vm_bugreport): get rid of calling methods in sigsegv handler. based on a patch by charliesome (Charlie Somerville) [ruby-core:49573] [Bug #7402] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-19* vm_dump.c: not to include probes.h because the code does not dependngoto
on it. * common.mk (vm_dump.$(OBJEXT)): remove dependency on probes.h git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-12* probes.d: add DTrace probe declarations. [ruby-core:27448]tenderlove
* array.c (empty_ary_alloc, ary_new): added array create DTrace probe. * compile.c (rb_insns_name): allowing DTrace probes to access instruction sequence name. * Makefile.in: translate probes.d file to appropriate header file. * common.mk: declare dependencies on the DTrace header. * configure.in: add a test for existence of DTrace. * eval.c (setup_exception): add a probe for when an exception is raised. * gc.c: Add DTrace probes for mark begin and end, and sweep begin and end. * hash.c (empty_hash_alloc): Add a probe for hash allocation. * insns.def: Add probes for function entry and return. * internal.h: function declaration for compile.c change. * load.c (rb_f_load): add probes for `load` entry and exit, require entry and exit, and wrapping search_required for load path search. * object.c (rb_obj_alloc): added a probe for general object creation. * parse.y (yycompile0): added a probe around parse and compile phase. * string.c (empty_str_alloc, str_new): DTrace probes for string allocation. * test/dtrace/*: tests for DTrace probes. * vm.c (vm_invoke_proc): add probes for function return on exception raise, hash create, and instruction sequence execution. * vm_core.h: add probe declarations for function entry and exit. * vm_dump.c: add probes header file. * vm_eval.c (vm_call0_cfunc, vm_call0_cfunc_with_frame): add probe on function entry and return. * vm_exec.c: expose instruction number to instruction name function. * vm_insnshelper.c: add function entry and exit probes for cfunc methods. * vm_insnhelper.h: vm usage information is always collected, so uncomment the functions. 12 19:14:50 2012 Akinori MUSHA <knu@iDaemons.org> * configure.in (isinf, isnan): isinf() and isnan() are macros on DragonFly which cannot be found by AC_REPLACE_FUNCS(). This workaround enforces the fact that they exist on DragonFly. 12 15:59:38 2012 Shugo Maeda <shugo@ruby-lang.org> * vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo), vm_insnhelper.c (vm_search_method): revert r37616 because it's too slow. [ruby-dev:46477] * test/ruby/test_refinement.rb (test_inline_method_cache): skip the test until the bug is fixed efficiently. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-02* vm_dump.c (rb_vm_bugreport): Because of many log directories,sorah
making directory lists readable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-02* vm_dump.c (rb_vm_bugreport): add ~/Library/Logs/DiagnosticReportsmrkn
in the locations list of crash reports. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-10* vm_dump.c: fix debug prints to catch up recent changesko1
such as VM data structures. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-04* vm.c (VM_COLLECT_USAGE_DETAILS): make new VM usage analysisko1
hooks (old macro name is COLLECT_USAGE_ANALYSIS). This feature is only for VM developers. (I'm not sure I can use `VM developers' (the plural form) in this sentence). If VM_COLLECT_USAGE_DETAILS is not 0, VM enables the following usage collection features: (1) insntruction: collect intruction usages. (2) operand: collect operand usages. (3) register: collect register usages. The results are stored in RubyVM::USAGE_ANALYSIS_INSN for (1, 2), RubyVM::USAGE_ANALYSIS_INSN_BIGRAM for (1) and RubyVM::USAGE_ANALYSIS_REGS for (3). You can stop collecting usages with RubyVM::USAGE_ANALYSIS_INSN_STOP(), RubyVM::USAGE_ANALYSIS_OPERAND_STOP(), RubyVM::USAGE_ANALYSIS_REGISTER_STOP() for (1), (2), (3) respectively. You can also change the hook functions by setting C level global variables `ruby_vm_collect_usage_func_(insn|operand|register)' for (1), (2), (3) respectively. See codes for more details. * tool/instruction.rb: fix macro names. * iseq.c (insn_operand_intern): make it export (used in vm.c). fix to skip several processes if not needed (pointer is 0). * vm_dump.c: move codes for collection features to vm.c. * vm_exec.h: rename macro and function names. * vm_insnhelper.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e