Bug #6490

The 'printf' method in trace_func is not sent to 'stdout' variable in tracer.rb

Added by Michal Fojtik almost 2 years ago. Updated over 1 year ago.

[ruby-core:45219]
Status:Closed
Priority:Normal
Assignee:Zachary Scott
Category:lib
Target version:1.9.3
ruby -v:ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.4.0] Backport:

Description

Hi,

lib/tracer.rb:189

def tracefunc(event, file, line, id, binding, klass, *) # :nodoc:
return if file == _
FILE__

for p in @filters
  return unless p.call event, file, line, id, binding, klass
end

return unless Tracer::display_c_call? or
  event != "c-call" && event != "c-return"

Tracer::stdout_mutex.synchronize do
  if EVENT_SYMBOL[event]
    stdout.printf("<%d>", $$) if Tracer::display_process_id?
    stdout.printf("#%d:", get_thread_no) if Tracer::display_thread_id?
    if line == 0
      source = "?\n"
    else
      source = get_line(file, line)
    end
    printf("%s:%d:%s:%s: %s",
           file,
           line,
           klass || '',
           EVENT_SYMBOL[event],
           source)
  end
end

end

As you see, the last 'printf' method is not sent to 'stdout' which unfortunately leads to have the output of Tracer print
always to STDOUT.

0001-Bug-6490.patch Magnifier (996 Bytes) Michal Fojtik, 05/25/2012 07:19 AM

Associated revisions

Revision 37741
Added by Zachary Scott over 1 year ago

  • lib/tracer.rb (Tracer.trace_func): printf to stdout Patch by Michal Fojtik [Bug #6490]

History

#1 Updated by Michal Fojtik almost 2 years ago

Attaching patch.

#2 Updated by Yusuke Endoh almost 2 years ago

  • Status changed from Open to Assigned
  • Assignee set to Keiju Ishitsuka

#3 Updated by Zachary Scott over 1 year ago

  • Assignee changed from Keiju Ishitsuka to Yusuke Endoh

mame, could you look at this?

Keiju-san last connection was over 1 year ago.

#4 Updated by Yusuke Endoh over 1 year ago

  • Assignee changed from Yusuke Endoh to Zachary Scott

Looks good to me. Zachary, could you please apply it to trunk?

I guess that Keiju-san does not read English mail (bad!), so I ask him to check your commit in Japanese.

いしつかさん、
Tracer で stdout.printf とすべきところが printf になっちゃってるという報告です。
大丈夫だと思ったので勝手にコミットしてもらうように言ってしまいましたが、問題あったら対処してください。

Yusuke Endoh mame@tsg.ne.jp

#5 Updated by Zachary Scott over 1 year ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r37741.
Michal, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • lib/tracer.rb (Tracer.trace_func): printf to stdout Patch by Michal Fojtik [Bug #6490]

Also available in: Atom PDF