[MacRuby] #1446: Add additional diagnostic info when assertion fails in RoxorVM::pop_current_exception
#1446: Add additional diagnostic info when assertion fails in RoxorVM::pop_current_exception --------------------------------+------------------------------------------- Reporter: msabramo@… | Owner: lsansonetti@… Type: enhancement | Status: new Priority: minor | Milestone: Component: MacRuby | Keywords: --------------------------------+------------------------------------------- I've discovered that it's not difficult to make MacRuby crash by doing things that it doesn't like. For instance, right now I'm debugging this crash in my app: `Assertion failed: ((size_t)pos < current_exceptions.size()), function pop_current_exception, file vm.cpp, line 3596.` From a little big of digging around, I gather that this is probably coming from in `RoxorVM::pop_current_exception` in https://github.com/MacRuby/MacRuby/blob/master/vm.cpp#L3600 I propose to add more information about `current_exceptions` when this assertion fails. I will work on this and submit a GitHub pull request... -- Ticket URL: <http://www.macruby.org/trac/ticket/1446> MacRuby <http://macruby.org/>
#1446: Add additional diagnostic info when assertion fails in RoxorVM::pop_current_exception --------------------------------+------------------------------------------- Reporter: msabramo@… | Owner: lsansonetti@… Type: enhancement | Status: new Priority: minor | Milestone: Component: MacRuby | Keywords: --------------------------------+------------------------------------------- Comment(by msabramo@…): and here's the pull request: https://github.com/MacRuby/MacRuby/pull/54 -- Ticket URL: <http://www.macruby.org/trac/ticket/1446#comment:1> MacRuby <http://macruby.org/>
#1446: Add additional diagnostic info when assertion fails in RoxorVM::pop_current_exception --------------------------------+------------------------------------------- Reporter: msabramo@… | Owner: lsansonetti@… Type: enhancement | Status: new Priority: minor | Milestone: Component: MacRuby | Keywords: --------------------------------+------------------------------------------- Comment(by msabramo@…): Sample output for an actual crash: {{{ RoxorVM::pop_current_exception (vm.cpp:3607) - Warning: Assertion about to fail: ((size_t)pos < current_exceptions.size()); pos = 1; current_exceptions.size() = 1 current_exceptions[1]: "#<NoMethodError: undefined method `[]' for nil:NilClass>" Assertion failed: ((size_t)pos < current_exceptions.size()), function pop_current_exception, file vm.cpp, line 3616. }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1446#comment:2> MacRuby <http://macruby.org/>
#1446: Add additional diagnostic info when assertion fails in RoxorVM::pop_current_exception --------------------------------+------------------------------------------- Reporter: msabramo@… | Owner: lsansonetti@… Type: enhancement | Status: new Priority: minor | Milestone: Component: MacRuby | Keywords: --------------------------------+------------------------------------------- Comment(by msabramo@…): The commit: https://github.com/msabramo/MacRuby/commit/7a8f0cdb33584cfcf13281327900de945... Adds more comprehensive logging, guarded by #if's. -- Ticket URL: <http://www.macruby.org/trac/ticket/1446#comment:3> MacRuby <http://macruby.org/>
#1446: Add additional diagnostic info when assertion fails in RoxorVM::pop_current_exception --------------------------------+------------------------------------------- Reporter: msabramo@… | Owner: lsansonetti@… Type: enhancement | Status: new Priority: minor | Milestone: Component: MacRuby | Keywords: --------------------------------+------------------------------------------- Comment(by msabramo@…): Sample output: {{{ $ DYLD_LIBRARY_PATH=~/dev/git-repos/MacRuby ~/dev/git- repos/MacRuby/macruby test4.rb ... resolving -[NilClass []] resolving -[NilClass []] resolving -[NilClass []:] resolving -[NoMethodError to_str] rb_vm_raise (vm.cpp:3684): exception = "#<NoMethodError: undefined method `[]' for nil:NilClass>" push_current_exception (vm.cpp:3598): exc = "#<NoMethodError: undefined method `[]' for nil:NilClass>" __vm_raise (vm.cpp:3568): rb_exc = "#<NoMethodError: undefined method `[]' for nil:NilClass>" rb_vm_is_eh_active (vm.cpp:3937): current_exception = "#<NoMethodError: undefined method `[]' for nil:NilClass>" resolving -[TopLevel NSLog:] resolving -[TopLevel NSLog:] resolving -[TopLevel NSLog:] gen Ruby -> C stub with types v@ resolving -[NoMethodError length] resolving -[NoMethodError length] rb_vm_pop_exception (vm.cpp:3976): Calling pop_current_exception(1)... RoxorVM::pop_current_exception (vm.cpp:3618) - Warning: Assertion about to fail: ((size_t)pos < current_exceptions.size()); pos = 1; current_exceptions.size() = 1 current_exceptions[0] = (0x20025fd40) "#<NoMethodError: undefined method `[]' for nil:NilClass>" Assertion failed: ((size_t)pos < current_exceptions.size()), function pop_current_exception, file vm.cpp, line 3622. Abort trap }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1446#comment:4> MacRuby <http://macruby.org/>
#1446: Add additional diagnostic info when assertion fails in RoxorVM::pop_current_exception --------------------------------+------------------------------------------- Reporter: msabramo@… | Owner: lsansonetti@… Type: enhancement | Status: closed Priority: minor | Milestone: Component: MacRuby | Resolution: fixed Keywords: | --------------------------------+------------------------------------------- Changes (by watson1978@…): * status: new => closed * resolution: => fixed Comment: This request has been merged to master branch. https://github.com/MacRuby/MacRuby/commit/ca3efd0bdb480aa6f03ad75b1bc5f97938... Thanks! -- Ticket URL: <http://www.macruby.org/trac/ticket/1446#comment:5> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby