Forum: Ruby-core [ruby-trunk - Bug #7436][Open] Allow for a "granularity" flag for backtrace_locations

Posted by sam.saffron (Sam Saffron) (Guest)
on 2012-11-25 23:07
(Received via mailing list)
Issue #7436 has been reported by sam.saffron (Sam Saffron).

----------------------------------------
Bug #7436: Allow for a "granularity" flag for backtrace_locations
https://bugs.ruby-lang.org/issues/7436

Author: sam.saffron (Sam Saffron)
Status: Open
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: 2.0


related to http://bugs.ruby-lang.org/issues/7051

Sometimes one need less information (or more information) associated 
with backtraces.

It would be nice if one could send in a separate flag informing the VM 
about the granularity of information required, eg:

caller_locations(0,-current_depth, BacktraceInfo::Label & 
BacktraceInfo::Lineno)

This allows for one to take quicker backtraces if they need less 
information, additionally BacktraceInfo::Bindings and 
BacktraceInfo::Klass could be added which allow you to gather more 
information for heavy profiling / diagnostics.
Posted by sam.saffron (Sam Saffron) (Guest)
on 2012-11-25 23:08
(Received via mailing list)
Issue #7436 has been updated by sam.saffron (Sam Saffron).


ouch, this was meant to be a feature req not a bug ... cant figure out 
how to change
----------------------------------------
Bug #7436: Allow for a "granularity" flag for backtrace_locations
https://bugs.ruby-lang.org/issues/7436#change-33876

Author: sam.saffron (Sam Saffron)
Status: Open
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: 2.0


related to http://bugs.ruby-lang.org/issues/7051

Sometimes one need less information (or more information) associated 
with backtraces.

It would be nice if one could send in a separate flag informing the VM 
about the granularity of information required, eg:

caller_locations(0,-current_depth, BacktraceInfo::Label & 
BacktraceInfo::Lineno)

This allows for one to take quicker backtraces if they need less 
information, additionally BacktraceInfo::Bindings and 
BacktraceInfo::Klass could be added which allow you to gather more 
information for heavy profiling / diagnostics.
Posted by zzak (Zachary Scott) (Guest)
on 2012-11-25 23:52
(Received via mailing list)
Issue #7436 has been updated by zzak (Zachary Scott).

Category set to core
Status changed from Open to Assigned
Assignee set to ko1 (Koichi Sasada)
Target version set to 2.0.0


----------------------------------------
Bug #7436: Allow for a "granularity" flag for backtrace_locations
https://bugs.ruby-lang.org/issues/7436#change-33881

Author: sam.saffron (Sam Saffron)
Status: Assigned
Priority: Normal
Assignee: ko1 (Koichi Sasada)
Category: core
Target version: 2.0.0
ruby -v: 2.0


related to http://bugs.ruby-lang.org/issues/7051

Sometimes one need less information (or more information) associated 
with backtraces.

It would be nice if one could send in a separate flag informing the VM 
about the granularity of information required, eg:

caller_locations(0,-current_depth, BacktraceInfo::Label & 
BacktraceInfo::Lineno)

This allows for one to take quicker backtraces if they need less 
information, additionally BacktraceInfo::Bindings and 
BacktraceInfo::Klass could be added which allow you to gather more 
information for heavy profiling / diagnostics.
Posted by zzak (Zachary Scott) (Guest)
on 2012-11-25 23:52
(Received via mailing list)
Issue #7436 has been updated by zzak (Zachary Scott).

Tracker changed from Bug to Feature


----------------------------------------
Feature #7436: Allow for a "granularity" flag for backtrace_locations
https://bugs.ruby-lang.org/issues/7436#change-33882

Author: sam.saffron (Sam Saffron)
Status: Assigned
Priority: Normal
Assignee: ko1 (Koichi Sasada)
Category: core
Target version: 2.0.0


related to http://bugs.ruby-lang.org/issues/7051

Sometimes one need less information (or more information) associated 
with backtraces.

It would be nice if one could send in a separate flag informing the VM 
about the granularity of information required, eg:

caller_locations(0,-current_depth, BacktraceInfo::Label & 
BacktraceInfo::Lineno)

This allows for one to take quicker backtraces if they need less 
information, additionally BacktraceInfo::Bindings and 
BacktraceInfo::Klass could be added which allow you to gather more 
information for heavy profiling / diagnostics.
Posted by zzak (Zachary Scott) (Guest)
on 2012-11-25 23:55
(Received via mailing list)
Issue #7436 has been updated by zzak (Zachary Scott).

Target version changed from 2.0.0 to next minor


----------------------------------------
Feature #7436: Allow for a "granularity" flag for backtrace_locations
https://bugs.ruby-lang.org/issues/7436#change-33886

Author: sam.saffron (Sam Saffron)
Status: Assigned
Priority: Normal
Assignee: ko1 (Koichi Sasada)
Category: core
Target version: next minor


related to http://bugs.ruby-lang.org/issues/7051

Sometimes one need less information (or more information) associated 
with backtraces.

It would be nice if one could send in a separate flag informing the VM 
about the granularity of information required, eg:

caller_locations(0,-current_depth, BacktraceInfo::Label & 
BacktraceInfo::Lineno)

This allows for one to take quicker backtraces if they need less 
information, additionally BacktraceInfo::Bindings and 
BacktraceInfo::Klass could be added which allow you to gather more 
information for heavy profiling / diagnostics.
Posted by ko1 (Koichi Sasada) (Guest)
on 2012-11-26 00:57
(Received via mailing list)
Issue #7436 has been updated by ko1 (Koichi Sasada).

Assignee changed from ko1 (Koichi Sasada) to matz (Yukihiro Matsumoto)


----------------------------------------
Feature #7436: Allow for a "granularity" flag for backtrace_locations
https://bugs.ruby-lang.org/issues/7436#change-33888

Author: sam.saffron (Sam Saffron)
Status: Assigned
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category: core
Target version: next minor


related to http://bugs.ruby-lang.org/issues/7051

Sometimes one need less information (or more information) associated 
with backtraces.

It would be nice if one could send in a separate flag informing the VM 
about the granularity of information required, eg:

caller_locations(0,-current_depth, BacktraceInfo::Label & 
BacktraceInfo::Lineno)

This allows for one to take quicker backtraces if they need less 
information, additionally BacktraceInfo::Bindings and 
BacktraceInfo::Klass could be added which allow you to gather more 
information for heavy profiling / diagnostics.
Posted by SASADA Koichi (Guest)
on 2012-11-26 00:57
(Received via mailing list)
(2012/11/26 7:06), sam.saffron (Sam Saffron) wrote:
> This allows for one to take quicker backtraces if they need less information, 
additionally BacktraceInfo::Bindings and BacktraceInfo::Klass could be added which 
allow you to gather more information for heavy profiling / diagnostics.

I want to reject to get bindings and klasses with this API.

Please ask matz.
Posted by sam.saffron (Sam Saffron) (Guest)
on 2012-12-10 02:24
(Received via mailing list)
Issue #7436 has been updated by sam.saffron (Sam Saffron).


@matz keep in mind, people are already hacking and using this feature 
externally

https://github.com/banister/binding_of_caller

and

https://github.com/charliesome/better_errors
----------------------------------------
Feature #7436: Allow for a "granularity" flag for backtrace_locations
https://bugs.ruby-lang.org/issues/7436#change-34572

Author: sam.saffron (Sam Saffron)
Status: Assigned
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category: core
Target version: next minor


related to http://bugs.ruby-lang.org/issues/7051

Sometimes one need less information (or more information) associated 
with backtraces.

It would be nice if one could send in a separate flag informing the VM 
about the granularity of information required, eg:

caller_locations(0,-current_depth, BacktraceInfo::Label & 
BacktraceInfo::Lineno)

This allows for one to take quicker backtraces if they need less 
information, additionally BacktraceInfo::Bindings and 
BacktraceInfo::Klass could be added which allow you to gather more 
information for heavy profiling / diagnostics.
Posted by Charles Nutter (headius)
on 2012-12-10 03:18
(Received via mailing list)
Issue #7436 has been updated by headius (Charles Nutter).


As a debugging feature I can support access to arbitrary. As a general, 
runtime, hot-path feature, there's numerous reasons why it's a terrible 
idea:

* It exposes all method-local state to *everyone*. Any library anywhere 
can not only access your local variables but modify them too. A 
potentially massive security hole.
* It requires that all method bodies everywhere in the system maintain 
all frame/scope state regardless of whether it's used or not, since 
"Binding.of_caller" style features could access it at any time.
* It drastically limits optimization potential for Ruby. On a good day, 
JRuby can be 10x or more faster than MRI largely because we've been able 
to eliminate framing/scoping overhead. A Binding.of_caller feature would 
severely damage our performance and very likely limit forever general 
Ruby performance.
----------------------------------------
Feature #7436: Allow for a "granularity" flag for backtrace_locations
https://bugs.ruby-lang.org/issues/7436#change-34574

Author: sam.saffron (Sam Saffron)
Status: Assigned
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category: core
Target version: next minor


related to http://bugs.ruby-lang.org/issues/7051

Sometimes one need less information (or more information) associated 
with backtraces.

It would be nice if one could send in a separate flag informing the VM 
about the granularity of information required, eg:

caller_locations(0,-current_depth, BacktraceInfo::Label & 
BacktraceInfo::Lineno)

This allows for one to take quicker backtraces if they need less 
information, additionally BacktraceInfo::Bindings and 
BacktraceInfo::Klass could be added which allow you to gather more 
information for heavy profiling / diagnostics.
Posted by charliesome (Charlie Somerville) (Guest)
on 2012-12-10 03:33
(Received via mailing list)
Issue #7436 has been updated by charliesome (Charlie Somerville).


=begin
Why not introduce a (({$DEBUG})) variable that tells the runtime to 
enable introspective features like this at the cost of performance? I 
would love for better_errors to run on JRuby, but at the moment it can't 
since JRuby leans too far towards the performance side of the argument 
and there's no way to tell it to disregard performance in favour of 
debuggability.

=end
----------------------------------------
Feature #7436: Allow for a "granularity" flag for backtrace_locations
https://bugs.ruby-lang.org/issues/7436#change-34575

Author: sam.saffron (Sam Saffron)
Status: Assigned
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category: core
Target version: next minor


related to http://bugs.ruby-lang.org/issues/7051

Sometimes one need less information (or more information) associated 
with backtraces.

It would be nice if one could send in a separate flag informing the VM 
about the granularity of information required, eg:

caller_locations(0,-current_depth, BacktraceInfo::Label & 
BacktraceInfo::Lineno)

This allows for one to take quicker backtraces if they need less 
information, additionally BacktraceInfo::Bindings and 
BacktraceInfo::Klass could be added which allow you to gather more 
information for heavy profiling / diagnostics.
Posted by Charles Nutter (headius)
on 2012-12-16 22:58
(Received via mailing list)
Issue #7436 has been updated by headius (Charles Nutter).


A flag that's enabled at runtime would not really work, since 
optimizations might already have happened. There needs to be a way to 
specify that optimizations should be off. In JRuby, the simplest way to 
do that is to turn off the compiler by passing -X-C to JRuby. In that 
case, all code will remain interpreted with full bindings available at 
every ruby level of the stack (we do not provide bindings for native 
methods). Implementing Binding.of_caller in that scenario would be 
pretty simple.

JRuby currently has a --debug flag that turns on things like trace 
functions. It might be reasonable for it to turn on full bindings as 
well, though it would definitely have a major perf impact.
----------------------------------------
Feature #7436: Allow for a "granularity" flag for backtrace_locations
https://bugs.ruby-lang.org/issues/7436#change-34782

Author: sam.saffron (Sam Saffron)
Status: Assigned
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category: core
Target version: next minor


related to http://bugs.ruby-lang.org/issues/7051

Sometimes one need less information (or more information) associated 
with backtraces.

It would be nice if one could send in a separate flag informing the VM 
about the granularity of information required, eg:

caller_locations(0,-current_depth, BacktraceInfo::Label & 
BacktraceInfo::Lineno)

This allows for one to take quicker backtraces if they need less 
information, additionally BacktraceInfo::Bindings and 
BacktraceInfo::Klass could be added which allow you to gather more 
information for heavy profiling / diagnostics.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.