Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 0.9.8
-
Fix Version/s: JRuby 0.9.8
-
Component/s: Core Classes/Modules
-
Labels:None
-
Environment:jruby-trunk, linux
-
Number of attachments :
Description
Pasting from http://archive.jruby.codehaus.org/dev/45D4038E.804%40sun.com:
There seems to be superfluous calls to set_trace_func callback. Every
time a function call, which was not called before, triggers call to
Kernel.hash which is propagated to the callback. Probably the callback
should receive only source-code-related events. But not sure since I'm
not aware of any set_trace_func formal specification.
Probably best to take a look directly at an example. Content of t.rb:
====
printf "%8s %20s:%-2d %10s %8s\n", 'event', 'file', 0, 'id', 'classname'
$stdout.puts "-" * 80
set_trace_func proc { |event, file, line, id, binding, classname|
printf "%8s %20s:%-2d %10s %-8s\n", event, file, line, id ? id : 'nil', classname
}
sleep(0.1)
sleep(0.1)
self.class
hash
self.class
====
Then try to run:
jruby t.rb > t-j.txt && ruby t.rb > t-r.txt && vim d t?.txt
or similar. Output is the same except those Kernel.hash events.
Presumably bug. But asking before filling. If you consider it as "not
a bug" we would probably need to tweak some tests in debug-commons and
might be also debugger itself.
Replace the WeakHashSet in CacheMap with WeakIdentityHashMap, to avoid RubyModule#hashCode getting called.